Rev 9: Warn when we still find a criss-cross in the per-file graph. in http://bzr.arbash-meinel.com/plugins/per_file_remerge

John Arbash Meinel john at arbash-meinel.com
Thu Jun 19 20:40:03 BST 2008


At http://bzr.arbash-meinel.com/plugins/per_file_remerge

------------------------------------------------------------
revno: 9
revision-id: john at arbash-meinel.com-20080619193942-zxfxqkgdaizr24kq
parent: john at arbash-meinel.com-20080618162428-ocbq9geijm3pppg5
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: per_file_remerge
timestamp: Thu 2008-06-19 14:39:42 -0500
message:
  Warn when we still find a criss-cross in the per-file graph.
-------------- next part --------------
=== modified file 'per_file_remerge.py'
--- a/per_file_remerge.py	2008-06-18 16:24:28 +0000
+++ b/per_file_remerge.py	2008-06-19 19:39:42 +0000
@@ -37,7 +37,7 @@
 
     per_file_graph = _get_per_file_graph(tree, file_id)
     this_modifed, base_revision_id, other_modified = _find_revision_ids(
-        tree, file_id, merge_tree, per_file_graph)
+        tree, file_id, merge_tree, per_file_graph, relpath)
 
     _restore_file_id_to_pristine(tree, file_id, relpath)
 
@@ -91,13 +91,14 @@
     return graph_obj
 
 
-def _find_revision_ids(tree, file_id, merge_tree, graph_obj):
+def _find_revision_ids(tree, file_id, merge_tree, graph_obj, relpath):
     """Find the revision ids that are going to be merged.
 
     :param tree: The working tree in question
     :param file_id: The file in question
     :param merge_tree: The tree which was merged into this one
     :param graph_obj: The per-file graph, given by _get_per_file_graph
+    :param relpath: The name of the file being processed. Used for logging.
     :return: revision ids for (this, base, other)
     """
     # Use tree.inventory[file_id].revision to find the revision id in the
@@ -119,8 +120,11 @@
             count_steps=True)
     except errors.NoCommonAncestor:
         trace.warning('Could not find a common ancestor for %s, using null:',
-                      file_id)
+                      relpath)
         base_revision_id = revision.NULL_REVISION
+    if num_steps > 1:
+        trace.warning('Found a criss-cross merge in the per-file graph for %s',
+                      relpath)
     return (this_last_modified_revision_id, base_revision_id,
             other_last_modified_revision_id)
 



More information about the bazaar-commits mailing list