[Pkg-bazaar-commits] ./bzr/unstable r463: - compare_trees() also reports unchanged files

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:19:30 UTC 2009


------------------------------------------------------------
revno: 463
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Wed 2005-05-11 15:02:35 +1000
message:
  - compare_trees() also reports unchanged files
modified:
  bzrlib/diff.py
  bzrlib/info.py
-------------- next part --------------
=== modified file 'bzrlib/diff.py'
--- a/bzrlib/diff.py	2005-05-11 04:57:13 +0000
+++ b/bzrlib/diff.py	2005-05-11 05:02:35 +0000
@@ -259,17 +259,22 @@
         (oldpath, newpath, id, text_modified)
     modified
         (path, id)
+    unchanged
+        (path, id)
 
     Each id is listed only once.
 
     Files that are both modified and renamed are listed only in
     renamed, with the text_modified flag true.
+
+    The lists are normally sorted when the delta is created.
     """
     def __init__(self):
         self.added = []
         self.removed = []
         self.renamed = []
         self.modified = []
+        self.unchanged = []
 
     def show(self, to_file, show_ids):
         if self.removed:
@@ -327,6 +332,8 @@
                 delta.renamed.append((old_path, new_path, file_id, text_modified))
             elif text_modified:
                 delta.modified.append((new_path, file_id))
+            else:
+                delta.unchanged.append((new_path, file_id))
         else:
             delta.removed.append((old_inv.id2path(file_id), file_id))
     for file_id in new_inv:

=== modified file 'bzrlib/info.py'
--- a/bzrlib/info.py	2005-05-11 04:57:13 +0000
+++ b/bzrlib/info.py	2005-05-11 05:02:35 +0000
@@ -53,7 +53,7 @@
     
     print
     print 'in the working tree:'
-    print '  %8s unchanged' % '?'
+    print '  %8s unchanged' % len(delta.unchanged)
     print '  %8d modified' % len(delta.modified)
     print '  %8d added' % len(delta.added)
     print '  %8d removed' % len(delta.removed)



More information about the Pkg-bazaar-commits mailing list