Rev 4613: Update to new shell-like tests syntax. in file:///home/vila/src/bzr/experimental/conflict-manager/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Sep 17 20:41:49 BST 2009
At file:///home/vila/src/bzr/experimental/conflict-manager/
------------------------------------------------------------
revno: 4613
revision-id: v.ladeuil+lp at free.fr-20090917194149-2ybbn31rlu6cp5pb
parent: v.ladeuil+lp at free.fr-20090917192619-4ep6hpj6wus7kp02
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: description
timestamp: Thu 2009-09-17 21:41:49 +0200
message:
Update to new shell-like tests syntax.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_conflicts.py'
--- a/bzrlib/tests/test_conflicts.py 2009-09-16 13:38:07 +0000
+++ b/bzrlib/tests/test_conflicts.py 2009-09-17 19:41:49 +0000
@@ -193,23 +193,23 @@
# branch) but that could wait until the resolution mechanism is implemented.
preamble = """
-bzr init trunk
-cd trunk
-echo 'trunk content' >file
-bzr add file
-bzr commit -m 'Create trunk'
-
-bzr branch . ../branch
-cd ../branch
-bzr rm file
-bzr commit -m 'Delete file'
-
-cd ../trunk
-echo 'more content' >>file
-bzr commit -m 'Modify file'
-
-cd ../branch
-bzr merge ../trunk
+$ bzr init trunk
+$ cd trunk
+$ echo 'trunk content' >file
+$ bzr add file
+$ bzr commit -m 'Create trunk'
+
+$ bzr branch . ../branch
+$ cd ../branch
+$ bzr rm file
+$ bzr commit -m 'Delete file'
+
+$ cd ../trunk
+$ echo 'more content' >>file
+$ bzr commit -m 'Modify file'
+
+$ cd ../branch
+$ bzr merge ../trunk
2>+N file.OTHER
2>Contents conflict in file
2>1 conflicts encountered.
@@ -217,38 +217,38 @@
def test_keep_this(self):
self.run_script("""
-bzr rm file.OTHER --force # a simple rm file.OTHER is valid too
-bzr resolve file
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr rm file.OTHER --force # a simple rm file.OTHER is valid too
+$ bzr resolve file
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_keep_other(self):
self.run_script("""
-bzr mv file.OTHER file
-bzr resolve file
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr mv file.OTHER file
+$ bzr resolve file
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
class TestResolveDuplicatePaths(TestResolveConflicts):
preamble = """
-bzr init trunk
-cd trunk
-echo 'trunk content' >file
-bzr add file
-bzr commit -m 'Create trunk'
-echo 'trunk content too' >file2
-bzr add file2
-bzr commit -m 'Add file2 in trunk'
-
-bzr branch . -r 1 ../branch
-cd ../branch
-echo 'branch content' >file2
-bzr add file2
-bzr commit -m 'Add file2 in branch'
-
-bzr merge ../trunk
+$ bzr init trunk
+$ cd trunk
+$ echo 'trunk content' >file
+$ bzr add file
+$ bzr commit -m 'Create trunk'
+$ echo 'trunk content too' >file2
+$ bzr add file2
+$ bzr commit -m 'Add file2 in trunk'
+
+$ bzr branch . -r 1 ../branch
+$ cd ../branch
+$ echo 'branch content' >file2
+$ bzr add file2
+$ bzr commit -m 'Add file2 in branch'
+
+$ bzr merge ../trunk
2>+N file2
2>R file2 => file2.moved
2>Conflict adding file file2. Moved existing file to file2.moved.
@@ -257,18 +257,18 @@
def test_keep_this(self):
self.run_script("""
-bzr rm file2 --force
-bzr mv file2.moved file2
-bzr resolve file2
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr rm file2 --force
+$ bzr mv file2.moved file2
+$ bzr resolve file2
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_keep_other(self):
self.failIfExists('branch/file2.moved')
self.run_script("""
-bzr rm file2.moved --force
-bzr resolve file2
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr rm file2.moved --force
+$ bzr resolve file2
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
self.failIfExists('branch/file2.moved')
@@ -276,22 +276,22 @@
class TestResolveUnversionedParent(TestResolveConflicts):
preamble = """
-bzr init trunk
-cd trunk
-echo 'trunk content' >file
-bzr add file
-bzr commit -m 'Create trunk'
-echo 'trunk content too' >file2
-bzr add file2
-bzr commit -m 'Add file2 in trunk'
-
-bzr branch . -r 1 ../branch
-cd ../branch
-echo 'branch content' >file2
-bzr add file2
-bzr commit -m 'Add file2 in branch'
-
-bzr merge ../trunk
+$ bzr init trunk
+$ cd trunk
+$ echo 'trunk content' >file
+$ bzr add file
+$ bzr commit -m 'Create trunk'
+$ echo 'trunk content too' >file2
+$ bzr add file2
+$ bzr commit -m 'Add file2 in trunk'
+
+$ bzr branch . -r 1 ../branch
+$ cd ../branch
+$ echo 'branch content' >file2
+$ bzr add file2
+$ bzr commit -m 'Add file2 in branch'
+
+$ bzr merge ../trunk
2>+N file2
2>R file2 => file2.moved
2>Conflict adding file file2. Moved existing file to file2.moved.
@@ -300,18 +300,18 @@
def test_keep_this(self):
self.run_script("""
-bzr rm file2 --force
-bzr mv file2.moved file2
-bzr resolve file2
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr rm file2 --force
+$ bzr mv file2.moved file2
+$ bzr resolve file2
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_keep_other(self):
self.failIfExists('branch/file2.moved')
self.run_script("""
-bzr rm file2.moved --force
-bzr resolve file2
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr rm file2.moved --force
+$ bzr resolve file2
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
self.failIfExists('branch/file2.moved')
@@ -319,23 +319,23 @@
class TestResolveMissingParent(TestResolveConflicts):
preamble = """
-bzr init trunk
-cd trunk
-mkdir dir
-echo 'trunk content' >dir/file
-bzr add
-bzr commit -m 'Create trunk'
-echo 'trunk content' >dir/file2
-bzr add dir/file2
-bzr commit -m 'Add dir/file2 in branch'
-
-bzr branch . -r 1 ../branch
-cd ../branch
-bzr rm dir/file --force
-bzr rm dir
-bzr commit -m 'Remove dir/file'
-
-bzr merge ../trunk
+$ bzr init trunk
+$ cd trunk
+$ mkdir dir
+$ echo 'trunk content' >dir/file
+$ bzr add
+$ bzr commit -m 'Create trunk'
+$ echo 'trunk content' >dir/file2
+$ bzr add dir/file2
+$ bzr commit -m 'Add dir/file2 in branch'
+
+$ bzr branch . -r 1 ../branch
+$ cd ../branch
+$ bzr rm dir/file --force
+$ bzr rm dir
+$ bzr commit -m 'Remove dir/file'
+
+$ bzr merge ../trunk
2>+N dir/
2>+N dir/file2
2>Conflict adding files to dir. Created directory.
@@ -345,46 +345,46 @@
def test_keep_them_all(self):
self.run_script("""
-bzr resolve dir
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr resolve dir
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_adopt_child(self):
self.run_script("""
-bzr mv dir/file2 file2
-bzr rm dir --force
-bzr resolve dir
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr mv dir/file2 file2
+$ bzr rm dir --force
+$ bzr resolve dir
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_kill_them_all(self):
self.run_script("""
-bzr rm dir --force
-bzr resolve dir
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr rm dir --force
+$ bzr resolve dir
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
class TestResolveDeletingParent(TestResolveConflicts):
preamble = """
-bzr init trunk
-cd trunk
-mkdir dir
-echo 'trunk content' >dir/file
-bzr add
-bzr commit -m 'Create trunk'
-bzr rm dir/file --force
-bzr rm dir --force
-bzr commit -m 'Remove dir/file'
-
-bzr branch . -r 1 ../branch
-cd ../branch
-echo 'branch content' >dir/file2
-bzr add dir/file2
-bzr commit -m 'Add dir/file2 in branch'
-
-bzr merge ../trunk
+$ bzr init trunk
+$ cd trunk
+$ mkdir dir
+$ echo 'trunk content' >dir/file
+$ bzr add
+$ bzr commit -m 'Create trunk'
+$ bzr rm dir/file --force
+$ bzr rm dir --force
+$ bzr commit -m 'Remove dir/file'
+
+$ bzr branch . -r 1 ../branch
+$ cd ../branch
+$ echo 'branch content' >dir/file2
+$ bzr add dir/file2
+$ bzr commit -m 'Add dir/file2 in branch'
+
+$ bzr merge ../trunk
2>-D dir/file
2>Conflict: can't delete dir because it is not empty. Not deleting.
2>Conflict because dir is not versioned, but has versioned children. Versioned directory.
@@ -393,44 +393,44 @@
def test_keep_them_all(self):
self.run_script("""
-bzr resolve dir
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr resolve dir
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_adopt_child(self):
self.run_script("""
-bzr mv dir/file2 file2
-bzr rm dir --force
-bzr resolve dir
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr mv dir/file2 file2
+$ bzr rm dir --force
+$ bzr resolve dir
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_kill_them_all(self):
self.run_script("""
-bzr rm dir --force
-bzr resolve dir
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr rm dir --force
+$ bzr resolve dir
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
class TestResolvePathConflict(TestResolveConflicts):
preamble = """
-bzr init trunk
-cd trunk
-mkdir dir
-echo 'Boo!' >file
-bzr add
-bzr commit -m 'Create trunk'
-bzr mv file file-in-trunk
-bzr commit -m 'Renamed to file-in-trunk'
-
-bzr branch . -r 1 ../branch
-cd ../branch
-bzr mv file file-in-branch
-bzr commit -m 'Renamed to file-in-branch'
-
-bzr merge ../trunk
+$ bzr init trunk
+$ cd trunk
+$ mkdir dir
+$ echo 'Boo!' >file
+$ bzr add
+$ bzr commit -m 'Create trunk'
+$ bzr mv file file-in-trunk
+$ bzr commit -m 'Renamed to file-in-trunk'
+
+$ bzr branch . -r 1 ../branch
+$ cd ../branch
+$ bzr mv file file-in-branch
+$ bzr commit -m 'Renamed to file-in-branch'
+
+$ bzr merge ../trunk
2>R file-in-branch => file-in-trunk
2>Path conflict: file-in-branch / file-in-trunk
2>1 conflicts encountered.
@@ -438,73 +438,72 @@
def test_keep_source(self):
self.run_script("""
-bzr resolve file-in-trunk
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr resolve file-in-trunk
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_keep_target(self):
self.run_script("""
-bzr mv file-in-trunk file-in-branch
-bzr resolve file-in-branch
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr mv file-in-trunk file-in-branch
+$ bzr resolve file-in-branch
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
class TestResolveParentLoop(TestResolveConflicts):
preamble = """
-bzr init trunk
-cd trunk
-bzr mkdir dir1
-bzr mkdir dir2
-bzr commit -m 'Create trunk'
-bzr mv dir2 dir1
-bzr commit -m 'Moved dir2 into dir1'
-
-bzr branch . -r 1 ../branch
-cd ../branch
-bzr mv dir1 dir2
-bzr commit -m 'Moved dir1 into dir2'
-
-bzr merge ../trunk
+$ bzr init trunk
+$ cd trunk
+$ bzr mkdir dir1
+$ bzr mkdir dir2
+$ bzr commit -m 'Create trunk'
+$ bzr mv dir2 dir1
+$ bzr commit -m 'Moved dir2 into dir1'
+
+$ bzr branch . -r 1 ../branch
+$ cd ../branch
+$ bzr mv dir1 dir2
+$ bzr commit -m 'Moved dir1 into dir2'
+
+$ bzr merge ../trunk
2>Conflict moving dir2/dir1 into dir2. Cancelled move.
2>1 conflicts encountered.
"""
def test_keep_target(self):
self.run_script("""
-bzr resolve dir2
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr resolve dir2
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_keep_source(self):
self.run_script("""
-bzr ls -RV
-bzr mv dir2/dir1 dir1
-bzr mv dir2 dir1
-bzr resolve dir2
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr mv dir2/dir1 dir1
+$ bzr mv dir2 dir1
+$ bzr resolve dir2
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
class TestResolveNonDirectoryParent(TestResolveConflicts):
preamble = """
-bzr init trunk
-cd trunk
-bzr mkdir foo
-bzr commit -m 'Create trunk'
-echo "Boing" >foo/bar
-bzr add foo/bar
-bzr commit -m 'Add foo/bar'
-
-bzr branch . -r 1 ../branch
-cd ../branch
-rm -r foo
-echo "Boo!" >foo
-bzr commit -m 'foo is now a file'
-
-bzr merge ../trunk
+$ bzr init trunk
+$ cd trunk
+$ bzr mkdir foo
+$ bzr commit -m 'Create trunk'
+$ echo "Boing" >foo/bar
+$ bzr add foo/bar
+$ bzr commit -m 'Add foo/bar'
+
+$ bzr branch . -r 1 ../branch
+$ cd ../branch
+$ rm -r foo
+$ echo "Boo!" >foo
+$ bzr commit -m 'foo is now a file'
+
+$ bzr merge ../trunk
2>+N foo.new/bar
2>RK foo => foo.new/
# FIXME: The message is misleading, foo.new *is* a directory when the message
@@ -515,20 +514,20 @@
def test_remove_this(self):
self.run_script("""
-bzr rm foo --force
-bzr mv foo.new foo
-bzr resolve foo
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr rm foo --force
+$ bzr mv foo.new foo
+$ bzr resolve foo
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
def test_remove_other(self):
self.run_script("""
-bzr rm foo.new --force
+$ bzr rm foo.new --force
# FIXME: Isn't it weird that foo is now unkown even if foo.new has been put
# aside ? -- vila 090916
-bzr add foo
-bzr resolve foo.new
-bzr commit --strict -m 'No more conflicts nor unknown files'
+$ bzr add foo
+$ bzr resolve foo.new
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
""")
@@ -539,20 +538,20 @@
# trunk switched. As such it should certainly produce the same
# conflict.
self.run_script("""
-bzr init trunk
-cd trunk
-bzr mkdir foo
-bzr commit -m 'Create trunk'
-rm -r foo
-echo "Boo!" >foo
-bzr commit -m 'foo is now a file'
-
-bzr branch . -r 1 ../branch
-cd ../branch
-echo "Boing" >foo/bar
-bzr add foo/bar
-bzr commit -m 'Add foo/bar'
-
-bzr merge ../trunk
+$ bzr init trunk
+$ cd trunk
+$ bzr mkdir foo
+$ bzr commit -m 'Create trunk'
+$ rm -r foo
+$ echo "Boo!" >foo
+$ bzr commit -m 'foo is now a file'
+
+$ bzr branch . -r 1 ../branch
+$ cd ../branch
+$ echo "Boing" >foo/bar
+$ bzr add foo/bar
+$ bzr commit -m 'Add foo/bar'
+
+$ bzr merge ../trunk
2>bzr: ERROR: Tree transform is malformed [('unversioned executability', 'new-1')]
""")
More information about the bazaar-commits
mailing list