Rev 2427: Recognize 't' (tree-reference) minikind in DirState._get_entry in http://sourcefrog.net/bzr/dirstate-plus-subtree

Martin Pool mbp at sourcefrog.net
Fri Mar 2 09:15:31 GMT 2007


At http://sourcefrog.net/bzr/dirstate-plus-subtree

------------------------------------------------------------
revno: 2427
revision-id: mbp at sourcefrog.net-20070302091457-r8xcdqoyesxfuijs
parent: mbp at sourcefrog.net-20070302085638-pr8pa43gffwig209
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: dirstate-plus-subtree
timestamp: Fri 2007-03-02 20:14:57 +1100
message:
  Recognize 't' (tree-reference) minikind in DirState._get_entry
modified:
  bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py	2007-03-02 08:55:16 +0000
+++ b/bzrlib/dirstate.py	2007-03-02 09:14:57 +0000
@@ -20,7 +20,7 @@
 lines by NL. The field delimiters are ommitted in the grammar, line delimiters
 are not - this is done for clarity of reading. All string data is in utf8.
 
-MINIKIND = "f" | "d" | "l" | "a" | "r";
+MINIKIND = "f" | "d" | "l" | "a" | "r" | "t";
 NL = "\n";
 NULL = "\0";
 WHOLE_NUMBER = {digit}, digit;
@@ -1353,14 +1353,18 @@
                 entry_index, present = self._find_entry_index(key, block)
                 if present:
                     entry = self._dirblocks[block_index][1][entry_index]
-                    if entry[1][tree_index][0] in 'fdl':
+                    if entry[1][tree_index][0] in 'fdlt':
                         # this is the result we are looking for: the  
                         # real home of this file_id in this tree.
                         return entry
                     if entry[1][tree_index][0] == 'a':
                         # there is no home for this entry in this tree
                         return None, None
-                    assert entry[1][tree_index][0] == 'r'
+                    assert entry[1][tree_index][0] == 'r', \
+                        "entry %r has invalid minikind %r for tree %r" \
+                        % (entry,
+                           entry[1][tree_index][0],
+                           tree_index)
                     real_path = entry[1][tree_index][1]
                     return self._get_entry(tree_index, fileid_utf8=fileid_utf8,
                         path_utf8=real_path)




More information about the bazaar-commits mailing list