changeset 1617:ece5d785e87a

Make localrepo.changes() internally distinguish between removed and deleted.
author Thomas Arendsen Hein <thomas@intevation.de>
date Thu, 12 Jan 2006 12:22:28 +0100
parents f0f9e84849e7
children ff339dd21976
files mercurial/dirstate.py mercurial/localrepo.py
diffstat 2 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Thu Jan 12 11:32:07 2006 +0100
+++ b/mercurial/dirstate.py	Thu Jan 12 12:22:28 2006 +0100
@@ -417,4 +417,4 @@
             elif type == 'r':
                 removed.append(fn)
 
-        return (lookup, modified, added, removed + deleted, unknown)
+        return (lookup, modified, added, removed, deleted, unknown)
--- a/mercurial/localrepo.py	Thu Jan 12 11:32:07 2006 +0100
+++ b/mercurial/localrepo.py	Thu Jan 12 12:22:28 2006 +0100
@@ -501,7 +501,7 @@
                 wlock = self.wlock(wait=0)
             except lock.LockHeld:
                 wlock = None
-            lookup, modified, added, deleted, unknown = (
+            lookup, modified, added, removed, deleted, unknown = (
                 self.dirstate.changes(files, match))
 
             # are we comparing working dir against its parent?
@@ -520,12 +520,12 @@
                 mf2 = mfmatches(self.dirstate.parents()[0])
                 for f in lookup + modified + added:
                     mf2[f] = ""
-                for f in deleted:
+                for f in removed:
                     if f in mf2:
                         del mf2[f]
         else:
             # we are comparing two revisions
-            unknown = []
+            deleted, unknown = [], []
             mf2 = mfmatches(node2)
 
         if node1:
@@ -542,12 +542,14 @@
                 else:
                     added.append(fn)
 
-            deleted = mf1.keys()
+            removed = mf1.keys()
+
+        removed.extend(deleted) #XXX get rid of this when returning deleted
 
         # sort and return results:
-        for l in modified, added, deleted, unknown:
+        for l in modified, added, removed, unknown:
             l.sort()
-        return (modified, added, deleted, unknown)
+        return (modified, added, removed, unknown)
 
     def add(self, list):
         wlock = self.wlock()