[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-commits-diffs] net.venge.monotone.issue-209: c67426e491a95c2cb
From: |
code |
Subject: |
[Monotone-commits-diffs] net.venge.monotone.issue-209: c67426e491a95c2cb764d5315442d81843bf82e8 |
Date: |
Sat, 9 Jun 2012 17:32:35 +0200 (CEST) |
revision: c67426e491a95c2cb764d5315442d81843bf82e8
date: 2012-06-08T22:09:48
author: address@hidden
branch: net.venge.monotone.issue-209
changelog:
add test of multiple merges with dropped_modified conflict
* test/func/resolve_conflicts_dropped_modified/__driver__.lua: add refs to
other tests
* test/func/update_with_pending_modification/__driver__.lua: fix bugs
* test/func/resolve_conflicts_dropped_modified_2: New test.
manifest:
format_version "1"
new_manifest [0c9d8b1073bce970619c956514731656317eefae]
old_revision [e46f9aa2c96785da56a6ae6a13197ee7f3ad7b8c]
delete "test/func/merge((patch_a),_(drop_a,_add_a))"
delete "test/func/merge((patch_a),_(drop_a,_add_a))/__driver__.lua"
add_dir "test/func/resolve_conflicts_dropped_modified_2"
add_file "test/func/resolve_conflicts_dropped_modified_2/__driver__.lua"
content [49e72adbb370c1cdd117a8e1facf86777d039a47]
patch "test/func/resolve_conflicts_dropped_modified/__driver__.lua"
from [9653bbfed7d26f56e0313979a069a3ab139d1666]
to [ae5cc1ba521c8721d36ba4fd8b9c11238d719cae]
patch "test/func/update_with_pending_modification/__driver__.lua"
from [ac866e80c2aebb3803c42ad8ca275316050b9675]
to [de7b5ac13bfad72bce229ee71f3ae972c741f08b]
============================================================
--- test/func/merge((patch_a),_(drop_a,_add_a))/__driver__.lua 9fa8b98418f195441770ae5069b8417245ace48f
+++ /dev/null
@@ -1,31 +0,0 @@
-
-mtn_setup()
-
--- In this case, the patch should be completely ignored; we shouldn't
--- even try to do a merge.
-
-writefile("base", "foo blah")
-writefile("left", "bar blah")
-writefile("new_right", "baz blah")
-
-copy("base", "testfile")
-check(mtn("add", "testfile"), 0, false, false)
-commit()
-base = base_revision()
-
-copy("left", "testfile")
-commit()
-
-revert_to(base)
-
-remove("testfile")
-check(mtn("drop", "--bookkeep-only", "testfile"), 0, false, false)
-commit()
-
-copy("new_right", "testfile")
-check(mtn("add", "testfile"), 0, false, false)
-commit()
-
-check(mtn("merge"), 0, false, false)
-check(mtn("update"), 0, false, false)
-check(samefile("testfile", "new_right"))
============================================================
--- test/func/resolve_conflicts_dropped_modified/__driver__.lua 9653bbfed7d26f56e0313979a069a3ab139d1666
+++ test/func/resolve_conflicts_dropped_modified/__driver__.lua ae5cc1ba521c8721d36ba4fd8b9c11238d719cae
@@ -1,4 +1,8 @@
-- Test reporting and resolving drop/modified conflicts
+--
+-- other tests validate resolving in extended use cases:
+-- ../resolve_conflicts_dropped_modified_2,
+-- ../resolve_conflicts_dropped_modified_vendor
mtn_setup()
============================================================
--- /dev/null
+++ test/func/resolve_conflicts_dropped_modified_2/__driver__.lua 49e72adbb370c1cdd117a8e1facf86777d039a47
@@ -0,0 +1,86 @@
+-- Verify that we can resolve this extended use case involving a
+-- dropped_modified conflict:
+--
+-- A
+-- / \
+-- M1 D
+-- | \ |
+-- M2 P
+-- \ /
+-- Q
+--
+-- The file is modified and merged into the dropped branch twice.
+
+mtn_setup()
+
+addfile("file_2", "file_2 base") -- modify/rename left, drop right; drop
+commit("testbranch", "base")
+base = base_revision()
+
+writefile("file_2", "file_2 left 1")
+
+commit("testbranch", "left 1")
+left_1 = base_revision()
+
+revert_to(base)
+
+check(mtn("drop", "file_2"), 0, false, false)
+
+commit("testbranch", "right 1")
+right_1 = base_revision()
+
+check(mtn("show_conflicts", left_1, right_1), 0, nil, true)
+check(samelines
+("stderr",
+ {"mtn: [left] 506d8ed51b06c0080e8bb307155a88637045b532",
+ "mtn: [right] a2889488ed1801a904d0219ec9939dfc2e9be033",
+ "mtn: [ancestor] f80ff103551d0313647d6c84990bc9db6b158dac",
+ "mtn: conflict: file 'file_2' from revision f80ff103551d0313647d6c84990bc9db6b158dac",
+ "mtn: modified on the left, named file_2",
+ "mtn: dropped on the right",
+ "mtn: 1 conflict with supported resolutions."}))
+
+check(mtn("conflicts", "store", left_1, right_1), 0, nil, true)
+
+check(mtn("conflicts", "resolve_first", "keep"), 0, nil, true)
+
+check(mtn("explicit_merge", "--resolve-conflicts", left_1, right_1, "testbranch"), 0, nil, true)
+check(samelines
+("stderr",
+ {"mtn: [left] 506d8ed51b06c0080e8bb307155a88637045b532",
+ "mtn: [right] a2889488ed1801a904d0219ec9939dfc2e9be033",
+ "mtn: keeping 'file_2'",
+ "mtn: [merged] 3df3126220588440def7b08f488ca35eaa94f1b6"}))
+
+check(mtn("update"), 0, nil, true)
+check(samelines("file_2", {"file_2 left 1"}))
+
+right_2 = base_revision()
+
+-- round 2; modify the file again
+revert_to(left_1)
+
+writefile("file_2", "file_2 left 2")
+
+commit("testbranch", "left 2")
+left_2 = base_revision()
+
+check(mtn("show_conflicts", left_2, right_2), 0, nil, true)
+check(samelines
+("stderr",
+ {"mtn: [left] 5a144a43f03692e389f3ddd4c510a4d9754061d5",
+ "mtn: [right] 3df3126220588440def7b08f488ca35eaa94f1b6",
+ "mtn: [ancestor] 506d8ed51b06c0080e8bb307155a88637045b532",
+ "mtn: conflict: file 'file_2' from revision 506d8ed51b06c0080e8bb307155a88637045b532",
+ "mtn: modified on the left, named file_2",
+ "mtn: dropped and recreated on the right",
+ "mtn: 1 conflict with supported resolutions."}))
+
+check(mtn("conflicts", "store", left_1, right_1), 0, nil, true)
+
+check(mtn("conflicts", "resolve_first", "keep"), 0, nil, true)
+
+check(mtn("explicit_merge", "--resolve-conflicts", left_1, right_1, "testbranch"), 0, nil, true)
+check(qgrep("mtn: keeping 'file_2'", "stderr"))
+
+-- end of file
============================================================
--- test/func/update_with_pending_modification/__driver__.lua ac866e80c2aebb3803c42ad8ca275316050b9675
+++ test/func/update_with_pending_modification/__driver__.lua de7b5ac13bfad72bce229ee71f3ae972c741f08b
@@ -18,11 +18,11 @@ writefile("file2", "new contents of file
-- looks like file2 is dropped on one side (in rev 1), and modified on
-- the other (the workspace), so we get a dropped/modified conflict.
-check(mtn("update", "-r", REV1), 1, true, true)
-check(qgrep("mtn: conflict: file 'file2'"), "stderr")
-check(qgrep("mtn: modified on the left, named file2"), "stderr")
-check(qgrep("mtn: dropped on the right"), "stderr")
-check(qgrep("mtn: misuse: merge failed due to unresolved conflicts"), "stderr")
+check(mtn("update", "-r", REV1), 1, nil, true)
+check(qgrep("mtn: conflict: file 'file2'", "stderr"))
+check(qgrep("mtn: modified on the left, named file2", "stderr"))
+check(qgrep("mtn: dropped on the right", "stderr"))
+check(qgrep("mtn: misuse: merge failed due to unresolved conflicts", "stderr"))
-- Since this is a workspace merge, we can't resolve the conflict; the
-- modified file must be committed first.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-commits-diffs] net.venge.monotone.issue-209: c67426e491a95c2cb764d5315442d81843bf82e8,
code <=