# HG changeset patch # User FUJIWARA Katsunori # Date 1408891645 -32400 # Node ID cb556ea76dcdf2234fb17cbc16bf93cf6baa186f # Parent 4092d12ba18a10e71a55759d48b2ce097a0ad196 largefiles: omit restoring standins if working parent is not rollbacked For efficiency, this patch omits restoring standins and updating lfdirstate, if the parent of the working directory is not rollbacked. This patch adds the test not to confirm whether restoring is skipped or not, but to detect unexpected regression in the future: it is difficult to distinguish between skipping and perfectly restoring. diff -r 4092d12ba18a -r cb556ea76dcd hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Tue Aug 26 13:11:53 2014 +0200 +++ b/hgext/largefiles/overrides.py Sun Aug 24 23:47:25 2014 +0900 @@ -1196,7 +1196,12 @@ def overriderollback(orig, ui, repo, **opts): wlock = repo.wlock() try: + before = repo.dirstate.parents() result = orig(ui, repo, **opts) + after = repo.dirstate.parents() + if before == after: + return result # no need to restore standins + merge.update(repo, node=None, branchmerge=False, force=True, partial=lfutil.isstandin) diff -r 4092d12ba18a -r cb556ea76dcd tests/test-largefiles-update.t --- a/tests/test-largefiles-update.t Tue Aug 26 13:11:53 2014 +0200 +++ b/tests/test-largefiles-update.t Sun Aug 24 23:47:25 2014 +0900 @@ -129,6 +129,29 @@ $ hg status -A largeY ? largeY +Test that "hg rollback" restores standins correctly + + $ hg commit -m 'will be rollback-ed soon' + $ hg update -q -C 2 + $ cat large1 + large1 + $ cat .hglf/large1 + 4669e532d5b2c093a78eca010077e708a071bb64 + $ cat large2 + large2 in #2 + $ cat .hglf/large2 + 3cfce6277e7668985707b6887ce56f9f62f6ccd9 + + $ hg rollback -q -f + $ cat large1 + large1 + $ cat .hglf/large1 + 4669e532d5b2c093a78eca010077e708a071bb64 + $ cat large2 + large2 in #2 + $ cat .hglf/large2 + 3cfce6277e7668985707b6887ce56f9f62f6ccd9 + Test that "hg status" shows status of largefiles correctly just after automated commit like rebase/transplant