Rev 5973: (mbp) remove bzrlib.tree.file_status (Martin Pool) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Jun 15 08:16:04 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5973 [merge]
revision-id: pqm at pqm.ubuntu.com-20110615081602-44eucf9miecsn8wt
parent: pqm at pqm.ubuntu.com-20110614104720-gpqe299xphd8069e
parent: mbp at canonical.com-20110615072919-fi6yrobn5domw41s
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2011-06-15 08:16:02 +0000
message:
  (mbp) remove bzrlib.tree.file_status (Martin Pool)
modified:
  bzrlib/tree.py                 tree.py-20050309040759-9d5f2496be663e77
  doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/tree.py'
--- a/bzrlib/tree.py	2011-05-20 15:15:53 +0000
+++ b/bzrlib/tree.py	2011-06-14 02:23:26 +0000
@@ -800,59 +800,6 @@
         return self.get_file(self._inventory.path2id(path), path)
 
 
-######################################################################
-# diff
-
-# TODO: Merge these two functions into a single one that can operate
-# on either a whole tree or a set of files.
-
-# TODO: Return the diff in order by filename, not by category or in
-# random order.  Can probably be done by lock-stepping through the
-# filenames from both trees.
-
-
-def file_status(filename, old_tree, new_tree):
-    """Return single-letter status, old and new names for a file.
-
-    The complexity here is in deciding how to represent renames;
-    many complex cases are possible.
-    """
-    old_inv = old_tree.inventory
-    new_inv = new_tree.inventory
-    new_id = new_inv.path2id(filename)
-    old_id = old_inv.path2id(filename)
-
-    if not new_id and not old_id:
-        # easy: doesn't exist in either; not versioned at all
-        if new_tree.is_ignored(filename):
-            return 'I', None, None
-        else:
-            return '?', None, None
-    elif new_id:
-        # There is now a file of this name, great.
-        pass
-    else:
-        # There is no longer a file of this name, but we can describe
-        # what happened to the file that used to have
-        # this name.  There are two possibilities: either it was
-        # deleted entirely, or renamed.
-        if new_inv.has_id(old_id):
-            return 'X', old_inv.id2path(old_id), new_inv.id2path(old_id)
-        else:
-            return 'D', old_inv.id2path(old_id), None
-
-    # if the file_id is new in this revision, it is added
-    if new_id and not old_inv.has_id(new_id):
-        return 'A'
-
-    # if there used to be a file of this name, but that ID has now
-    # disappeared, it is deleted
-    if old_id and not new_inv.has_id(old_id):
-        return 'D'
-
-    return 'wtf?'
-
-
 def find_ids_across_trees(filenames, trees, require_versioned=True):
     """Find the ids corresponding to specified filenames.
 

=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt	2011-06-14 10:47:20 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt	2011-06-15 07:29:19 +0000
@@ -108,8 +108,12 @@
    bzrlib.
 
 * Information about held lockdir locks returned from eg `LockDir.peek` is
-  now represented as a `LockHeldInfo` object, rather than a plain Python
-  dict.
+  now represented as a `LockHeldInfo` object, rather than a plain
+  Python dict.
+  (Martin Pool)
+
+* Remove `file_status` function.
+  (Martin Pool)
 
 Internals
 *********




More information about the bazaar-commits mailing list