Rev 2902: trivial cleanups for #146176 in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Oct 10 02:48:55 BST 2007


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

------------------------------------------------------------
revno: 2902
revision-id: pqm at pqm.ubuntu.com-20071010014853-syu149i5axrvovt1
parent: pqm at pqm.ubuntu.com-20071010010501-ejbj03m5w3k9vdsd
parent: mbp at sourcefrog.net-20071010000704-f6o18zzj6twx94vs
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-10-10 02:48:53 +0100
message:
  trivial cleanups for #146176
modified:
  bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
  bzrlib/tests/test_dirstate.py  test_dirstate.py-20060728012006-d6mvoihjb3je9peu-2
    ------------------------------------------------------------
    revno: 2872.1.1.1.2.1.13
    merged: mbp at sourcefrog.net-20071010000704-f6o18zzj6twx94vs
    parent: mbp at sourcefrog.net-20071010000446-emroh5r1h0m83ba1
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: 146176-dirstate
    timestamp: Wed 2007-10-10 10:07:04 +1000
    message:
      Validate dirstate during tests
    ------------------------------------------------------------
    revno: 2872.1.1.1.2.1.12
    merged: mbp at sourcefrog.net-20071010000446-emroh5r1h0m83ba1
    parent: mbp at sourcefrog.net-20071009040940-yjwm33zkzp033j8q
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: 146176-dirstate
    timestamp: Wed 2007-10-10 10:04:46 +1000
    message:
      Remove dead comment
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py	2007-10-09 04:09:40 +0000
+++ b/bzrlib/dirstate.py	2007-10-10 00:04:46 +0000
@@ -1846,7 +1846,6 @@
         try to keep everything in sorted blocks all the time, but sometimes
         it's easier to sort after the fact.
         """
-        # TODO: Might be faster to do a schwartzian transform?
         def _key(entry):
             # sort by: directory parts, file name, file id
             return entry[0][0].split('/'), entry[0][1], entry[0][2]

=== modified file 'bzrlib/tests/test_dirstate.py'
--- a/bzrlib/tests/test_dirstate.py	2007-10-09 04:09:40 +0000
+++ b/bzrlib/tests/test_dirstate.py	2007-10-10 00:07:04 +0000
@@ -742,8 +742,10 @@
             self.assertTrue(inv.has_id('foo-id'))
             self.assertTrue(inv.has_filename('foo'))
             inv.add_path('bar', 'file', 'bar-id')
+            tree._dirstate._validate()
             # this used to cause it to lose its hashcache
             tree._dirstate.set_state_from_inventory(inv)
+            tree._dirstate._validate()
         finally:
             tree.unlock()
 
@@ -751,6 +753,7 @@
         try:
             # now check that the state still has the original hashcache value
             state = tree._dirstate
+            state._validate()
             foo_tuple = state._get_entry(0, path_utf8='foo')
             self.assertEqual(
                 (('', 'foo', 'foo-id',),




More information about the bazaar-commits mailing list