Rev 3492: Add tests showing the difference of no-merge. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/annotation
John Arbash Meinel
john at arbash-meinel.com
Thu Jun 12 00:18:03 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/annotation
------------------------------------------------------------
revno: 3492
revision-id: john at arbash-meinel.com-20080611231752-im40yu3463bd5uqc
parent: john at arbash-meinel.com-20080611231018-tbylmdk633nv40x8
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: annotation
timestamp: Wed 2008-06-11 18:17:52 -0500
message:
Add tests showing the difference of no-merge.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_annotation_policy.py'
--- a/bzrlib/tests/test_annotation_policy.py 2008-06-11 23:10:18 +0000
+++ b/bzrlib/tests/test_annotation_policy.py 2008-06-11 23:17:52 +0000
@@ -216,6 +216,31 @@
TrivialAnnotationScenario(None, {})
+class MergeIntroducedScenario(AnnotationScenario):
+ """A line is changed in a branch, and this change is merged."""
+
+ # A # Base text
+ # |\
+ # | B # Introduce a line
+ # |/
+ # C # Merge the line back into main
+
+ name = 'merge-introduced'
+
+ _revision_graph = {'rev-A':(), 'rev-B':('rev-A',),
+ 'rev-C':('rev-A', 'rev-B')}
+ _annotated_texts = {'rev-A':'rev-A line\n',
+ 'rev-B':'rev-A line\nrev-B new line\n',
+ 'rev-C':'rev-A line\nNone new line\n',
+ }
+
+MergeIntroducedScenario(['merge-node', 'right-head', 'simple-right',
+ 'left-head', 'simple-left'],
+ {'rev-C':[(1, 'rev-B', 'new line\n')]})
+MergeIntroducedScenario(['no-merge'],
+ {'rev-C':[(1, 'rev-C', 'new line\n')]})
+
+
class DuplicateLineScenario(AnnotationScenario):
"""Two branches introduce the same line.
@@ -227,15 +252,15 @@
The actual annotations will vary slightly based on the algorithm. For the
default algorithm, the values are as noted.
+ """
- BASE
- |\
- A B # line should be annotated as new for A and B
- |\|
- C D # we now have to resolve the mismatch
- |/
- E # and then decide what to do when this gets merged back
- """
+ # BASE
+ # |\
+ # A B # line should be annotated as new for A and B
+ # |\|
+ # C D # we now have to resolve the mismatch
+ # |/
+ # E # and then decide what to do when this gets merged back
name = 'duplicated'
@@ -307,16 +332,15 @@
class MergeRevertedLineScenario(AnnotationScenario):
- """A line was modified and then reverted in a branch.
+ """A line was modified and then reverted in a branch."""
- A # Common text, has line 'foo'
- |\
- B C # No change in B, C changes 'foo' to 'bar'
- | |
- | D # D reverts 'bar' back to 'foo'
- |/
- E
- """
+ # A # Common text, has line 'foo'
+ # |\
+ # B C # No change in B, C changes 'foo' to 'bar'
+ # | |
+ # | D # D reverts 'bar' back to 'foo'
+ # |/
+ # E
name = 'merge-reverted-line'
@@ -338,16 +362,15 @@
class TrunkRevertedLineScenario(AnnotationScenario):
- """A line was modified and then reverted in trunk.
+ """A line was modified and then reverted in trunk."""
- A # Common text, has line 'foo'
- |\
- B C # No change in C, B changes 'foo' to 'bar'
- | |
- D | # D reverts 'bar' back to 'foo'
- |/
- E
- """
+ # A # Common text, has line 'foo'
+ # |\
+ # B C # No change in C, B changes 'foo' to 'bar'
+ # | |
+ # D | # D reverts 'bar' back to 'foo'
+ # |/
+ # E
name = 'trunk-reverted-line'
More information about the bazaar-commits
mailing list