[MERGE] Enable merging into PreviewTree

Martin Pool mbp at canonical.com
Mon Sep 29 05:10:21 BST 2008


Martin Pool has voted tweak.
Status is now: Conditionally approved
Comment:
--- bzrlib/merge.py     2008-09-05 05:12:35 +0000
+++ bzrlib/merge.py     2008-09-08 20:44:53 +0000
@@ -169,7 +169,8 @@

      @staticmethod
      def from_revision_ids(pb, tree, other, base=None, 
other_branch=None,
-                          base_branch=None, revision_graph=None):
+                          base_branch=None, revision_graph=None,
+                          tree_branch=None):
          """Return a Merger for revision-ids.

Could you please document tree_branch?

-            return trans_id
+            try:
+                self._tree.iter_entries_by_dir([file_id]).next()
+            except StopIteration:
+                if file_id in self._non_present_ids:

Does this 'except' branch mean the directory exists and is empty?
I'm not sure why this is happening.

+            from_entry = 
self._tree.iter_entries_by_dir([file_id]).next()[1]

That's kind of a long expression to have occur twice in your patch and 
it
smells a bit like those cases where we've intentionally provided only an
iterator method but in fact need to query for just a single item...



For details, see: 
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C48DB2A90.8080906%40aaronbentley.com%3E
Project: Bazaar



More information about the bazaar mailing list