Bug 4208 - hg resolve -m silently does nothing
Summary: hg resolve -m silently does nothing
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Gregory Szorc
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-26 14:17 UTC by Gregory Szorc
Modified: 2014-07-19 14:17 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Szorc 2014-03-26 14:17 UTC
|hg resolve -m| (2.9.1+185-9a09a625bc93) doesn't output any messages when silly things occur. I think it should be more chatty when the expected operation didn't do anything. AFAIK, this is not a regression.

# There is no merge status to resolve
$ hg resolve -l
<no output>
$ hg resolve -m file-that-exists
<no output>

Should resolve say it didn't actually do anything?

# Passing an invalid path seems to work
$ hg resolve -m file-that-does-not-exist
<no output>
$ echo $?
0
$ hg rebase --continue
abort: unresolved merge conflicts (see hg help resolve)

I did this just now by typing a root-relative path while I was in a subdirectory. It left me scratching my head. "But I just resolved that file!... Ohhh."
Comment 1 Gregory Szorc 2014-04-23 17:44 UTC
I have a patch ready to go for this. Will hopefully land at the same time as bug 4214.
Comment 2 HG Bot 2014-05-09 16:15 UTC
Fixed by http://selenic.com/repo/hg/rev/232de244ab6f
Gregory Szorc <gregory.szorc@gmail.com>
resolve: print warning when no work performed (issue4208)

Previously, if the paths specified as arguments to |hg resolve| were
invalid, they were silently ignored and a no-op would ensue.

This patch fixes that in some scenarios.

If none of the paths specified to |hg resolve| match a path that is in
mergestate, a warning will be emitted.

Ideally, a warning would be emitted for every path/pattern specified
that doesn't match anything. To achieve this would require significant
refactoring of the matching subsystem. That work is beyond the scope of
this patch series. Something is better than nothing and this patch
gets us something.

(please test the fix)