[MERGE][bug 105479] Move children of a directory correctly

Martin Pool mbp at canonical.com
Sat Apr 21 05:21:15 BST 2007


Martin Pool has voted +1.
Status is now: Approved
Comment:
incidentally, _validate is getting a bit long and this new inner 
function might be better off as a top level method.

+            if parent_entry == (None, None):
+                raise AssertionError(
+                    "no parent entry for: %s in tree %s"
+                    % (this_path, tree_index))+            else:
+                if parent_entry[1][tree_index][0] != 'd':
+                    raise AssertionError(
+                        "Parent entry for %s is not marked as a valid"
+                        " directory. %s" % (this_path, parent_entry,))
+

Stylistically could remove the else as the raise will stop us getting 
here.

This looks like a good additional test to have.

+        self.build_tree(['c/', 'c/b/', 'c/b/d/'])
+        tree.add(['c', 'c/b', 'c/b/d'],
+                 ['c-id', 'b-id', 'd-id'])

Incidentally we should factor out build_and_add_tree perhaps.

It looks like a correct change, and the additional validation and tests 
are welcome so +1.

Regarding 0.15.1 - it is a pretty important fix, but as we'll do 0.16rc1 
on Monday maybe we should just ask people to upgrade to that instead.

For details, see: 
http://bundlebuggy.aaronbentley.com/request/%3C4629259D.2090402%40arbash-meinel.com%3E



More information about the bazaar mailing list