[MERGE] Revert merge and pull display using TreeTransform._iter_changes
John Arbash Meinel
john at arbash-meinel.com
Wed Feb 14 19:39:24 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Aaron Bentley wrote:
> Hi all,
> This patch implements Transform._iter_changes, which translates a
> pending transform into _iter_changes format, for display purposes.
> It then changes "revert" to use TreeTransform._iter_changes, so that it
> reflects conflict resolution better. It adds the same output to "merge"
> and "pull".
> Since the output is provided using trace.note(), --quiet will silence it.
- - count = tree_to.pull(branch_from, overwrite, rev_id)
+ count = tree_to.pull(branch_from, overwrite, rev_id,
^- can you indent this, so it is clearer you are continuing the previous
count = branch_to.pull(branch_from, overwrite, rev_id)
note('%d revision(s) pulled.' % (count,))
@@ -2333,6 +2335,7 @@
merge_type = _mod_merge.Merge3Merger
tree = WorkingTree.open_containing(u'.')
+ change_reporter = delta.ChangeReporter(tree.inventory)
@@ -344,8 +344,8 @@
exe_change = False
# files are "renamed" if they are moved or if name changes, as long
# as it had a value
- - if None not in name and (name != name or
- - parent_id != parent_id):
+ if None not in name and None not in parent_id and\
+ (name != name or parent_id != parent_id):
renamed = True
renamed = False
^- "None not in parent_id" looks incorrect. It might be "None not in
parent_ids" or "parent_id is not None"
But at least from the variables it looks like you are trying to do a set
check over a single value. (But then again, it looks the same for name).
You might consider using plurals for variables that contain more than
one value. "None not in name" is a lot more confusing than "None not in
v- Incorrect import line. There are quite a few places I've seen you do
this. It really should be: "from bzrlib import delta". And really that
should be done up at the top of the module, possibly in a lazy_import
statement. (The other place I just noticed is an 'import annotate' in
+ if change_reporter is not None:
+ import delta
for conflict in self.cooked_conflicts:
v- This function seems a little long. Are there reasonable places that
you could break it up? There may not be. But I generally avoid super
+ def _iter_changes(self):
+ """Produce output in the same format as Tree._iter_changes.
+ Will produce nonsensical results if invoked while
+ conflicts (as reported by TreeTransform.find_conflicts()) are
+ This reads the Transform, but only reproduces changes involving a
+ file_id. Files that are not versioned in either of the FROM or TO
+ states are not reflected.
+ final_paths = FinalPaths(self)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar