Rev 2784: (Wouter van Heyst) Dirstate blowing up on None as a minikind fingerprint in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Sep 3 09:06:58 BST 2007


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

------------------------------------------------------------
revno: 2784
revision-id: pqm at pqm.ubuntu.com-20070903080656-1sn8ea2d3ohx75ek
parent: pqm at pqm.ubuntu.com-20070903073425-ouk9qod51gqk18nn
parent: bialix at ukr.net-20070903055401-93l26whhfjjnjo04
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2007-09-03 09:06:56 +0100
message:
  (Wouter van Heyst) Dirstate blowing up on None as a minikind fingerprint
modified:
  bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
  bzrlib/tests/test_dirstate.py  test_dirstate.py-20060728012006-d6mvoihjb3je9peu-2
    ------------------------------------------------------------
    revno: 2778.2.1
    merged: bialix at ukr.net-20070903055401-93l26whhfjjnjo04
    parent: pqm at pqm.ubuntu.com-20070903031921-8msn0bmzubicv5b1
    parent: larstiq at larstiq.dyndns.org-20070721182719-7e2wfkplplkw6y7x
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: none.minikind.wouter
    timestamp: Mon 2007-09-03 08:54:01 +0300
    message:
      merged with bzr.dev
    ------------------------------------------------------------
    revno: 2645.2.1
    merged: larstiq at larstiq.dyndns.org-20070721182719-7e2wfkplplkw6y7x
    parent: pqm at pqm.ubuntu.com-20070721163603-p17kh2wgzkhbef1d
    committer: Wouter van Heyst <larstiq at larstiq.dyndns.org>
    branch nick: dirstate-serialization
    timestamp: Sat 2007-07-21 20:27:19 +0200
    message:
      The DirState fingerprint for tree-references should be an empty string instead of None
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py	2007-07-20 18:26:20 +0000
+++ b/bzrlib/dirstate.py	2007-07-21 18:27:19 +0000
@@ -1887,7 +1887,7 @@
                 current_new_minikind = \
                     DirState._kind_to_minikind[current_new[1].kind]
                 if current_new_minikind == 't':
-                    fingerprint = current_new[1].reference_revision
+                    fingerprint = current_new[1].reference_revision or ''
                 else:
                     fingerprint = ''
             else:

=== modified file 'bzrlib/tests/test_dirstate.py'
--- a/bzrlib/tests/test_dirstate.py	2007-07-11 23:45:20 +0000
+++ b/bzrlib/tests/test_dirstate.py	2007-07-21 18:27:19 +0000
@@ -2120,3 +2120,22 @@
         self.assertContainsRe(str(e),
             'file a-id is absent in row')
 
+
+class TestDirstateTreeReference(TestCaseWithDirState):
+
+    def test_reference_revision_is_none(self):
+        tree = self.make_branch_and_tree('tree', format='dirstate-with-subtree')
+        subtree = self.make_branch_and_tree('tree/subtree',
+                            format='dirstate-with-subtree')
+        subtree.set_root_id('subtree')
+        tree.add_reference(subtree)
+        tree.add('subtree')
+        state = dirstate.DirState.from_tree(tree, 'dirstate')
+        key = ('', 'subtree', 'subtree')
+        expected = ('', [(key,
+            [('t', '', 0, False, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')])])
+
+        try:
+            self.assertEqual(expected, state._find_block(key))
+        finally:
+            state.unlock()




More information about the bazaar-commits mailing list