# HG changeset patch # User Matt Harbison # Date 2014-11-28 19:21:02 # Node ID 55c92618fdd4ddf43c4cfc150f3fa9192f807c96 # Parent 95f238cafb32b9a852d71585e666bb04369a4fa8 largefiles: eliminate a duplicate message when removing files in verbose mode There is no --after for addremove, so the printing for addremove can be hoisted out of the 'not after' check. The difference between the two remove messages reflects the existing difference between core remove and core addremove styles for printing the file. There are still some pre-existing issues here. Core addremove only prints on inexact matches or when verbose. But since the largefiles that are being removed are passed to removelargefiles() as a pattern list, there is never an inexact match, which would keep the largefiles from being printed at all unless verbose is specified. Therefore, the output is a little more aggressive than core. The addremove print style here is also inconsistent with core- it should use matcher.uipath(f) instead of f. These can be fixed once a matcher is passed in. diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -189,21 +189,16 @@ def removelargefiles(ui, repo, isaddremo result = warn(added, _('not removing %s: file has been marked for add' ' (use forget to undo)\n')) or result - for f in sorted(remove): - if ui.verbose or not m.exact(f): - ui.status(_('removing %s\n') % m.rel(f)) - # Need to lock because standin files are deleted then removed from the # repository and we could race in-between. wlock = repo.wlock() try: lfdirstate = lfutil.openlfdirstate(ui, repo) - for f in remove: - if not after: - # If this is being called by addremove, notify the user that we - # are removing the file. - if isaddremove: - ui.status(_('removing %s\n') % f) + for f in sorted(remove): + if isaddremove: + ui.status(_('removing %s\n') % f) + elif ui.verbose or not m.exact(f): + ui.status(_('removing %s\n') % m.rel(f)) if not opts.get('dry_run'): if not after: diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -491,7 +491,7 @@ Test addremove with -R $ echo "testing addremove with patterns" > testaddremove.dat $ echo "normaladdremove" > normaladdremove $ cd .. - $ hg -R a addremove + $ hg -R a -v addremove removing sub/large4 adding a/testaddremove.dat as a largefile (glob) removing normal3