diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -669,18 +669,18 @@ def overriderevert(orig, ui, repo, *pats finally: wlock.release() -def hgupdate(orig, repo, node): - # Only call updatelfiles the standins that have changed to save time - oldstandins = lfutil.getstandinsstate(repo) - result = orig(repo, node) - newstandins = lfutil.getstandinsstate(repo) - filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) - lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=True) - return result +def hgupdaterepo(orig, repo, node, overwrite): + if not overwrite: + # Only call updatelfiles on the standins that have changed to save time + oldstandins = lfutil.getstandinsstate(repo) -def hgclean(orig, repo, node, show_stats=True): - result = orig(repo, node, show_stats) - lfcommands.updatelfiles(repo.ui, repo) + result = orig(repo, node, overwrite) + + filelist = None + if not overwrite: + newstandins = lfutil.getstandinsstate(repo) + filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) + lfcommands.updatelfiles(repo.ui, repo, filelist=filelist) return result def hgmerge(orig, repo, node, force=None, remind=True): diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py --- a/hgext/largefiles/uisetup.py +++ b/hgext/largefiles/uisetup.py @@ -109,11 +109,7 @@ def uisetup(ui): entry = extensions.wrapfunction(commands, 'revert', overrides.overriderevert) - # clone uses hg._update instead of hg.update even though they are the - # same function... so wrap both of them) - extensions.wrapfunction(hg, 'update', overrides.hgupdate) - extensions.wrapfunction(hg, '_update', overrides.hgupdate) - extensions.wrapfunction(hg, 'clean', overrides.hgclean) + extensions.wrapfunction(hg, 'updaterepo', overrides.hgupdaterepo) extensions.wrapfunction(hg, 'merge', overrides.hgmerge) extensions.wrapfunction(archival, 'archive', overrides.overridearchive) diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t --- a/tests/test-issue3084.t +++ b/tests/test-issue3084.t @@ -16,9 +16,9 @@ Create the repository outside $HOME sinc $ hg commit -m "Add foo as a largefile" $ hg update -r 0 - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved getting changed largefiles 0 largefiles updated, 1 removed + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "normal" > foo $ hg add foo diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t --- a/tests/test-largefiles-cache.t +++ b/tests/test-largefiles-cache.t @@ -45,27 +45,27 @@ but there is no cache file for it. So, "missing"(!) file. $ hg update - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally (glob) 0 largefiles updated, 0 removed + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status ! large Update working directory to null: this cleanup .hg/largefiles/dirstate $ hg update null - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved getting changed largefiles 0 largefiles updated, 0 removed + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Update working directory to tip, again. $ hg update - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally (glob) 0 largefiles updated, 0 removed + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status ! large $ cd .. diff --git a/tests/test-largefiles-small-disk.t b/tests/test-largefiles-small-disk.t --- a/tests/test-largefiles-small-disk.t +++ b/tests/test-largefiles-small-disk.t @@ -57,7 +57,6 @@ makes copies instead of hardlinks: adding file changes added 1 changesets with 1 changes to 1 files updating to branch default - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles abort: No space left on device [255] diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -506,9 +506,9 @@ accident. Test addremove with -R $ hg up -C - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 1 largefiles updated, 0 removed + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm normal3 $ rm sub/large4 $ echo "testing addremove with patterns" > testaddremove.dat @@ -524,9 +524,9 @@ Test addremove with -R Test 3364 $ hg clone . ../addrm updating to branch default - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../addrm $ cat >> .hg/hgrc < [hooks] @@ -604,9 +604,9 @@ Test 3507 (both normal files and largefi C sub2/large6 C sub2/large7 $ hg up -C '.^' - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 0 largefiles updated, 0 removed + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg remove large $ hg addremove --traceback $ hg ci -m "removed large" @@ -715,9 +715,9 @@ Clone a largefiles repo. $ hg clone . ../b updating to branch default - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../b $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 7:daea875e9014 add/edit more largefiles @@ -745,9 +745,9 @@ Clone a largefiles repo. adding file changes added 4 changesets with 10 changes to 4 files updating to branch default - 4 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 2 largefiles updated, 0 removed + 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd c $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 3:9e8fbc4bce62 copy files @@ -767,9 +767,9 @@ Old revisions of a clone have correct la tests update). $ hg update -r 1 - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 1 largefiles updated, 0 removed + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat large1 large11 $ cat sub/large2 @@ -781,17 +781,17 @@ Test cloning with --all-largefiles flag $ rm "${USERCACHE}"/* $ hg clone --all-largefiles a a-backup updating to branch default - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved 8 additional largefiles cached $ rm "${USERCACHE}"/* $ hg clone --all-largefiles -u 0 a a-clone0 updating to branch default - 4 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 2 largefiles updated, 0 removed + 4 files updated, 0 files merged, 0 files removed, 0 files unresolved 9 additional largefiles cached $ hg -R a-clone0 sum parent: 0:30d30fe6a5be @@ -803,9 +803,9 @@ Test cloning with --all-largefiles flag $ rm "${USERCACHE}"/* $ hg clone --all-largefiles -u 1 a a-clone1 updating to branch default - 4 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 2 largefiles updated, 0 removed + 4 files updated, 0 files merged, 0 files removed, 0 files unresolved 8 additional largefiles cached $ hg -R a-clone1 sum parent: 1:ce8896473775 @@ -828,9 +828,9 @@ Test cloning with --all-largefiles flag $ hg clone ../a destination directory: a updating to branch default - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. Ensure base clone command argument validation @@ -854,9 +854,9 @@ downloaded from 'default' instead of 'de adding file changes added 2 changesets with 8 changes to 4 files updating to branch default - 4 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 2 largefiles updated, 0 removed + 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm "${USERCACHE}"/* $ cd a-backup $ hg pull --all-largefiles --config paths.default-push=bogus/path @@ -877,9 +877,9 @@ revisions (this was a very bad bug that $ hg clone a d updating to branch default - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd b $ echo large4-modified > sub/large4 $ echo normal3-modified > normal3 @@ -897,9 +897,9 @@ revisions (this was a very bad bug that $ cd .. $ hg clone d e updating to branch default - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd d More rebase testing, but also test that the largefiles are downloaded from @@ -1065,9 +1065,9 @@ Rollback on largefiles. $ hg revert sub2/large7 $ hg -q update --clean -r null $ hg update --clean - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat normal3 normal3-modified $ cat sub/normal4 @@ -1086,22 +1086,22 @@ Rollback on largefiles. demonstrate misfeature: .orig file is overwritten on every update -C, also when clean: $ hg update --clean - 0 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 0 largefiles updated, 0 removed + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat sub2/large7.orig large7 $ rm sub2/large7.orig .hglf/sub2/large7.orig Now "update check" is happy. $ hg update --check 8 - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 1 largefiles updated, 0 removed + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg update --check - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 1 largefiles updated, 0 removed + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Test removing empty largefiles directories on update $ test -d sub2 && echo "sub2 exists" @@ -1190,14 +1190,14 @@ correctly. adding file changes added 8 changesets with 24 changes to 10 files updating to branch default - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone temp f updating to branch default - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved # Delete the largefiles in the largefiles system cache so that we have an # opportunity to test that caching after a pull works. $ rm "${USERCACHE}"/* @@ -1289,9 +1289,9 @@ Test that transplanting a largefile chan adding file changes added 9 changesets with 26 changes to 10 files updating to branch default - 5 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 3 largefiles updated, 0 removed + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd g $ hg transplant -s ../d 598410d3eb9a searching for changes @@ -1551,7 +1551,6 @@ Clone over http, with largefiles being p .hglf/f1: remote created -> g updating: .hglf/f1 1/1 files (100.00%) getting .hglf/f1 - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles using http://localhost:$HGPORT2/ sending capabilities command @@ -1561,6 +1560,7 @@ Clone over http, with largefiles being p sending getlfile command found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store 1 largefiles updated, 0 removed + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ ls http-clone-usercache/* http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90 @@ -1601,9 +1601,9 @@ We have to simulate that here by setting adding file changes added 1 changesets with 1 changes to 1 files updating to branch default - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 1 largefiles updated, 0 removed + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. $ chmod -R u+w alice/pubrepo $ HOME="$ORIGHOME" @@ -1755,23 +1755,48 @@ Lock in subrepo, otherwise the change is A normal.txt Invoking status precommit hook M .hgsubstate - $ hg archive -S lf_subrepo_archive - $ find lf_subrepo_archive | sort - lf_subrepo_archive - lf_subrepo_archive/.hg_archival.txt - lf_subrepo_archive/.hgsub - lf_subrepo_archive/.hgsubstate - lf_subrepo_archive/a - lf_subrepo_archive/a/b - lf_subrepo_archive/a/b/c - lf_subrepo_archive/a/b/c/d - lf_subrepo_archive/a/b/c/d/e.large.txt - lf_subrepo_archive/a/b/c/d/e.normal.txt - lf_subrepo_archive/a/b/c/x - lf_subrepo_archive/a/b/c/x/y.normal.txt - lf_subrepo_archive/subrepo - lf_subrepo_archive/subrepo/large.txt - lf_subrepo_archive/subrepo/normal.txt + $ hg archive -S ../lf_subrepo_archive + $ find ../lf_subrepo_archive | sort + ../lf_subrepo_archive + ../lf_subrepo_archive/.hg_archival.txt + ../lf_subrepo_archive/.hgsub + ../lf_subrepo_archive/.hgsubstate + ../lf_subrepo_archive/a + ../lf_subrepo_archive/a/b + ../lf_subrepo_archive/a/b/c + ../lf_subrepo_archive/a/b/c/d + ../lf_subrepo_archive/a/b/c/d/e.large.txt + ../lf_subrepo_archive/a/b/c/d/e.normal.txt + ../lf_subrepo_archive/a/b/c/x + ../lf_subrepo_archive/a/b/c/x/y.normal.txt + ../lf_subrepo_archive/subrepo + ../lf_subrepo_archive/subrepo/large.txt + ../lf_subrepo_archive/subrepo/normal.txt + +Test update with subrepos. + + $ hg update 0 + getting changed largefiles + 0 largefiles updated, 1 removed + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ hg status -S + $ hg update tip + getting changed largefiles + 1 largefiles updated, 0 removed + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg status -S +# modify a large file + $ echo "modified" > subrepo/large.txt + $ hg st -S + M subrepo/large.txt +# update -C should revert the change. + $ hg update -C + getting changed largefiles + 1 largefiles updated, 0 removed + getting changed largefiles + 0 largefiles updated, 0 removed + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg status -S Test archiving a revision that references a subrepo that is not yet cloned (see test-subrepo-recursion.t): diff --git a/tests/test-lfconvert.t b/tests/test-lfconvert.t --- a/tests/test-lfconvert.t +++ b/tests/test-lfconvert.t @@ -78,9 +78,9 @@ Test link+rename largefile codepath "lfconvert" converts content correctly $ cd largefiles-repo $ hg up - 4 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 2 largefiles updated, 0 removed + 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg locate .hglf/large .hglf/sub/maybelarge.dat @@ -187,9 +187,9 @@ lfconvert with rename, merge, and remove normal1 stuff/normal2 $ hg update - 3 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 1 largefiles updated, 0 removed + 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat stuff/normal2 alsonormal blah