diff hgext/largefiles/lfcommands.py @ 22095:cb62d77c7a01

largefiles: factor out synchronization of lfdirstate for future use
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Mon, 11 Aug 2014 22:29:43 +0900
parents 0cb34b3991f8
children f72d73937853
line wrap: on
line diff
--- a/hgext/largefiles/lfcommands.py	Mon Aug 11 22:29:43 2014 +0900
+++ b/hgext/largefiles/lfcommands.py	Mon Aug 11 22:29:43 2014 +0900
@@ -510,26 +510,7 @@
 
             updated += update1
 
-            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':
-                if normallookup or mtime < 0:
-                    # state 'n' doesn't ensure 'clean' in this case
-                    lfdirstate.normallookup(lfile)
-                else:
-                    lfdirstate.normal(lfile)
-            elif state == 'm':
-                lfdirstate.normallookup(lfile)
-            elif state == 'r':
-                lfdirstate.remove(lfile)
-            elif state == 'a':
-                lfdirstate.add(lfile)
-            elif state == '?':
-                lfdirstate.drop(lfile)
+            lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup)
 
         lfdirstate.write()
         if printmessage and lfiles: