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

login
register
mail settings
Submitter Martin von Zweigbergk
Date Sept. 24, 2014, 4:32 p.m.
Message ID <35fa8edd570c68243cd1.1411576332@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/5961/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Sept. 24, 2014, 4:32 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@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.

Patch

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