[PATCH 1 of 3] resolve: silence warning of unknown pats for -l/--list

Yuya Nishihara yuya at tcha.org
Wed Feb 11 15:39:41 UTC 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1423630063 -32400
#      Wed Feb 11 13:47:43 2015 +0900
# Node ID dc186553457068fd2865df427ee3023f5e3f1a06
# Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
resolve: silence warning of unknown pats for -l/--list

It was introduced at 232de244ab6f to warn that "hg resolve" did nothing
meaningful. The warning seems not good for "hg resolve -l" because it is
rather like "hg status" or "hg files".

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5328,7 +5328,7 @@ def resolve(ui, repo, *pats, **opts):
 
         ms.commit()
 
-        if not didwork and pats:
+        if not didwork and pats and not show:
             ui.warn(_("arguments do not match paths that need resolving\n"))
 
     finally:
diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -43,10 +43,11 @@ resolve -l should contain unresolved ent
   U file1
   U file2
 
-resolving an unknown path should emit a warning
+resolving an unknown path should emit a warning, but not for -l
 
   $ hg resolve -m does-not-exist
   arguments do not match paths that need resolving
+  $ hg resolve -l does-not-exist
 
 resolve the failure
 


More information about the Mercurial-devel mailing list