# HG changeset patch # User Martin von Zweigbergk # Date 1417499312 28800 # Node ID 3778884197f048402f79836788ba9aaf31338972 # Parent 19ebd2f88fc77282efe724b30de8750f79771e8f 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. diff -r 19ebd2f88fc7 -r 3778884197f0 mercurial/scmutil.py --- 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, diff -r 19ebd2f88fc7 -r 3778884197f0 tests/test-addremove.t --- a/tests/test-addremove.t Mon Dec 01 19:34:11 2014 -0600 +++ b/tests/test-addremove.t Mon Dec 01 21:48:32 2014 -0800 @@ -24,6 +24,21 @@ adding foo $ cd .. + $ hg init subdir + $ cd subdir + $ mkdir dir + $ cd dir + $ touch a.py + $ hg addremove 'glob:*.py' + adding a.py + $ hg forget a.py + $ hg addremove -I 'glob:*.py' + adding a.py + $ hg forget a.py + $ hg addremove + adding dir/a.py + $ cd .. + $ hg init sim $ cd sim $ echo a > a