Rev 2470: Hook directory-tree-reference detection into dirstate _iter_changes. in http://bazaar.launchpad.net/~bzr/bzr/dirstate

Robert Collins robertc at robertcollins.net
Tue Mar 6 09:18:05 GMT 2007


At http://bazaar.launchpad.net/~bzr/bzr/dirstate

------------------------------------------------------------
revno: 2470
revision-id: robertc at robertcollins.net-20070306091708-p46394jg9hg5jzjq
parent: robertc at robertcollins.net-20070306084140-10rlo4bozpfvuebh
committer: Robert Collins <robertc at robertcollins.net>
branch nick: dirstate.dogfood
timestamp: Tue 2007-03-06 20:17:08 +1100
message:
  Hook directory-tree-reference detection into dirstate _iter_changes.
modified:
  bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2007-03-06 08:41:40 +0000
+++ b/bzrlib/workingtree_4.py	2007-03-06 09:17:08 +0000
@@ -263,7 +263,7 @@
     def _directory_is_tree_reference(self, relpath):
         # as a special case, if a directory contains control files then 
         # it's a tree reference, except that the root of the tree is not
-        return relpath and osutils.isdir(self.abspath(relpath) + "/.bzr")
+        return relpath and osutils.isdir(self.abspath(relpath) + u"/.bzr")
         # TODO: We could ask all the control formats whether they
         # recognize this directory, but at the moment there's no cheap api
         # to do that.  Since we probably can only nest bzr checkouts and
@@ -1935,7 +1935,8 @@
                     osutils.file_kind_from_stat_mode(root_stat.st_mode), root_stat,
                     root_abspath)
                 if root_dir_info[2] == 'directory':
-                    if self.target._directory_is_tree_reference(current_root):
+                    if self.target._directory_is_tree_reference(
+                        current_root.decode('utf8')):
                         root_dir_info = root_dir_info[:2] + \
                             ('tree-reference',) + root_dir_info[3:]
 
@@ -2064,7 +2065,7 @@
                     current_path_info = current_dir_info[1][path_index]
                     if current_path_info[2] == 'directory':
                         if self.target._directory_is_tree_reference(
-                            current_path_info[0]):
+                            current_path_info[0].decode('utf8')):
                             current_path_info = current_path_info[:2] + \
                                 ('tree-reference',) + current_path_info[3:]
                 else:
@@ -2175,7 +2176,7 @@
                             current_path_info = current_dir_info[1][path_index]
                             if current_path_info[2] == 'directory':
                                 if self.target._directory_is_tree_reference(
-                                    current_path_info[0]):
+                                    current_path_info[0].decode('utf8')):
                                     current_path_info = current_path_info[:2] + \
                                         ('tree-reference',) + current_path_info[3:]
                         else:



More information about the bazaar-commits mailing list