hgext/largefiles/overrides.py
changeset 31653 32d998dc2a00
parent 31618 8228bc8fed8c
child 31654 1af4a1641bdb
--- 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: