# HG changeset patch # User Na'Tosha Bard # Date 1326017991 -3600 # Node ID aca0f2b3c7e31a5c176ea5575131105269d649b5 # Parent 01831f55e972efa2443b530761f34665874d2c30 largefiles: fix confusion upon removal of added largefile (issue3176) This patch makes "hg remove" work the same way on largefiles as it does on regular Mercurial files. If you try to remove an added largefile, the removal fails and you are instead prompted to use "hg forget" to undo the add. diff -r 01831f55e972 -r aca0f2b3c7e3 hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Fri Jan 06 11:15:32 2012 +0100 +++ b/hgext/largefiles/overrides.py Sun Jan 08 11:19:51 2012 +0100 @@ -130,7 +130,7 @@ orig(ui, repo, *pats, **opts) restorematchfn() - after, force = opts.get('after'), opts.get('force') + after = opts.get('after') if not pats and not after: raise util.Abort(_('no files specified')) m = scmutil.match(repo[None], pats, opts) @@ -145,12 +145,10 @@ def warn(files, reason): for f in files: - ui.warn(_('not removing %s: %s (use -f to force removal)\n') + ui.warn(_('not removing %s: %s (use forget to undo)\n') % (m.rel(f), reason)) - if force: - remove, forget = modified + deleted + clean, added - elif after: + if after: remove, forget = deleted, [] warn(modified + added + clean, _('file still exists')) else: diff -r 01831f55e972 -r aca0f2b3c7e3 tests/test-largefiles.t --- a/tests/test-largefiles.t Fri Jan 06 11:15:32 2012 +0100 +++ b/tests/test-largefiles.t Sun Jan 08 11:19:51 2012 +0100 @@ -50,6 +50,18 @@ $ hg commit -m "remove files" $ ls sub + $ echo "testlargefile" > large1-test + $ hg add --large large1-test + $ hg st + A large1-test + $ hg rm large1-test + not removing large1-test: file has been marked for add (use forget to undo) + $ hg st + A large1-test + $ hg forget large1-test + $ hg st + ? large1-test + $ rm large1-test Copy both largefiles and normal files (testing that status output is correct).