Comments
Patch
@@ -4922,16 +4922,21 @@ def resolve(ui, repo, *pats, **opts):
raise util.Abort(_("too many options specified"))
if pats and all:
raise util.Abort(_("can't specify --all and patterns"))
if not (all or pats or show or mark or unmark):
raise util.Abort(_('no files or directories specified; '
'use --all to remerge all files'))
ms = mergemod.mergestate(repo)
+
+ if not ms:
+ raise util.Abort(_('no merge in progress; '
+ 'resolve command not applicable'))
+
m = scmutil.match(repo[None], pats, opts)
ret = 0
for f in ms:
if not m(f):
continue
if show:
@@ -80,16 +80,18 @@ edit the history
abort the edit
$ hg histedit --abort 2>&1 | fixbundle
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
log after abort
$ hg resolve -l
+ abort: no merge in progress; resolve command not applicable
+ [255]
$ hg log --graph
@ changeset: 6:bfa474341cc9
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: does not commute with e
|
o changeset: 5:652413bf663e
@@ -32,19 +32,21 @@ resolve -l should contain an unresolved
U file
resolve the failure
$ echo resolved > file
$ hg resolve -m file
$ hg commit -m 'resolved'
-resolve -l, should be empty
+resolve -l should error since no merge in progress
$ hg resolve -l
+ abort: no merge in progress; resolve command not applicable
+ [255]
test crashed merge with empty mergestate
$ mkdir .hg/merge
$ touch .hg/merge/state
resolve -l, should be empty
@@ -257,16 +257,18 @@ abort the unshelve and be happy
$ hg parents
changeset: 3:2e69b451d1ea
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: second
$ hg resolve -l
+ abort: no merge in progress; resolve command not applicable
+ [255]
$ hg status
A foo/foo
? a/a.orig
try to continue with no unshelve underway
$ hg unshelve -c
abort: no unshelve operation underway