hgext/largefiles/reposetup.py
changeset 15674 7b7f03502b5a
parent 15653 93c77d5b9752
parent 15663 9036c7d106bf
child 15783 927712d9853b
--- a/hgext/largefiles/reposetup.py	Thu Dec 15 16:50:21 2011 -0600
+++ b/hgext/largefiles/reposetup.py	Fri Dec 16 19:05:59 2011 -0600
@@ -215,9 +215,18 @@
                             continue
                         if lfile not in lfdirstate:
                             removed.append(lfile)
-                    # Handle unknown and ignored differently
-                    lfiles = (modified, added, removed, missing, [], [], clean)
+
+                    # Filter result lists
                     result = list(result)
+
+                    # 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
+                    # lfdirstate. This happens in merges where files
+                    # change type.
+                    removed = [f for f in removed if f not in repo.dirstate]
+                    result[2] = [f for f in result[2] if f not in lfdirstate]
+
                     # Unknown files
                     unknown = set(unknown).difference(ignored)
                     result[4] = [f for f in unknown
@@ -230,6 +239,7 @@
                     normals = [[fn for fn in filelist
                                 if not lfutil.isstandin(fn)]
                                for filelist in result]
+                    lfiles = (modified, added, removed, missing, [], [], clean)
                     result = [sorted(list1 + list2)
                               for (list1, list2) in zip(normals, lfiles)]
                 else: