hgext/githelp.py
changeset 38175 cfa93fbbe9b4
parent 38163 a40cc6d7d8c3
child 38176 c3960c7e66fa
equal deleted inserted replaced
38174:53cc81a8caf6 38175:cfa93fbbe9b4
   168 
   168 
   169         if not opts.get('all'):
   169         if not opts.get('all'):
   170             cmd.extend(args)
   170             cmd.extend(args)
   171         else:
   171         else:
   172             ui.status(_("note: use hg addremove to remove files that have "
   172             ui.status(_("note: use hg addremove to remove files that have "
   173                         "been deleted.\n\n"))
   173                         "been deleted\n\n"))
   174 
   174 
   175     ui.status((bytes(cmd)), "\n")
   175     ui.status((bytes(cmd)), "\n")
   176 
   176 
   177 def am(ui, repo, *args, **kwargs):
   177 def am(ui, repo, *args, **kwargs):
   178     cmdoptions=[
   178     cmdoptions=[
   193     cmd.extend(args)
   193     cmd.extend(args)
   194 
   194 
   195     ui.status((bytes(cmd)), "\n")
   195     ui.status((bytes(cmd)), "\n")
   196 
   196 
   197 def bisect(ui, repo, *args, **kwargs):
   197 def bisect(ui, repo, *args, **kwargs):
   198     ui.status(_("see 'hg help bisect' for how to use bisect.\n\n"))
   198     ui.status(_("see 'hg help bisect' for how to use bisect\n\n"))
   199 
   199 
   200 def blame(ui, repo, *args, **kwargs):
   200 def blame(ui, repo, *args, **kwargs):
   201     cmdoptions = [
   201     cmdoptions = [
   202     ]
   202     ]
   203     args, opts = parseoptions(ui, cmdoptions, args)
   203     args, opts = parseoptions(ui, cmdoptions, args)
   352     if opts.get('edit'):
   352     if opts.get('edit'):
   353         cmd['--edit'] = None
   353         cmd['--edit'] = None
   354     if opts.get('continue'):
   354     if opts.get('continue'):
   355         cmd['--continue'] = None
   355         cmd['--continue'] = None
   356     elif opts.get('abort'):
   356     elif opts.get('abort'):
   357         ui.status(_("note: hg graft does not have --abort.\n\n"))
   357         ui.status(_("note: hg graft does not have --abort\n\n"))
   358         return
   358         return
   359     else:
   359     else:
   360         cmd.extend(args)
   360         cmd.extend(args)
   361 
   361 
   362     ui.status((bytes(cmd)), "\n")
   362     ui.status((bytes(cmd)), "\n")
   454 
   454 
   455     ui.status((bytes(cmd)), "\n")
   455     ui.status((bytes(cmd)), "\n")
   456 
   456 
   457 def deprecated(ui, repo, *args, **kwargs):
   457 def deprecated(ui, repo, *args, **kwargs):
   458     ui.warn(_('this command has been deprecated in the git project, '
   458     ui.warn(_('this command has been deprecated in the git project, '
   459               'thus isn\'t supported by this tool.\n\n'))
   459               'thus isn\'t supported by this tool\n\n'))
   460 
   460 
   461 def diff(ui, repo, *args, **kwargs):
   461 def diff(ui, repo, *args, **kwargs):
   462     cmdoptions = [
   462     cmdoptions = [
   463         ('a', 'all', None, ''),
   463         ('a', 'all', None, ''),
   464         ('', 'cached', None, ''),
   464         ('', 'cached', None, ''),
   468 
   468 
   469     cmd = Command('diff')
   469     cmd = Command('diff')
   470 
   470 
   471     if opts.get('cached'):
   471     if opts.get('cached'):
   472         ui.status(_('note: Mercurial has no concept of a staging area, '
   472         ui.status(_('note: Mercurial has no concept of a staging area, '
   473                     'so --cached does nothing.\n\n'))
   473                     'so --cached does nothing\n\n'))
   474 
   474 
   475     if opts.get('reverse'):
   475     if opts.get('reverse'):
   476         cmd['--reverse'] = None
   476         cmd['--reverse'] = None
   477 
   477 
   478     for a in list(args):
   478     for a in list(args):
   558     ]
   558     ]
   559     args, opts = parseoptions(ui, cmdoptions, args)
   559     args, opts = parseoptions(ui, cmdoptions, args)
   560     ui.status(_('note: -v prints the entire commit message like Git does. To '
   560     ui.status(_('note: -v prints the entire commit message like Git does. To '
   561                 'print just the first line, drop the -v.\n\n'))
   561                 'print just the first line, drop the -v.\n\n'))
   562     ui.status(_("note: see hg help revset for information on how to filter "
   562     ui.status(_("note: see hg help revset for information on how to filter "
   563                 "log output.\n\n"))
   563                 "log output\n\n"))
   564 
   564 
   565     cmd = Command('log')
   565     cmd = Command('log')
   566     cmd['-v'] = None
   566     cmd['-v'] = None
   567 
   567 
   568     if opts.get('number'):
   568     if opts.get('number'):
   653         args = ['A', 'B']
   653         args = ['A', 'B']
   654 
   654 
   655     cmd = Command("log -T '{node}\\n' -r 'ancestor(%s,%s)'"
   655     cmd = Command("log -T '{node}\\n' -r 'ancestor(%s,%s)'"
   656                   % (args[0], args[1]))
   656                   % (args[0], args[1]))
   657 
   657 
   658     ui.status(_('note: ancestors() is part of the revset language.\n'),
   658     ui.status(_('note: ancestors() is part of the revset language\n'),
   659               _("(learn more about revsets with 'hg help revsets')\n\n"))
   659               _("(learn more about revsets with 'hg help revsets')\n\n"))
   660     ui.status((bytes(cmd)), "\n")
   660     ui.status((bytes(cmd)), "\n")
   661 
   661 
   662 def mergetool(ui, repo, *args, **kwargs):
   662 def mergetool(ui, repo, *args, **kwargs):
   663     cmdoptions = []
   663     cmdoptions = []
   752         ui.status(_("note: hg histedit does not perform a rebase. "
   752         ui.status(_("note: hg histedit does not perform a rebase. "
   753                     "It just edits history.\n\n"))
   753                     "It just edits history.\n\n"))
   754         cmd = Command('histedit')
   754         cmd = Command('histedit')
   755         if len(args) > 0:
   755         if len(args) > 0:
   756             ui.status(_("also note: 'hg histedit' will automatically detect"
   756             ui.status(_("also note: 'hg histedit' will automatically detect"
   757                       " your stack, so no second argument is necessary.\n\n"))
   757                       " your stack, so no second argument is necessary\n\n"))
   758         ui.status((bytes(cmd)), "\n")
   758         ui.status((bytes(cmd)), "\n")
   759         return
   759         return
   760 
   760 
   761     if opts.get('skip'):
   761     if opts.get('skip'):
   762         cmd = Command('revert --all -r .')
   762         cmd = Command('revert --all -r .')
   798     if len(args) > 0:
   798     if len(args) > 0:
   799         cmd.append(args[0])
   799         cmd.append(args[0])
   800 
   800 
   801     ui.status(bytes(cmd), "\n\n")
   801     ui.status(bytes(cmd), "\n\n")
   802     ui.status(_("note: in hg commits can be deleted from repo but we always"
   802     ui.status(_("note: in hg commits can be deleted from repo but we always"
   803               " have backups.\n"))
   803               " have backups\n"))
   804 
   804 
   805 def reset(ui, repo, *args, **kwargs):
   805 def reset(ui, repo, *args, **kwargs):
   806     cmdoptions = [
   806     cmdoptions = [
   807         ('', 'soft', None, ''),
   807         ('', 'soft', None, ''),
   808         ('', 'hard', None, ''),
   808         ('', 'hard', None, ''),
   930         if action == 'apply':
   930         if action == 'apply':
   931             cmd['--keep'] = None
   931             cmd['--keep'] = None
   932     elif (action == 'branch' or action == 'show' or action == 'clear'
   932     elif (action == 'branch' or action == 'show' or action == 'clear'
   933         or action == 'create'):
   933         or action == 'create'):
   934         ui.status(_("note: Mercurial doesn't have equivalents to the "
   934         ui.status(_("note: Mercurial doesn't have equivalents to the "
   935                     "git stash branch, show, clear, or create actions.\n\n"))
   935                     "git stash branch, show, clear, or create actions\n\n"))
   936         return
   936         return
   937     else:
   937     else:
   938         if len(args) > 0:
   938         if len(args) > 0:
   939             if args[0] != 'save':
   939             if args[0] != 'save':
   940                 cmd['--name'] = args[0]
   940                 cmd['--name'] = args[0]