|
1 |
|
2 $ catpatch() { |
|
3 > cat $1 | sed -e "s/^\(# Parent \).*/\1/" |
|
4 > } |
|
5 $ echo "[extensions]" >> $HGRCPATH |
|
6 $ echo "mq=" >> $HGRCPATH |
|
7 $ runtest() { |
|
8 > hg init mq |
|
9 > cd mq |
|
10 > |
|
11 > echo a > a |
|
12 > hg ci -Ama |
|
13 > |
|
14 > echo '% qnew should refuse bad patch names' |
|
15 > hg qnew series |
|
16 > hg qnew status |
|
17 > hg qnew guards |
|
18 > hg qnew .hgignore |
|
19 > hg qnew .mqfoo |
|
20 > hg qnew 'foo#bar' |
|
21 > hg qnew 'foo:bar' |
|
22 > |
|
23 > hg qinit -c |
|
24 > |
|
25 > echo '% qnew with name containing slash' |
|
26 > hg qnew foo/bar.patch |
|
27 > hg qseries |
|
28 > hg qpop |
|
29 > hg qdelete foo/bar.patch |
|
30 > |
|
31 > echo '% qnew with uncommitted changes' |
|
32 > echo a > somefile |
|
33 > hg add somefile |
|
34 > hg qnew uncommitted.patch |
|
35 > hg st |
|
36 > hg qseries |
|
37 > |
|
38 > echo '% qnew implies add' |
|
39 > hg -R .hg/patches st |
|
40 > |
|
41 > echo '% qnew missing' |
|
42 > hg qnew missing.patch missing |
|
43 > |
|
44 > echo '% qnew -m' |
|
45 > hg qnew -m 'foo bar' mtest.patch |
|
46 > catpatch .hg/patches/mtest.patch |
|
47 > |
|
48 > echo '% qnew twice' |
|
49 > hg qnew first.patch |
|
50 > hg qnew first.patch |
|
51 > |
|
52 > touch ../first.patch |
|
53 > hg qimport ../first.patch |
|
54 > |
|
55 > echo '% qnew -f from a subdirectory' |
|
56 > hg qpop -a |
|
57 > mkdir d |
|
58 > cd d |
|
59 > echo b > b |
|
60 > hg ci -Am t |
|
61 > echo b >> b |
|
62 > hg st |
|
63 > hg qnew -g -f p |
|
64 > catpatch ../.hg/patches/p |
|
65 > |
|
66 > echo '% qnew -u with no username configured' |
|
67 > HGUSER= hg qnew -u blue red |
|
68 > catpatch ../.hg/patches/red |
|
69 > |
|
70 > echo '% qnew -e -u with no username configured' |
|
71 > HGUSER= hg qnew -e -u chartreuse fucsia |
|
72 > catpatch ../.hg/patches/fucsia |
|
73 > |
|
74 > echo '% fail when trying to import a merge' |
|
75 > hg init merge |
|
76 > cd merge |
|
77 > touch a |
|
78 > hg ci -Am null |
|
79 > echo a >> a |
|
80 > hg ci -m a |
|
81 > hg up -r 0 |
|
82 > echo b >> a |
|
83 > hg ci -m b |
|
84 > hg merge -f 1 |
|
85 > hg resolve --mark a |
|
86 > hg qnew -f merge |
|
87 > |
|
88 > cd ../../.. |
|
89 > rm -r mq |
|
90 > } |
|
91 |
|
92 plain headers |
|
93 |
|
94 $ echo "[mq]" >> $HGRCPATH |
|
95 $ echo "plain=true" >> $HGRCPATH |
|
96 $ mkdir sandbox |
|
97 $ (cd sandbox ; runtest) |
|
98 adding a |
|
99 % qnew should refuse bad patch names |
|
100 abort: "series" cannot be used as the name of a patch |
|
101 abort: "status" cannot be used as the name of a patch |
|
102 abort: "guards" cannot be used as the name of a patch |
|
103 abort: ".hgignore" cannot be used as the name of a patch |
|
104 abort: ".mqfoo" cannot be used as the name of a patch |
|
105 abort: "foo#bar" cannot be used as the name of a patch |
|
106 abort: "foo:bar" cannot be used as the name of a patch |
|
107 % qnew with name containing slash |
|
108 foo/bar.patch |
|
109 popping foo/bar.patch |
|
110 patch queue now empty |
|
111 % qnew with uncommitted changes |
|
112 uncommitted.patch |
|
113 % qnew implies add |
|
114 A .hgignore |
|
115 A series |
|
116 A uncommitted.patch |
|
117 % qnew missing |
|
118 abort: missing: No such file or directory |
|
119 % qnew -m |
|
120 foo bar |
|
121 |
|
122 % qnew twice |
|
123 abort: patch "first.patch" already exists |
|
124 abort: patch "first.patch" already exists |
|
125 % qnew -f from a subdirectory |
|
126 popping first.patch |
|
127 popping mtest.patch |
|
128 popping uncommitted.patch |
|
129 patch queue now empty |
|
130 adding d/b |
|
131 M d/b |
|
132 diff --git a/d/b b/d/b |
|
133 --- a/d/b |
|
134 +++ b/d/b |
|
135 @@ -1,1 +1,2 @@ |
|
136 b |
|
137 +b |
|
138 % qnew -u with no username configured |
|
139 From: blue |
|
140 |
|
141 % qnew -e -u with no username configured |
|
142 From: chartreuse |
|
143 |
|
144 % fail when trying to import a merge |
|
145 adding a |
|
146 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
147 created new head |
|
148 merging a |
|
149 warning: conflicts during merge. |
|
150 merging a failed! |
|
151 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
152 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
153 abort: cannot manage merge changesets |
|
154 $ rm -r sandbox |
|
155 |
|
156 hg headers |
|
157 |
|
158 $ echo "plain=false" >> $HGRCPATH |
|
159 $ mkdir sandbox |
|
160 $ (cd sandbox ; runtest) |
|
161 adding a |
|
162 % qnew should refuse bad patch names |
|
163 abort: "series" cannot be used as the name of a patch |
|
164 abort: "status" cannot be used as the name of a patch |
|
165 abort: "guards" cannot be used as the name of a patch |
|
166 abort: ".hgignore" cannot be used as the name of a patch |
|
167 abort: ".mqfoo" cannot be used as the name of a patch |
|
168 abort: "foo#bar" cannot be used as the name of a patch |
|
169 abort: "foo:bar" cannot be used as the name of a patch |
|
170 % qnew with name containing slash |
|
171 foo/bar.patch |
|
172 popping foo/bar.patch |
|
173 patch queue now empty |
|
174 % qnew with uncommitted changes |
|
175 uncommitted.patch |
|
176 % qnew implies add |
|
177 A .hgignore |
|
178 A series |
|
179 A uncommitted.patch |
|
180 % qnew missing |
|
181 abort: missing: No such file or directory |
|
182 % qnew -m |
|
183 # HG changeset patch |
|
184 # Parent |
|
185 foo bar |
|
186 |
|
187 % qnew twice |
|
188 abort: patch "first.patch" already exists |
|
189 abort: patch "first.patch" already exists |
|
190 % qnew -f from a subdirectory |
|
191 popping first.patch |
|
192 popping mtest.patch |
|
193 popping uncommitted.patch |
|
194 patch queue now empty |
|
195 adding d/b |
|
196 M d/b |
|
197 # HG changeset patch |
|
198 # Parent |
|
199 diff --git a/d/b b/d/b |
|
200 --- a/d/b |
|
201 +++ b/d/b |
|
202 @@ -1,1 +1,2 @@ |
|
203 b |
|
204 +b |
|
205 % qnew -u with no username configured |
|
206 # HG changeset patch |
|
207 # Parent |
|
208 # User blue |
|
209 % qnew -e -u with no username configured |
|
210 # HG changeset patch |
|
211 # Parent |
|
212 # User chartreuse |
|
213 % fail when trying to import a merge |
|
214 adding a |
|
215 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
216 created new head |
|
217 merging a |
|
218 warning: conflicts during merge. |
|
219 merging a failed! |
|
220 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
221 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
222 abort: cannot manage merge changesets |
|
223 $ rm -r sandbox |