mercurial/commands.py
changeset 37084 f0b6fbea00cf
parent 37066 b33b91ca2ec2
child 37113 704932ef8913
equal deleted inserted replaced
37083:f99d64e8a4e4 37084:f0b6fbea00cf
    59     templatekw,
    59     templatekw,
    60     ui as uimod,
    60     ui as uimod,
    61     util,
    61     util,
    62     wireprotoserver,
    62     wireprotoserver,
    63 )
    63 )
    64 from .utils import dateutil
    64 from .utils import (
       
    65     dateutil,
       
    66     stringutil,
       
    67 )
    65 
    68 
    66 release = lockmod.release
    69 release = lockmod.release
    67 
    70 
    68 table = {}
    71 table = {}
    69 table.update(debugcommandsmod.command._table)
    72 table.update(debugcommandsmod.command._table)
  2467             datefmt = '%a %b %d %H:%M:%S %Y %1%2'
  2470             datefmt = '%a %b %d %H:%M:%S %Y %1%2'
  2468         found = False
  2471         found = False
  2469         @util.cachefunc
  2472         @util.cachefunc
  2470         def binary():
  2473         def binary():
  2471             flog = getfile(fn)
  2474             flog = getfile(fn)
  2472             return util.binary(flog.read(ctx.filenode(fn)))
  2475             return stringutil.binary(flog.read(ctx.filenode(fn)))
  2473 
  2476 
  2474         fieldnamemap = {'filename': 'file', 'linenumber': 'line_number'}
  2477         fieldnamemap = {'filename': 'file', 'linenumber': 'line_number'}
  2475         if opts.get('all'):
  2478         if opts.get('all'):
  2476             iter = difflinestates(pstates, states)
  2479             iter = difflinestates(pstates, states)
  2477         else:
  2480         else:
  3912         return
  3915         return
  3913     if optupdate:
  3916     if optupdate:
  3914         try:
  3917         try:
  3915             return hg.updatetotally(ui, repo, checkout, brev)
  3918             return hg.updatetotally(ui, repo, checkout, brev)
  3916         except error.UpdateAbort as inst:
  3919         except error.UpdateAbort as inst:
  3917             msg = _("not updating: %s") % util.forcebytestr(inst)
  3920             msg = _("not updating: %s") % stringutil.forcebytestr(inst)
  3918             hint = inst.hint
  3921             hint = inst.hint
  3919             raise error.UpdateAbort(msg, hint=hint)
  3922             raise error.UpdateAbort(msg, hint=hint)
  3920     if modheads > 1:
  3923     if modheads > 1:
  3921         currentbranchheads = len(repo.branchheads())
  3924         currentbranchheads = len(repo.branchheads())
  3922         if currentbranchheads == modheads:
  3925         if currentbranchheads == modheads: