diff mercurial/scmutil.py @ 23427:3778884197f0

addremove: print relative paths when called with -I/-X (BC) For "hg addremove 'glob:*.py'", we print any paths added or removed as relative to the current directory, but when "hg addremove -I 'glob:*.py'" is used, we use the absolute path (relative from the repo root). It seems like they should be the same, so change it so we use relative paths in both cases. Continue to use absolute paths when no patterns are given.
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 01 Dec 2014 21:48:32 -0800
parents 1df6519eb3ab
children 94091ab9d112
line wrap: on
line diff
--- a/mercurial/scmutil.py	Mon Dec 01 19:34:11 2014 -0600
+++ b/mercurial/scmutil.py	Mon Dec 01 21:48:32 2014 -0800
@@ -732,9 +732,9 @@
         if repo.ui.verbose or not m.exact(abs):
             rel = m.rel(abs)
             if abs in unknownset:
-                status = _('adding %s\n') % ((pats and rel) or abs)
+                status = _('adding %s\n') % ((m.anypats() and rel) or abs)
             else:
-                status = _('removing %s\n') % ((pats and rel) or abs)
+                status = _('removing %s\n') % ((m.anypats() and rel) or abs)
             repo.ui.status(status)
 
     renames = _findrenames(repo, m, added + unknown, removed + deleted,