Rev 3617: (Jelmer) Fix copying of root revision in inventory. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sat Aug 9 22:51:06 BST 2008


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

------------------------------------------------------------
revno: 3617
revision-id: pqm at pqm.ubuntu.com-20080809215057-4tnxs63ngab9gm8a
parent: pqm at pqm.ubuntu.com-20080808061719-ixk3x48n198814tg
parent: jelmer at samba.org-20080809004530-v2g6mrvl4bc1tae1
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2008-08-09 22:50:57 +0100
message:
  (Jelmer) Fix copying of root revision in inventory.
modified:
  bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
  bzrlib/tests/inventory_implementations/basics.py basics.py-20070903044446-kdjwbiu1p1zi9phs-1
    ------------------------------------------------------------
    revno: 3616.1.1
    revision-id: jelmer at samba.org-20080809004530-v2g6mrvl4bc1tae1
    parent: pqm at pqm.ubuntu.com-20080808061719-ixk3x48n198814tg
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: bzr.dev
    timestamp: Sat 2008-08-09 02:45:30 +0200
    message:
      Fix copying of root revision in inventory.
    modified:
      bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
      bzrlib/tests/inventory_implementations/basics.py basics.py-20070903044446-kdjwbiu1p1zi9phs-1
=== modified file 'bzrlib/inventory.py'
--- a/bzrlib/inventory.py	2008-07-30 21:30:59 +0000
+++ b/bzrlib/inventory.py	2008-08-09 00:45:30 +0000
@@ -850,6 +850,7 @@
         if self.root is None:
             return Inventory(root_id=None)
         other = Inventory(entries.next()[1].file_id)
+        other.root.revision = self.root.revision
         # copy recursively so we know directories will be added before
         # their children.  There are more efficient ways than this...
         for path, entry in entries:

=== modified file 'bzrlib/tests/inventory_implementations/basics.py'
--- a/bzrlib/tests/inventory_implementations/basics.py	2007-10-24 20:38:50 +0000
+++ b/bzrlib/tests/inventory_implementations/basics.py	2008-08-09 00:45:30 +0000
@@ -81,6 +81,14 @@
         inv2 = inv.copy()
         self.assertIs(None, inv2.root)
 
+    def test_copy_copies_root_revision(self):
+        """Make sure the revision of the root gets copied."""
+        inv = self.make_inventory(root_id='someroot')
+        inv.root.revision = 'therev'
+        inv2 = inv.copy()
+        self.assertEquals('someroot', inv2.root.file_id)
+        self.assertEquals('therev', inv2.root.revision)
+
     def test_is_root(self):
         """Ensure our root-checking code is accurate."""
         inv = self.make_inventory('TREE_ROOT')




More information about the bazaar-commits mailing list