Rev 4359: (jam) Update a minor test to support CHK formats. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed May 13 22:40:12 BST 2009


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

------------------------------------------------------------
revno: 4359
revision-id: pqm at pqm.ubuntu.com-20090513214008-38hihmlcby54hc99
parent: pqm at pqm.ubuntu.com-20090513171628-zmtijps3xl06nr9j
parent: john at arbash-meinel.com-20090511153040-tqey43qr85xlfnqo
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-05-13 22:40:08 +0100
message:
  (jam) Update a minor test to support CHK formats.
modified:
  bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
    ------------------------------------------------------------
    revno: 4350.2.1
    revision-id: john at arbash-meinel.com-20090511153040-tqey43qr85xlfnqo
    parent: pqm at pqm.ubuntu.com-20090511073632-ti658145fo07a4vw
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: jam-integration
    timestamp: Mon 2009-05-11 10:30:40 -0500
    message:
      Update a test to support CHK formats.
    modified:
      bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
=== modified file 'bzrlib/tests/test_pack_repository.py'
--- a/bzrlib/tests/test_pack_repository.py	2009-04-20 08:37:32 +0000
+++ b/bzrlib/tests/test_pack_repository.py	2009-05-11 15:30:40 +0000
@@ -266,8 +266,6 @@
         # Test that the ordering of revisions in pack repositories is
         # tip->ancestor
         format = self.get_format()
-        if type(format.repository_format) is RepositoryFormatCHK1:
-            raise TestSkipped("Not updated for GroupCompress internals")
         tree = self.make_branch_and_tree('.', format=format)
         trans = tree.branch.repository.bzrdir.get_repository_transport(None)
         tree.commit('start', rev_id='1')
@@ -280,11 +278,18 @@
         # revision access tends to be tip->ancestor, so ordering that way on
         # disk is a good idea.
         for _1, key, val, refs in pack.revision_index.iter_all_entries():
+            if type(format.repository_format) is RepositoryFormatCHK1:
+                # group_start, group_len, internal_start, internal_len
+                pos = map(int, val.split())
+            else:
+                # eol_flag, start, len
+                pos = int(val[1:].split()[0])
             if key == ('1',):
-                pos_1 = int(val[1:].split()[0])
+                pos_1 = pos
             else:
-                pos_2 = int(val[1:].split()[0])
-        self.assertTrue(pos_2 < pos_1)
+                pos_2 = pos
+        self.assertTrue(pos_2 < pos_1, 'rev 1 came before rev 2 %s > %s'
+                                       % (pos_1, pos_2))
 
     def test_pack_repositories_support_multiple_write_locks(self):
         format = self.get_format()




More information about the bazaar-commits mailing list