changeset 18145:93206823bd61

largefiles: remove overly complex handling of ignored and unknown files
author Mads Kiilerich <madski@unity3d.com>
date Thu, 13 Dec 2012 19:19:06 +0100
parents e16982a74bf7
children 819c7e10d60d
files hgext/largefiles/reposetup.py
diffstat 1 files changed, 9 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/reposetup.py	Fri Dec 28 11:55:57 2012 +0100
+++ b/hgext/largefiles/reposetup.py	Thu Dec 13 19:19:06 2012 +0100
@@ -188,17 +188,11 @@
                         match._files = [f for f in match._files
                                         if sfindirstate(f)]
                         # Don't waste time getting the ignored and unknown
-                        # files again; we already have them
+                        # files from lfdirstate
                         s = lfdirstate.status(match, [], False,
                                 listclean, False)
-                        (unsure, modified, added, removed, missing, unknown,
-                                ignored, clean) = s
-                        # Replace the list of ignored and unknown files with
-                        # the previously calculated lists, and strip out the
-                        # largefiles
-                        lfiles = set(lfdirstate._map)
-                        ignored = set(result[5]).difference(lfiles)
-                        unknown = set(result[4]).difference(lfiles)
+                        (unsure, modified, added, removed, missing, _unknown,
+                                _ignored, clean) = s
                         if parentworking:
                             for lfile in unsure:
                                 standin = lfutil.standin(lfile)
@@ -229,6 +223,7 @@
                         # Replace the original ignore function
                         lfdirstate._ignore = origignore
 
+                    # Standins no longer found in lfdirstate has been removed
                     for standin in ctx1.manifest():
                         if not lfutil.isstandin(standin):
                             continue
@@ -243,20 +238,17 @@
 
                     # Largefiles are not really removed when they're
                     # still in the normal dirstate. Likewise, normal
-                    # files are not really removed if it's still in
+                    # files are not really removed if they are still in
                     # lfdirstate. This happens in merges where files
                     # change type.
                     removed = [f for f in removed if f not in self.dirstate]
                     result[2] = [f for f in result[2] if f not in lfdirstate]
 
+                    lfiles = set(lfdirstate._map)
                     # Unknown files
-                    unknown = set(unknown).difference(ignored)
-                    result[4] = [f for f in unknown
-                                 if (self.dirstate[f] == '?' and
-                                     not lfutil.isstandin(f))]
-                    # Ignored files were calculated earlier by the dirstate,
-                    # and we already stripped out the largefiles from the list
-                    result[5] = ignored
+                    result[4] = set(result[4]).difference(lfiles)
+                    # Ignored files
+                    result[5] = set(result[5]).difference(lfiles)
                     # combine normal files and largefiles
                     normals = [[fn for fn in filelist
                                 if not lfutil.isstandin(fn)]