Rev 2278: When parsing the contents, ghosts are not records, so should not be included in the line parsing. in http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate

John Arbash Meinel john at arbash-meinel.com
Tue Feb 13 21:06:55 GMT 2007


At http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate

------------------------------------------------------------
revno: 2278
revision-id: john at arbash-meinel.com-20070213210556-zw42d3te8rv50hct
parent: robertc at robertcollins.net-20070213111943-atz18s4v89dn3hkk
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate
timestamp: Tue 2007-02-13 15:05:56 -0600
message:
  When parsing the contents, ghosts are not records, so should not be included in the line parsing.
modified:
  bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
-------------- next part --------------
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py	2007-02-13 04:21:34 +0000
+++ b/bzrlib/dirstate.py	2007-02-13 21:05:56 +0000
@@ -116,7 +116,10 @@
 import struct
 import zlib
 
-from bzrlib import errors
+from bzrlib import (
+    errors,
+    trace,
+    )
 import bzrlib.inventory
 from bzrlib.osutils import pathjoin, sha_file, sha_string, walkdirs
 
@@ -469,8 +472,8 @@
             # Each line now has an extra '\n' field which is not used
             # so we just skip over it
             # number of fields per dir_entry + number of fields per parent_entry + newline
-            num_parents = len(self._parents)
-            entry_size = 7 + (7 * (num_parents - len(self._ghosts))) + 1
+            num_parents = len(self._parents) - len(self._ghosts)
+            entry_size = 7 + (7 * (num_parents)) + 1
             expected_field_count = entry_size * self._num_entries
             # is the file too short ?
             assert field_count - cur == expected_field_count, \



More information about the bazaar-commits mailing list