Rev 3785: Support is_root on CHKInventory objects. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Fri Nov 14 06:59:34 GMT 2008


At http://people.ubuntu.com/~robertc/baz2.0/repository

------------------------------------------------------------
revno: 3785
revision-id: robertc at robertcollins.net-20081114065931-4yom7qwgxfg7mrby
parent: robertc at robertcollins.net-20081114051533-8paslkqeb0vzxyld
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Fri 2008-11-14 17:59:31 +1100
message:
  Support is_root on CHKInventory objects.
modified:
  bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
=== modified file 'bzrlib/inventory.py'
--- a/bzrlib/inventory.py	2008-11-14 05:15:33 +0000
+++ b/bzrlib/inventory.py	2008-11-14 06:59:31 +0000
@@ -1545,6 +1545,9 @@
         # Perhaps have an explicit 'contains' method on CHKMap ?
         return len(list(self.id_to_entry.iteritems([(file_id,)]))) == 1
 
+    def is_root(self, file_id):
+        return file_id == self.root_id
+
     def _iter_file_id_parents(self, file_id):
         """Yield the parents of file_id up to the root."""
         while file_id is not None:




More information about the bazaar-commits mailing list