Mercurial > hg
comparison tests/test-mq-merge.t @ 12324:b701610f6c56
tests: unify some of test-mq*
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sun, 19 Sep 2010 23:42:18 +0200 |
parents | tests/test-mq-merge@2376b4cc52d8 |
children | 5163e3c8aa52 |
comparison
equal
deleted
inserted
replaced
12318:d643ae555a4d | 12324:b701610f6c56 |
---|---|
1 # Test issue 529 - mq aborts when merging patch deleting files | |
2 | |
3 $ checkundo() | |
4 > { | |
5 > if [ -f .hg/store/undo ]; then | |
6 > echo ".hg/store/undo still exists" | |
7 > fi | |
8 > } | |
9 | |
10 $ echo "[extensions]" >> $HGRCPATH | |
11 $ echo "mq =" >> $HGRCPATH | |
12 $ echo "[mq]" >> $HGRCPATH | |
13 $ echo "git = keep" >> $HGRCPATH | |
14 | |
15 Commit two dummy files in "init" changeset: | |
16 | |
17 $ hg init t | |
18 $ cd t | |
19 $ echo a > a | |
20 $ echo b > b | |
21 $ hg ci -Am init | |
22 adding a | |
23 adding b | |
24 $ hg tag -l init | |
25 | |
26 Create a patch removing a: | |
27 | |
28 $ hg qnew rm_a | |
29 $ hg rm a | |
30 $ hg qrefresh -m "rm a" | |
31 | |
32 Save the patch queue so we can merge it later: | |
33 | |
34 $ hg qsave -c -e | |
35 copy .*/t/.hg/patches to .*/t/.hg/patches.1 | |
36 $ checkundo | |
37 | |
38 Update b and commit in an "update" changeset: | |
39 | |
40 $ hg up -C init | |
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 $ echo b >> b | |
43 $ hg st | |
44 M b | |
45 $ hg ci -m update | |
46 created new head | |
47 | |
48 # Here, qpush used to abort with : | |
49 # The system cannot find the file specified => a | |
50 $ hg manifest | |
51 a | |
52 b | |
53 | |
54 $ hg qpush -a -m | |
55 merging with queue at: .*/t/.hg/patches.1 | |
56 applying rm_a | |
57 now at: rm_a | |
58 | |
59 $ checkundo | |
60 $ hg manifest | |
61 b | |
62 | |
63 Ensure status is correct after merge: | |
64 | |
65 $ hg qpop -a | |
66 popping rm_a | |
67 popping .hg.patches.merge.marker | |
68 patch queue now empty | |
69 | |
70 $ cd .. | |
71 | |
72 Classic MQ merge sequence *with an explicit named queue*: | |
73 | |
74 $ hg init t2 | |
75 $ cd t2 | |
76 $ echo '[diff]' > .hg/hgrc | |
77 $ echo 'nodates = 1' >> .hg/hgrc | |
78 $ echo a > a | |
79 $ hg ci -Am init | |
80 adding a | |
81 $ echo b > a | |
82 $ hg ci -m changea | |
83 $ hg up -C 0 | |
84 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
85 $ hg cp a aa | |
86 $ echo c >> a | |
87 $ hg qnew --git -f -e patcha | |
88 $ echo d >> a | |
89 $ hg qnew -d '0 0' -f -e patcha2 | |
90 | |
91 Create the reference queue: | |
92 | |
93 $ hg qsave -c -e -n refqueue | |
94 copy .*/t2/.hg/patches to .*/t2/.hg/refqueue | |
95 $ hg up -C 1 | |
96 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
97 | |
98 Merge: | |
99 | |
100 $ HGMERGE=internal:other hg qpush -a -m -n refqueue | |
101 merging with queue at: .*/t2/.hg/refqueue | |
102 applying patcha | |
103 patching file a | |
104 Hunk #1 FAILED at 0 | |
105 1 out of 1 hunks FAILED -- saving rejects to file a.rej | |
106 patch failed, unable to continue (try -v) | |
107 patch failed, rejects left in working dir | |
108 patch didn't work out, merging patcha | |
109 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
110 0 files updated, 2 files merged, 0 files removed, 0 files unresolved | |
111 (branch merge, don't forget to commit) | |
112 applying patcha2 | |
113 now at: patcha2 | |
114 | |
115 Check patcha is still a git patch: | |
116 | |
117 $ cat .hg/patches/patcha | |
118 # HG changeset patch | |
119 # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4 | |
120 | |
121 diff --git a/a b/a | |
122 --- a/a | |
123 +++ b/a | |
124 @@ -1,1 +1,2 @@ | |
125 -b | |
126 +a | |
127 +c | |
128 diff --git a/a b/aa | |
129 copy from a | |
130 copy to aa | |
131 --- a/a | |
132 +++ b/aa | |
133 @@ -1,1 +1,1 @@ | |
134 -b | |
135 +a | |
136 | |
137 Check patcha2 is still a regular patch: | |
138 | |
139 $ cat .hg/patches/patcha2 | |
140 # HG changeset patch | |
141 # Parent ........................................ | |
142 # Date 0 0 | |
143 | |
144 diff -r ............ -r ............ a | |
145 --- a/a | |
146 +++ b/a | |
147 @@ -1,2 +1,3 @@ | |
148 a | |
149 c | |
150 +d | |
151 | |
152 $ cd .. | |
153 |