[PATCH 6 of 8 V3] largefiles: remove unnecessary clearing of status fields

Martin von Zweigbergk martinvonz at gmail.com
Wed Sep 24 11:32:12 CDT 2014


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at gmail.com>
# Date 1411416336 25200
#      Mon Sep 22 13:05:36 2014 -0700
# Node ID 35fa8edd570c68243cd1839a76ed90578dc231fd
# Parent  a6e0710be72f0df3e84ef410b9f34d86a9990bd4
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.

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -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
 


More information about the Mercurial-devel mailing list