diff hgext/largefiles/overrides.py @ 22283:cb556ea76dcd

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.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 24 Aug 2014 23:47:25 +0900
parents 23fe278bde43
children 72b378658cff
line wrap: on
line diff
--- 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)