diff --git a/hgext/transplant.py b/hgext/transplant.py --- a/hgext/transplant.py +++ b/hgext/transplant.py @@ -763,7 +763,8 @@ 'fname': 'transplant/journal', 'clearable': True, 'allowcommit': False, - 'cmdhint': _("use 'hg transplant --continue' or 'hg update' to abort") + 'cmdhint': _('To continue: hg transplant --continue\n' + 'To abort: hg update') } statemod.addunfinished(**transplantdata) diff --git a/mercurial/state.py b/mercurial/state.py --- a/mercurial/state.py +++ b/mercurial/state.py @@ -98,7 +98,7 @@ """ def __init__(self, cmdname, fname, clearable=False, allowcommit=False, - cmdmsg="", cmdhint=""): + cmdmsg="", cmdhint="", stopflag=False): """cmdname is the name the command fname is the file name in which data should be stored in .hg directory. It is None for merge command. @@ -110,8 +110,10 @@ cmdmsg is used to pass a different status message in case standard message of the format "abort: cmdname in progress" is not required. cmdhint is used to pass a different hint message in case standard - message of the format use 'hg cmdname --continue' or - 'hg cmdname --abort'" is not required. + message of the format "To continue: hg cmdname --continue + To abort: hg cmdname --abort" is not required. + stopflag is a boolean that determines whether or not a command supports + --stop flag """ self._cmdname = cmdname self._fname = fname @@ -119,12 +121,18 @@ self._allowcommit = allowcommit self._cmdhint = cmdhint self._cmdmsg = cmdmsg + self._stopflag = stopflag def hint(self): """returns the hint message corresponding to the command""" if not self._cmdhint: - return (_("use 'hg %s --continue' or 'hg %s --abort'") % - (self._cmdname, self._cmdname)) + hint = (_('To continue: hg %s --continue\n' + 'To abort: hg %s --abort') % (self._cmdname, + self._cmdname)) + if self._stopflag: + hint = hint + (_('\nTo stop: hg %s --stop') % + (self._cmdname)) + return hint return self._cmdhint def msg(self): @@ -161,7 +169,7 @@ 'fname': 'graftstate', 'clearable': True, 'allowcommit': False, - 'cmdhint': _("use 'hg graft --continue' or 'hg graft --stop' to stop") + 'stopflag' : True } addunfinished(**graftdata) bisectdata = { diff --git a/tests/test-absorb-unfinished.t b/tests/test-absorb-unfinished.t --- a/tests/test-absorb-unfinished.t +++ b/tests/test-absorb-unfinished.t @@ -25,6 +25,7 @@ $ hg --config extensions.rebase= absorb abort: rebase in progress - (use 'hg rebase --continue' or 'hg rebase --abort') + (To continue: hg rebase --continue + To abort: hg rebase --abort) [255] diff --git a/tests/test-fix.t b/tests/test-fix.t --- a/tests/test-fix.t +++ b/tests/test-fix.t @@ -801,7 +801,8 @@ $ hg --config extensions.rebase= fix -r . abort: rebase in progress - (use 'hg rebase --continue' or 'hg rebase --abort') + (To continue: hg rebase --continue + To abort: hg rebase --abort) [255] When fixing a file that was renamed, we should diff against the source of the diff --git a/tests/test-graft.t b/tests/test-graft.t --- a/tests/test-graft.t +++ b/tests/test-graft.t @@ -278,14 +278,18 @@ # # To mark files as resolved: hg resolve --mark FILE - # use 'hg graft --continue' or 'hg graft --stop' to stop + # To continue: hg graft --continue + # To abort: hg graft --abort + # To stop: hg graft --stop Commit while interrupted should fail: $ hg ci -m 'commit interrupted graft' abort: graft in progress - (use 'hg graft --continue' or 'hg graft --stop' to stop) + (To continue: hg graft --continue + To abort: hg graft --abort + To stop: hg graft --stop) [255] Abort the graft and try committing: diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t --- a/tests/test-histedit-arguments.t +++ b/tests/test-histedit-arguments.t @@ -494,7 +494,8 @@ continue: hg histedit --continue $ hg commit --amend -m 'reject this fold' abort: histedit in progress - (use 'hg histedit --continue' or 'hg histedit --abort') + (To continue: hg histedit --continue + To abort: hg histedit --abort) [255] With markers enabled, histedit does not get confused, and diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -81,7 +81,8 @@ try to update and get an error $ hg update tip abort: histedit in progress - (use 'hg histedit --continue' or 'hg histedit --abort') + (To continue: hg histedit --continue + To abort: hg histedit --abort) [255] edit the plan via the editor @@ -135,7 +136,8 @@ 3+ $ hg up 0 abort: histedit in progress - (use 'hg histedit --continue' or 'hg histedit --abort') + (To continue: hg histedit --continue + To abort: hg histedit --abort) [255] Try to delete necessary commit @@ -152,7 +154,8 @@ $ hg --config extensions.mq= qnew please-fail abort: histedit in progress - (use 'hg histedit --continue' or 'hg histedit --abort') + (To continue: hg histedit --continue + To abort: hg histedit --abort) [255] $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t --- a/tests/test-histedit-fold.t +++ b/tests/test-histedit-fold.t @@ -306,7 +306,8 @@ # # To mark files as resolved: hg resolve --mark FILE - # use 'hg histedit --continue' or 'hg histedit --abort' + # To continue: hg histedit --continue + # To abort: hg histedit --abort $ hg resolve -l U file diff --git a/tests/test-histedit-no-change.t b/tests/test-histedit-no-change.t --- a/tests/test-histedit-no-change.t +++ b/tests/test-histedit-no-change.t @@ -168,7 +168,8 @@ abort editing session, after first forcibly updating away $ hg up 0 abort: histedit in progress - (use 'hg histedit --continue' or 'hg histedit --abort') + (To continue: hg histedit --continue + To abort: hg histedit --abort) [255] $ mv .hg/histedit-state .hg/histedit-state-ignore $ hg up 0 diff --git a/tests/test-qrecord.t b/tests/test-qrecord.t --- a/tests/test-qrecord.t +++ b/tests/test-qrecord.t @@ -459,5 +459,6 @@ > n > EOF abort: histedit in progress - (use 'hg histedit --continue' or 'hg histedit --abort') - [255] + (To continue: hg histedit --continue + To abort: hg histedit --abort) + [255] diff --git a/tests/test-rebase-abort.t b/tests/test-rebase-abort.t --- a/tests/test-rebase-abort.t +++ b/tests/test-rebase-abort.t @@ -319,7 +319,8 @@ $ echo new > a $ hg up 1 # user gets an error saying to run hg rebase --abort abort: rebase in progress - (use 'hg rebase --continue' or 'hg rebase --abort') + (To continue: hg rebase --continue + To abort: hg rebase --abort) [255] $ cat a @@ -389,20 +390,24 @@ $ hg rebase -s 3 -d tip abort: rebase in progress - (use 'hg rebase --continue' or 'hg rebase --abort') + (To continue: hg rebase --continue + To abort: hg rebase --abort) [255] $ hg up . abort: rebase in progress - (use 'hg rebase --continue' or 'hg rebase --abort') + (To continue: hg rebase --continue + To abort: hg rebase --abort) [255] $ hg up -C . abort: rebase in progress - (use 'hg rebase --continue' or 'hg rebase --abort') + (To continue: hg rebase --continue + To abort: hg rebase --abort) [255] $ hg graft 3 abort: rebase in progress - (use 'hg rebase --continue' or 'hg rebase --abort') + (To continue: hg rebase --continue + To abort: hg rebase --abort) [255] $ hg rebase --abort diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t --- a/tests/test-rebase-conflicts.t +++ b/tests/test-rebase-conflicts.t @@ -80,7 +80,8 @@ # # To mark files as resolved: hg resolve --mark FILE - # use 'hg rebase --continue' or 'hg rebase --abort' + # To continue: hg rebase --continue + # To abort: hg rebase --abort Try to continue without solving the conflict: diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t --- a/tests/test-rebase-obsolete.t +++ b/tests/test-rebase-obsolete.t @@ -2054,7 +2054,8 @@ $ hg rebase -s 3 -d 5 abort: rebase in progress - (use 'hg rebase --continue' or 'hg rebase --abort') + (To continue: hg rebase --continue + To abort: hg rebase --abort) [255] $ hg rebase --stop --continue abort: cannot use --stop with --continue diff --git a/tests/test-rebase-pull.t b/tests/test-rebase-pull.t --- a/tests/test-rebase-pull.t +++ b/tests/test-rebase-pull.t @@ -93,7 +93,8 @@ [1] $ hg pull --rebase abort: histedit in progress - (use 'hg histedit --continue' or 'hg histedit --abort') + (To continue: hg histedit --continue + To abort: hg histedit --abort) [255] $ hg histedit --abort --quiet diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -375,7 +375,8 @@ # # To mark files as resolved: hg resolve --mark FILE - # use 'hg unshelve --continue' or 'hg unshelve --abort' + # To continue: hg unshelve --continue + # To abort: hg unshelve --abort ensure that we have a merge with unresolved conflicts @@ -426,7 +427,8 @@ $ hg shelve abort: unshelve already in progress - (use 'hg unshelve --continue' or 'hg unshelve --abort') + (To continue: hg unshelve --continue + To abort: hg unshelve --abort) [255] abort the unshelve and be happy @@ -484,7 +486,8 @@ $ hg commit -m 'commit while unshelve in progress' abort: unshelve already in progress - (use 'hg unshelve --continue' or 'hg unshelve --abort') + (To continue: hg unshelve --continue + To abort: hg unshelve --abort) [255] $ hg graft --continue diff --git a/tests/test-transplant.t b/tests/test-transplant.t --- a/tests/test-transplant.t +++ b/tests/test-transplant.t @@ -481,7 +481,8 @@ [255] $ hg transplant 1:3 abort: transplant in progress - (use 'hg transplant --continue' or 'hg update' to abort) + (To continue: hg transplant --continue + To abort: hg update) [255] $ echo fixed > baz $ hg transplant --continue