# HG changeset patch
# User FUJIWARA Katsunori <fo...@lares.dti.ne.jp>
# Date 1490575474 -32400
#      Mon Mar 27 09:44:34 2017 +0900
# Node ID b279d4b86fd671556ada1ce24a14a39894b6aa11
# Parent  936283df3680c7106951d752c9055f438d667411
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).

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1397,6 +1397,7 @@ def mergeupdate(orig, repo, node, branch
                                       [], 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 @@ def mergeupdate(orig, repo, node, branch
                 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:
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to