diff hgext/largefiles/reposetup.py @ 22523:8cd91f481ffd

largefiles: remove unnecessary clearing of status fields At the end of lfilesrepo.status(), we clear the lists of unknown, ignored and clean files, depending on the values of 'listunknown' etc. The lists originate from other calls to status(), and it is only 'clean' that may get updated after the calls. Let's remove the need to clear any of the lists by explicitly only adding to 'clean' when 'listclean' is true.
author Martin von Zweigbergk <martinvonz@gmail.com>
date Mon, 22 Sep 2014 13:05:36 -0700
parents 52dd6e25121f
children 8c8fe120670f
line wrap: on
line diff
--- a/hgext/largefiles/reposetup.py	Wed Sep 24 01:39:25 2014 +0200
+++ b/hgext/largefiles/reposetup.py	Mon Sep 22 13:05:36 2014 -0700
@@ -173,7 +173,8 @@
                                     != lfutil.hashfile(self.wjoin(lfile)):
                                 modified.append(lfile)
                             else:
-                                clean.append(lfile)
+                                if listclean:
+                                    clean.append(lfile)
                                 lfdirstate.normal(lfile)
                     else:
                         tocheck = unsure + modified + added + clean
@@ -185,7 +186,7 @@
                                 if ctx1[standin].data().strip() != \
                                         lfutil.hashfile(self.wjoin(lfile)):
                                     modified.append(lfile)
-                                else:
+                                elif listclean:
                                     clean.append(lfile)
                             else:
                                 added.append(lfile)
@@ -241,12 +242,6 @@
                 if wlock:
                     wlock.release()
 
-            if not listunknown:
-                result[4] = []
-            if not listignored:
-                result[5] = []
-            if not listclean:
-                result[6] = []
             self.lfstatus = True
             return result