Rev 2349: DirState: handle id lookup redirects correctly. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/dirstate/

Robert Collins robertc at robertcollins.net
Wed Feb 21 01:38:42 GMT 2007


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

------------------------------------------------------------
revno: 2349
revision-id: robertc at robertcollins.net-20070221013745-7d0ho05wt5btnfyl
parent: robertc at robertcollins.net-20070221010813-zn13zy3wzd53i3vz
committer: Robert Collins <robertc at robertcollins.net>
branch nick: dirstate
timestamp: Wed 2007-02-21 12:37:45 +1100
message:
  DirState: handle id lookup redirects correctly.
modified:
  bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py	2007-02-21 01:08:13 +0000
+++ b/bzrlib/dirstate.py	2007-02-21 01:37:45 +0000
@@ -667,10 +667,9 @@
         :param path_utf8: An utf8 path to be looked up.
         :return: The dirstate entry tuple for path, or (None, None)
         """
+        self._read_dirblocks_if_needed()
         if path_utf8 is not None:
             assert path_utf8.__class__ == str, 'path_utf8 is not a str: %s %s' % (type(path_utf8), path_utf8)
-        self._read_dirblocks_if_needed()
-        if path_utf8 is not None:
             # path lookups are faster
             if path_utf8 == '':
                 for entry in self._root_entries:
@@ -695,7 +694,7 @@
                         # look up the real location directly by path
                         return self._get_entry(tree_index,
                             fileid_utf8=fileid_utf8,
-                            path_utf8=entry[1][tree_index][0])
+                            path_utf8=entry[1][tree_index][1])
                     if entry[1][tree_index][0] == 'absent':
                         # not in the tree at all.
                         return None, None



More information about the bazaar-commits mailing list