largefiles: omit updating newly added standin at linear merging
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Mon, 27 Mar 2017 09:44:34 +0900
changeset 31658 32d998dc2a00
parent 31657 d5cbbee542eb
child 31659 1af4a1641bdb
largefiles: omit updating newly added standin at linear merging Updating standin for newly added largefile is needed, only if same name largefile exists in destination context at linear merging. In such case, updated standin is used to detect divergence of largefile at overridefilemerge(). Otherwise, standin doesn't have any responsibility for its content (usually, it is empty).
hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py	Mon Mar 27 09:44:34 2017 +0900
+++ b/hgext/largefiles/overrides.py	Mon Mar 27 09:44:34 2017 +0900
@@ -1397,6 +1397,7 @@
                                       [], False, True, False)
         oldclean = set(s.clean)
         pctx = repo['.']
+        dctx = repo[node]
         for lfile in unsure + s.modified:
             lfileabs = repo.wvfs.join(lfile)
             if not repo.wvfs.exists(lfileabs):
@@ -1409,7 +1410,12 @@
                 lfhash == lfutil.readstandin(repo, lfile, pctx)):
                 oldclean.add(lfile)
         for lfile in s.added:
-            lfutil.updatestandin(repo, lfutil.standin(lfile))
+            fstandin = lfutil.standin(lfile)
+            if fstandin not in dctx:
+                # in this case, content of standin file is meaningless
+                # (in dctx, lfile is unknown, or normal file)
+                continue
+            lfutil.updatestandin(repo, fstandin)
         # mark all clean largefiles as dirty, just in case the update gets
         # interrupted before largefiles and lfdirstate are synchronized
         for lfile in oldclean: