Rev 4627: Fix bogus tests. in file:///home/vila/src/bzr/experimental/conflict-manager/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Oct 19 11:30:23 BST 2009
At file:///home/vila/src/bzr/experimental/conflict-manager/
------------------------------------------------------------
revno: 4627
revision-id: v.ladeuil+lp at free.fr-20091019103023-fe6q588hn8suf8io
parent: v.ladeuil+lp at free.fr-20091019085156-3pq8i5e51y6c7uui
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: description
timestamp: Mon 2009-10-19 12:30:23 +0200
message:
Fix bogus tests.
* bzrlib/tests/test_conflicts.py:
(TestResolveUnversionedParent): Fix the tests, they weren't
creating the right kind of conflict.
-------------- next part --------------
=== modified file 'bzrlib/conflicts.py'
--- a/bzrlib/conflicts.py 2009-10-19 08:51:56 +0000
+++ b/bzrlib/conflicts.py 2009-10-19 10:30:23 +0000
@@ -430,7 +430,8 @@
def take_theirs(self, tree):
tree.remove([self.path], force=True, keep_files=False)
-
+# FIXME: TextConflict is about a single file-id, there never is a conflict_path
+# attribute so we shouldn't inherit from PathConflict but simply from Conflict
class TextConflict(PathConflict):
"""The merge algorithm could not resolve all differences encountered."""
=== modified file 'bzrlib/tests/test_conflicts.py'
--- a/bzrlib/tests/test_conflicts.py 2009-10-19 08:51:56 +0000
+++ b/bzrlib/tests/test_conflicts.py 2009-10-19 10:30:23 +0000
@@ -304,45 +304,43 @@
class TestResolveUnversionedParent(TestResolveConflicts):
+ # FIXME: Add the reverse tests: dir deleted in trunk, file added in branch
+
preamble = """
$ bzr init trunk
$ cd trunk
-$ echo 'trunk content' >file
-$ bzr add file
+$ mkdir dir
+$ bzr add dir
$ bzr commit -m 'Create trunk'
-$ echo 'trunk content too' >file2
-$ bzr add file2
-$ bzr commit -m 'Add file2 in trunk'
+$ echo 'trunk content' >dir/file
+$ bzr add dir/file
+$ bzr commit -m 'Add dir/file in trunk'
$ bzr branch . -r 1 ../branch
$ cd ../branch
-$ echo 'branch content' >file2
-$ bzr add file2
-$ bzr commit -m 'Add file2 in branch'
+$ bzr rm dir
+$ bzr commit -m 'Remove dir in branch'
$ bzr merge ../trunk
-2>+N file2
-2>R file2 => file2.moved
-2>Conflict adding file file2. Moved existing file to file2.moved.
-2>1 conflicts encountered.
+2>+N dir/
+2>+N dir/file
+2>Conflict adding files to dir. Created directory.
+2>Conflict because dir is not versioned, but has versioned children. Versioned directory.
+2>2 conflicts encountered.
"""
- def test_keep_this(self):
+ def test_keep_mine(self):
self.run_script("""
-$ bzr rm file2 --force
-$ bzr mv file2.moved file2
-$ bzr resolve file2
+$ bzr rm dir --force
+$ bzr resolve dir
$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
- def test_keep_other(self):
- self.failIfExists('branch/file2.moved')
+ def test_take_theirs(self):
self.run_script("""
-$ bzr rm file2.moved --force
-$ bzr resolve file2
+$ bzr resolve dir
$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
- self.failIfExists('branch/file2.moved')
class TestResolveMissingParent(TestResolveConflicts):
More information about the bazaar-commits
mailing list