mercurial/commands.py
changeset 36607 c6061cadb400
parent 36606 4de15c54e59f
child 36703 7dc1a21d57cc
equal deleted inserted replaced
36606:4de15c54e59f 36607:c6061cadb400
    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 
    65 
    65 release = lockmod.release
    66 release = lockmod.release
    66 
    67 
    67 table = {}
    68 table = {}
    68 table.update(debugcommandsmod.command._table)
    69 table.update(debugcommandsmod.command._table)
   300         repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
   301         repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
   301     ctx = scmutil.revsingle(repo, rev)
   302     ctx = scmutil.revsingle(repo, rev)
   302 
   303 
   303     rootfm = ui.formatter('annotate', opts)
   304     rootfm = ui.formatter('annotate', opts)
   304     if ui.quiet:
   305     if ui.quiet:
   305         datefunc = util.shortdate
   306         datefunc = dateutil.shortdate
   306     else:
   307     else:
   307         datefunc = util.datestr
   308         datefunc = dateutil.datestr
   308     if ctx.rev() is None:
   309     if ctx.rev() is None:
   309         def hexfn(node):
   310         def hexfn(node):
   310             if node is None:
   311             if node is None:
   311                 return None
   312                 return None
   312             else:
   313             else:
   582     if not rev:
   583     if not rev:
   583         raise error.Abort(_("please specify a revision to backout"))
   584         raise error.Abort(_("please specify a revision to backout"))
   584 
   585 
   585     date = opts.get('date')
   586     date = opts.get('date')
   586     if date:
   587     if date:
   587         opts['date'] = util.parsedate(date)
   588         opts['date'] = dateutil.parsedate(date)
   588 
   589 
   589     cmdutil.checkunfinished(repo)
   590     cmdutil.checkunfinished(repo)
   590     cmdutil.bailifchanged(repo)
   591     cmdutil.bailifchanged(repo)
   591     node = scmutil.revsingle(repo, rev).node()
   592     node = scmutil.revsingle(repo, rev).node()
   592 
   593 
  2159     revs.extend(opts.get('rev'))
  2160     revs.extend(opts.get('rev'))
  2160 
  2161 
  2161     if not opts.get('user') and opts.get('currentuser'):
  2162     if not opts.get('user') and opts.get('currentuser'):
  2162         opts['user'] = ui.username()
  2163         opts['user'] = ui.username()
  2163     if not opts.get('date') and opts.get('currentdate'):
  2164     if not opts.get('date') and opts.get('currentdate'):
  2164         opts['date'] = "%d %d" % util.makedate()
  2165         opts['date'] = "%d %d" % dateutil.makedate()
  2165 
  2166 
  2166     editor = cmdutil.getcommiteditor(editform='graft',
  2167     editor = cmdutil.getcommiteditor(editform='graft',
  2167                                      **pycompat.strkwargs(opts))
  2168                                      **pycompat.strkwargs(opts))
  2168 
  2169 
  2169     cont = False
  2170     cont = False
  3009 
  3010 
  3010     patches = (patch1,) + patches
  3011     patches = (patch1,) + patches
  3011 
  3012 
  3012     date = opts.get('date')
  3013     date = opts.get('date')
  3013     if date:
  3014     if date:
  3014         opts['date'] = util.parsedate(date)
  3015         opts['date'] = dateutil.parsedate(date)
  3015 
  3016 
  3016     exact = opts.get('exact')
  3017     exact = opts.get('exact')
  3017     update = not opts.get('bypass')
  3018     update = not opts.get('bypass')
  3018     if not update and opts.get('no_commit'):
  3019     if not update and opts.get('no_commit'):
  3019         raise error.Abort(_('cannot use --no-commit with --bypass'))
  3020         raise error.Abort(_('cannot use --no-commit with --bypass'))
  5305             message = ('Added tag %s for changeset %s' %
  5306             message = ('Added tag %s for changeset %s' %
  5306                        (', '.join(names), short(r)))
  5307                        (', '.join(names), short(r)))
  5307 
  5308 
  5308         date = opts.get('date')
  5309         date = opts.get('date')
  5309         if date:
  5310         if date:
  5310             date = util.parsedate(date)
  5311             date = dateutil.parsedate(date)
  5311 
  5312 
  5312         if opts.get('remove'):
  5313         if opts.get('remove'):
  5313             editform = 'tag.remove'
  5314             editform = 'tag.remove'
  5314         else:
  5315         else:
  5315             editform = 'tag.add'
  5316             editform = 'tag.add'