[MERGE] Minor tree and dirstate code cleanups

Robert Collins robertc at robertcollins.net
Fri Sep 14 02:40:38 BST 2007


bb:resubmit
On Fri, 2007-09-14 at 11:23 +1000, Ian Clatworthy wrote:
> I'm currently pouring over the dirstate and tree code getting my head
> around what's done where and why. Here's the first batch of minor code
> cleanups I'd like to see.
> 
> Most of the changes are comment fixes. I didn't just merge this because
> some other minor changes are proposed as well. I don't think this is
> NEWS worthy though.
> 
> Ian C.


=== modified file 'bzrlib/dirstate.py'
--- bzrlib/dirstate.py  2007-07-21 18:27:19 +0000
+++ bzrlib/dirstate.py  2007-09-14 01:14:26 +0000
@@ -29,9 +29,9 @@
 
 dirstate format = header line, full checksum, row count, parent
details,
  ghost_details, entries;
-header line = "#bazaar dirstate flat format 2", NL;
+header line = "#bazaar dirstate flat format N", NL;

This is an incorrect change to make. Its not a substitution variable,
its is the specification for format 2.


This hunk:
@@ -545,7 +545,7 @@
     :param trees: The trees to find file_ids within
     :param require_versioned: if true, all specified filenames must
occur in
         at least one tree.
-    :return: a set of (path, file ids) for the specified filenames
+    :return: a set of file ids for the specified filenames
     """
     not_versioned = []
     interesting_ids = set()

looks suspicious

What is this:
@@ -275,7 +274,8 @@
     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) +
u"/.bzr")
+        return len(relpath) > 0 and \
+            osutils.isdir(self.abspath(relpath) + u"/.bzr")

change for?

-Rob





-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070914/f7a19bdc/attachment.pgp 


More information about the bazaar mailing list