Rev 3493: Update Trivial tests to excercise multi-parent scenarios. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/annotation
John Arbash Meinel
john at arbash-meinel.com
Thu Jun 12 17:33:17 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/annotation
------------------------------------------------------------
revno: 3493
revision-id: john at arbash-meinel.com-20080612163311-977q08c89jqwjcul
parent: john at arbash-meinel.com-20080611231752-im40yu3463bd5uqc
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: annotation
timestamp: Thu 2008-06-12 11:33:11 -0500
message:
Update Trivial tests to excercise multi-parent scenarios.
Fix some typos in the multi-parent handling.
-------------- next part --------------
=== modified file 'bzrlib/annotation_policy/__init__.py'
--- a/bzrlib/annotation_policy/__init__.py 2008-06-11 23:10:18 +0000
+++ b/bzrlib/annotation_policy/__init__.py 2008-06-12 16:33:11 +0000
@@ -101,14 +101,14 @@
return self._reannotate_annotated(second_parent_lines,
plain_child_lines, child_revision_id, left)
- def _do_annotate_many_parents(self, annotated_parent_lines,
+ def _do_annotate_many_parents(self, annotated_parents_lines,
first_matching_blocks, plain_child_lines,
child_revision_id):
# Annotate the child lines versus each parent, and then match up the
# lines one-by-one
reannotations = [self._reannotate_one(annotated_parents_lines[0],
plain_child_lines, child_revision_id,
- left_matching_blocks)]
+ first_matching_blocks)]
reannotations.extend(self._reannotate_one(p, plain_child_lines,
child_revision_id)
for p in annotated_parents_lines[1:])
=== modified file 'bzrlib/annotation_policy/no_merge.py'
--- a/bzrlib/annotation_policy/no_merge.py 2008-06-11 23:10:18 +0000
+++ b/bzrlib/annotation_policy/no_merge.py 2008-06-12 16:33:11 +0000
@@ -34,9 +34,9 @@
return self._do_annotate_one_parent(first_parent_lines,
first_matching_blocks, plain_child_lines, child_revision_id)
- def _do_annotate_many_parents(self, annotated_parent_lines,
+ def _do_annotate_many_parents(self, annotated_parents_lines,
first_matching_blocks, plain_child_lines,
child_revision_id):
- return self._do_annotate_one_parent(annotated_parent_lines[0],
+ return self._do_annotate_one_parent(annotated_parents_lines[0],
first_matching_blocks, plain_child_lines, child_revision_id)
=== modified file 'bzrlib/tests/test_annotation_policy.py'
--- a/bzrlib/tests/test_annotation_policy.py 2008-06-11 23:17:52 +0000
+++ b/bzrlib/tests/test_annotation_policy.py 2008-06-12 16:33:11 +0000
@@ -203,13 +203,42 @@
class TrivialAnnotationScenario(AnnotationScenario):
-
+ """This is meant to test that basic apis work.
+
+ It has a node with no basis, one with 1 parent, one with 2 parents, and one
+ with 3 parents. The text doesn't change much, so that we don't have to
+ worry about annotation disagreements.
+ """
+
+ # A # base
+ # |\
+ # B C # B adds a line, C adds a different line
+ # |/
+ # D-. # They merge, and the line is reverted in favor of B
+ # |\ \
+ # | E F # both descend from D, but introduce different texts
+ # | |/
+ # |//
+ # G # they are merged, and again reverted in favor of B
+
+ # This is just to test that trivial annotation, 1 parent, and 2 parent
name = 'trivial'
- _annotated_texts = {'base': 'base one line\n',
- 'first': 'base one line\n'
- 'first line\n',
+ _annotated_texts = {'A': 'A one line\n',
+ 'B': 'A one line\n'
+ 'B new line\n',
+ 'C': 'A one line\n'
+ 'C alt line\n',
+ 'D': 'A one line\n'
+ 'B new line\n',
+ 'E': 'A one line\n'
+ 'E mod line\n',
+ 'F': 'A one line\n'
+ 'F mod2 line\n',
+ 'G': 'A one line\n'
+ 'B new line\n',
}
- _revision_graph = {'base':(), 'first':('base',)}
+ _revision_graph = {'A':(), 'B':('A',), 'C':('A',), 'D':('B', 'C'),
+ 'E':('D',), 'F':('D',), 'G':('D', 'E', 'F')}
# It is expected that all implementations will give the same results. This is
# mostly to check that the basic apis are all available
More information about the bazaar-commits
mailing list