Rev 2562: Add a test for check_inventory_shape and fix tests (James Westby) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Jun 28 20:44:12 BST 2007


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

------------------------------------------------------------
revno: 2562
revision-id: pqm at pqm.ubuntu.com-20070628194410-pikmj08nsn9sci9h
parent: pqm at pqm.ubuntu.com-20070628082903-b21gad45bimzvmgu
parent: abentley at panoramicfeedback.com-20070628185324-khiv4n3hrkh60xq5
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-06-28 20:44:10 +0100
message:
  Add a test for check_inventory_shape and fix tests (James Westby)
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/test_commit.py    test_commit.py-20050914060732-279f057f8c295434
  bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
  bzrlib/tests/workingtree_implementations/test_workingtree.py test_workingtree.py-20060203003124-817757d3e31444fb
    ------------------------------------------------------------
    revno: 2561.1.2
    merged: abentley at panoramicfeedback.com-20070628185324-khiv4n3hrkh60xq5
    parent: abentley at panoramicfeedback.com-20070628185213-6kbbwchwb4zb19ux
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: Aaron's integration
    timestamp: Thu 2007-06-28 14:53:24 -0400
    message:
      Fix indenting in TestCheckInventoryShape
    ------------------------------------------------------------
    revno: 2561.1.1
    merged: abentley at panoramicfeedback.com-20070628185213-6kbbwchwb4zb19ux
    parent: pqm at pqm.ubuntu.com-20070628082903-b21gad45bimzvmgu
    parent: jw+debian at jameswestby.net-20070625200506-lq602is8c6ofwt6b
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: Aaron's integration
    timestamp: Thu 2007-06-28 14:52:13 -0400
    message:
      Merge check_shape fixes
    ------------------------------------------------------------
    revno: 2545.3.2
    merged: jw+debian at jameswestby.net-20070625200506-lq602is8c6ofwt6b
    parent: jw+debian at jameswestby.net-20070624211307-tchngkjgvexjrchz
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: bzr.dev
    timestamp: Mon 2007-06-25 21:05:06 +0100
    message:
      Add a test for check_inventory_shape.
      
      Also fix up the tests that relied on the buggy behaviour.
    ------------------------------------------------------------
    revno: 2545.3.1
    merged: jw+debian at jameswestby.net-20070624211307-tchngkjgvexjrchz
    parent: pqm at pqm.ubuntu.com-20070622160825-17gv0lorkzbr3x76
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: bzr.dev
    timestamp: Sun 2007-06-24 22:13:07 +0100
    message:
      Fix detection of directory entries in the inventory.
      
      check_inventory_shape allows you to check that an inventory entry is a
      directory by ending it in a '/'. However the code to add the '/' to the
      entries for comparison uses the kind == 'dir' to detect directories, when
      the key is 'directory'.
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2007-06-28 08:00:25 +0000
+++ b/bzrlib/tests/__init__.py	2007-06-28 18:52:13 +0000
@@ -1543,7 +1543,7 @@
         shape = list(shape)             # copy
         for path, ie in inv.entries():
             name = path.replace('\\', '/')
-            if ie.kind == 'dir':
+            if ie.kind == 'directory':
                 name = name + '/'
             if name in shape:
                 shape.remove(name)

=== modified file 'bzrlib/tests/test_commit.py'
--- a/bzrlib/tests/test_commit.py	2007-05-21 14:14:36 +0000
+++ b/bzrlib/tests/test_commit.py	2007-06-25 20:05:06 +0000
@@ -226,7 +226,7 @@
         wt.lock_read()
         try:
             self.check_inventory_shape(wt.read_working_inventory(),
-                                       ['a', 'a/hello', 'b'])
+                                       ['a/', 'a/hello', 'b/'])
         finally:
             wt.unlock()
 
@@ -236,9 +236,9 @@
         wt.lock_read()
         try:
             self.check_inventory_shape(wt.read_working_inventory(),
-                                       ['a', 'a/hello', 'a/b'])
+                                       ['a/', 'a/hello', 'a/b/'])
             self.check_inventory_shape(b.repository.get_revision_inventory(r3),
-                                       ['a', 'a/hello', 'a/b'])
+                                       ['a/', 'a/hello', 'a/b/'])
         finally:
             wt.unlock()
 
@@ -248,7 +248,7 @@
         wt.lock_read()
         try:
             self.check_inventory_shape(wt.read_working_inventory(),
-                                       ['a', 'a/b/hello', 'a/b'])
+                                       ['a/', 'a/b/hello', 'a/b/'])
         finally:
             wt.unlock()
 

=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py	2007-06-28 07:48:23 +0000
+++ b/bzrlib/tests/test_selftest.py	2007-06-28 18:53:24 +0000
@@ -1538,3 +1538,16 @@
             'TestSelftestFiltering.test_filter_suite_by_re')
         self.assertEquals(sorted(self.all_names), sorted(sorted_names))
 
+
+class TestCheckInventoryShape(TestCaseWithTransport):
+
+    def test_check_inventory_shape(self):
+        files = ['a', 'b/', 'b/c']
+        tree = self.make_branch_and_tree('.')
+        self.build_tree(files)
+        tree.add(files)
+        tree.lock_read()
+        try:
+            self.check_inventory_shape(tree.inventory, files)
+        finally:
+            tree.unlock()

=== modified file 'bzrlib/tests/workingtree_implementations/test_workingtree.py'
--- a/bzrlib/tests/workingtree_implementations/test_workingtree.py	2007-06-01 13:42:02 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_workingtree.py	2007-06-25 20:05:06 +0000
@@ -232,17 +232,17 @@
         self.log('contents of inventory: %r' % inv.entries())
 
         self.check_inventory_shape(inv,
-                                   ['dir', 'dir/sub', 'dir/sub/file'])
+                                   ['dir/', 'dir/sub/', 'dir/sub/file'])
         wt.rename_one('dir', 'newdir')
 
         wt.lock_read()
         self.check_inventory_shape(wt.inventory,
-                                   ['newdir', 'newdir/sub', 'newdir/sub/file'])
+                                   ['newdir/', 'newdir/sub/', 'newdir/sub/file'])
         wt.unlock()
         wt.rename_one('newdir/sub', 'newdir/newsub')
         wt.lock_read()
         self.check_inventory_shape(wt.inventory,
-                                   ['newdir', 'newdir/newsub',
+                                   ['newdir/', 'newdir/newsub/',
                                     'newdir/newsub/file'])
         wt.unlock()
 




More information about the bazaar-commits mailing list