hgext/largefiles/lfcommands.py
branchstable
changeset 21932 21a2f31f054d
parent 21785 a730b002c5db
child 21933 8ecbe55fd09d
--- a/hgext/largefiles/lfcommands.py	Tue Jul 22 23:59:30 2014 +0900
+++ b/hgext/largefiles/lfcommands.py	Tue Jul 22 23:59:34 2014 +0900
@@ -509,12 +509,15 @@
 
             updated += update1
 
-            state = repo.dirstate[lfutil.standin(lfile)]
+            standin = lfutil.standin(lfile)
+            if standin in repo.dirstate:
+                stat = repo.dirstate._map[standin]
+                state, mtime = stat[0], stat[3]
+            else:
+                state, mtime = '?', -1
             if state == 'n':
-                # When rebasing, we need to synchronize the standin and the
-                # largefile, because otherwise the largefile will get reverted.
-                # But for commit's sake, we have to mark the file as unclean.
-                if getattr(repo, "_isrebasing", False):
+                if mtime < 0:
+                    # state 'n' doesn't ensure 'clean' in this case
                     lfdirstate.normallookup(lfile)
                 else:
                     lfdirstate.normal(lfile)