diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py index 133d13e445446e07ad2d62de6ebfda7a4df8348b_aGdleHQvbGFyZ2VmaWxlcy9vdmVycmlkZXMucHk=..a02c1ffddae9bc750000a6e73488e63c4283ea7a_aGdleHQvbGFyZ2VmaWxlcy9vdmVycmlkZXMucHk= 100644 --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1018,5 +1018,6 @@ else: ui.status(_('largefiles: %d to upload\n') % len(toupload)) -def overrideaddremove(orig, ui, repo, *pats, **opts): +def scmutiladdremove(orig, repo, pats=[], opts={}, dry_run=None, + similarity=None): if not lfutil.islfilesrepo(repo): @@ -1022,3 +1023,3 @@ if not lfutil.islfilesrepo(repo): - return orig(ui, repo, *pats, **opts) + return orig(repo, pats, opts, dry_run, similarity) # Get the list of missing largefiles so we can remove them @@ -1024,5 +1025,5 @@ # Get the list of missing largefiles so we can remove them - lfdirstate = lfutil.openlfdirstate(ui, repo) + lfdirstate = lfutil.openlfdirstate(repo.ui, repo) s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False, False, False) (unsure, modified, added, removed, missing, unknown, ignored, clean) = s @@ -1034,7 +1035,7 @@ if missing: m = [repo.wjoin(f) for f in missing] repo._isaddremove = True - removelargefiles(ui, repo, *m, **opts) + removelargefiles(repo.ui, repo, *m, **opts) repo._isaddremove = False # Call into the normal add code, and any files that *should* be added as # largefiles will be @@ -1038,8 +1039,8 @@ repo._isaddremove = False # Call into the normal add code, and any files that *should* be added as # largefiles will be - addlargefiles(ui, repo, *pats, **opts) + addlargefiles(repo.ui, repo, *pats, **opts) # Now that we've handled largefiles, hand off to the original addremove # function to take care of the rest. Make sure it doesn't do anything with # largefiles by installing a matcher that will ignore them. installnormalfilesmatchfn(repo[None].manifest()) @@ -1042,8 +1043,8 @@ # Now that we've handled largefiles, hand off to the original addremove # function to take care of the rest. Make sure it doesn't do anything with # largefiles by installing a matcher that will ignore them. installnormalfilesmatchfn(repo[None].manifest()) - result = orig(ui, repo, *pats, **opts) + result = orig(repo, pats, opts, dry_run, similarity) restorematchfn() return result diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py index 133d13e445446e07ad2d62de6ebfda7a4df8348b_aGdleHQvbGFyZ2VmaWxlcy91aXNldHVwLnB5..a02c1ffddae9bc750000a6e73488e63c4283ea7a_aGdleHQvbGFyZ2VmaWxlcy91aXNldHVwLnB5 100644 --- a/hgext/largefiles/uisetup.py +++ b/hgext/largefiles/uisetup.py @@ -9,7 +9,7 @@ '''setup for largefiles extension: uisetup''' from mercurial import archival, cmdutil, commands, extensions, filemerge, hg, \ - httppeer, localrepo, merge, sshpeer, sshserver, wireproto + httppeer, localrepo, merge, scmutil, sshpeer, sshserver, wireproto from mercurial.i18n import _ from mercurial.hgweb import hgweb_mod, protocol, webcommands from mercurial.subrepo import hgsubrepo @@ -30,8 +30,10 @@ '(default: 10)'))] entry[1].extend(addopt) - entry = extensions.wrapcommand(commands.table, 'addremove', - overrides.overrideaddremove) + # The scmutil function is called both by the (trivial) addremove command, + # and in the process of handling commit -A (issue3542) + entry = extensions.wrapfunction(scmutil, 'addremove', + overrides.scmutiladdremove) entry = extensions.wrapcommand(commands.table, 'remove', overrides.overrideremove) entry = extensions.wrapcommand(commands.table, 'forget', diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t index 133d13e445446e07ad2d62de6ebfda7a4df8348b_dGVzdHMvdGVzdC1sYXJnZWZpbGVzLnQ=..a02c1ffddae9bc750000a6e73488e63c4283ea7a_dGVzdHMvdGVzdC1sYXJnZWZpbGVzLnQ= 100644 --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -543,6 +543,33 @@ C sub2/large6 C sub2/large7 +Test commit -A (issue 3542) + $ echo large8 > large8 + $ hg add --large large8 + $ hg ci -Am 'this used to add large8 as normal and commit both' + Invoking status precommit hook + A large8 + Invoking status postcommit hook + C large8 + C normal + C normal3 + C sub/large4 + C sub/normal4 + C sub2/large6 + C sub2/large7 + $ rm large8 + $ hg ci -Am 'this used to not notice the rm' + removing large8 + Invoking status precommit hook + R large8 + Invoking status postcommit hook + C normal + C normal3 + C sub/large4 + C sub/normal4 + C sub2/large6 + C sub2/large7 + Test that a standin can't be added as a large file $ touch large @@ -588,5 +615,15 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: removed large + changeset: 13:0a3e75774479 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: this used to add large8 as normal and commit both + + changeset: 14:84f3d378175c + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: this used to not notice the rm + searching for changes largefiles to upload: @@ -591,5 +628,6 @@ searching for changes largefiles to upload: + large8 large foo