##// END OF EJS Templates
tests: write hgrc of more than two lines by using shell heredoc...
Yuya Nishihara -
r23172:e955549c default
parent child Browse files
Show More
@@ -1,35 +1,37 b''
1 $ cat > abortcommit.py <<EOF
1 $ cat > abortcommit.py <<EOF
2 > from mercurial import util
2 > from mercurial import util
3 > def hook(**args):
3 > def hook(**args):
4 > raise util.Abort("no commits allowed")
4 > raise util.Abort("no commits allowed")
5 > def reposetup(ui, repo):
5 > def reposetup(ui, repo):
6 > repo.ui.setconfig("hooks", "pretxncommit.nocommits", hook)
6 > repo.ui.setconfig("hooks", "pretxncommit.nocommits", hook)
7 > EOF
7 > EOF
8 $ abspath=`pwd`/abortcommit.py
8 $ abspath=`pwd`/abortcommit.py
9
9
10 $ echo "[extensions]" >> $HGRCPATH
10 $ cat <<EOF >> $HGRCPATH
11 $ echo "mq=" >> $HGRCPATH
11 > [extensions]
12 $ echo "abortcommit = $abspath" >> $HGRCPATH
12 > mq =
13 > abortcommit = $abspath
14 > EOF
13
15
14 $ hg init foo
16 $ hg init foo
15 $ cd foo
17 $ cd foo
16 $ echo foo > foo
18 $ echo foo > foo
17 $ hg add foo
19 $ hg add foo
18
20
19 mq may keep a reference to the repository so __del__ will not be
21 mq may keep a reference to the repository so __del__ will not be
20 called and .hg/journal.dirstate will not be deleted:
22 called and .hg/journal.dirstate will not be deleted:
21
23
22 $ hg ci -m foo
24 $ hg ci -m foo
23 error: pretxncommit.nocommits hook failed: no commits allowed
25 error: pretxncommit.nocommits hook failed: no commits allowed
24 transaction abort!
26 transaction abort!
25 rollback completed
27 rollback completed
26 abort: no commits allowed
28 abort: no commits allowed
27 [255]
29 [255]
28 $ hg ci -m foo
30 $ hg ci -m foo
29 error: pretxncommit.nocommits hook failed: no commits allowed
31 error: pretxncommit.nocommits hook failed: no commits allowed
30 transaction abort!
32 transaction abort!
31 rollback completed
33 rollback completed
32 abort: no commits allowed
34 abort: no commits allowed
33 [255]
35 [255]
34
36
35 $ cd ..
37 $ cd ..
@@ -1,15 +1,17 b''
1 $ echo 'raise Exception("bit bucket overflow")' > badext.py
1 $ echo 'raise Exception("bit bucket overflow")' > badext.py
2 $ abspath=`pwd`/badext.py
2 $ abspath=`pwd`/badext.py
3
3
4 $ echo '[extensions]' >> $HGRCPATH
4 $ cat <<EOF >> $HGRCPATH
5 $ echo "gpg =" >> $HGRCPATH
5 > [extensions]
6 $ echo "hgext.gpg =" >> $HGRCPATH
6 > gpg =
7 $ echo "badext = $abspath" >> $HGRCPATH
7 > hgext.gpg =
8 $ echo "badext2 =" >> $HGRCPATH
8 > badext = $abspath
9 > badext2 =
10 > EOF
9
11
10 $ hg -q help help
12 $ hg -q help help
11 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
13 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
12 *** failed to import extension badext2: No module named badext2
14 *** failed to import extension badext2: No module named badext2
13 hg help [-ec] [TOPIC]
15 hg help [-ec] [TOPIC]
14
16
15 show help for a given topic or a help overview
17 show help for a given topic or a help overview
@@ -1,519 +1,523 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo 'root' >root
3 $ echo 'root' >root
4 $ hg add root
4 $ hg add root
5 $ hg commit -d '0 0' -m "Adding root node"
5 $ hg commit -d '0 0' -m "Adding root node"
6
6
7 $ echo 'a' >a
7 $ echo 'a' >a
8 $ hg add a
8 $ hg add a
9 $ hg branch a
9 $ hg branch a
10 marked working directory as branch a
10 marked working directory as branch a
11 (branches are permanent and global, did you want a bookmark?)
11 (branches are permanent and global, did you want a bookmark?)
12 $ hg commit -d '1 0' -m "Adding a branch"
12 $ hg commit -d '1 0' -m "Adding a branch"
13
13
14 $ hg branch q
14 $ hg branch q
15 marked working directory as branch q
15 marked working directory as branch q
16 (branches are permanent and global, did you want a bookmark?)
16 (branches are permanent and global, did you want a bookmark?)
17 $ echo 'aa' >a
17 $ echo 'aa' >a
18 $ hg branch -C
18 $ hg branch -C
19 reset working directory to branch a
19 reset working directory to branch a
20 $ hg commit -d '2 0' -m "Adding to a branch"
20 $ hg commit -d '2 0' -m "Adding to a branch"
21
21
22 $ hg update -C 0
22 $ hg update -C 0
23 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
23 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
24 $ echo 'b' >b
24 $ echo 'b' >b
25 $ hg add b
25 $ hg add b
26 $ hg branch b
26 $ hg branch b
27 marked working directory as branch b
27 marked working directory as branch b
28 (branches are permanent and global, did you want a bookmark?)
28 (branches are permanent and global, did you want a bookmark?)
29 $ hg commit -d '2 0' -m "Adding b branch"
29 $ hg commit -d '2 0' -m "Adding b branch"
30
30
31 $ echo 'bh1' >bh1
31 $ echo 'bh1' >bh1
32 $ hg add bh1
32 $ hg add bh1
33 $ hg commit -d '3 0' -m "Adding b branch head 1"
33 $ hg commit -d '3 0' -m "Adding b branch head 1"
34
34
35 $ hg update -C 2
35 $ hg update -C 2
36 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
36 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
37 $ echo 'bh2' >bh2
37 $ echo 'bh2' >bh2
38 $ hg add bh2
38 $ hg add bh2
39 $ hg commit -d '4 0' -m "Adding b branch head 2"
39 $ hg commit -d '4 0' -m "Adding b branch head 2"
40
40
41 $ echo 'c' >c
41 $ echo 'c' >c
42 $ hg add c
42 $ hg add c
43 $ hg branch c
43 $ hg branch c
44 marked working directory as branch c
44 marked working directory as branch c
45 (branches are permanent and global, did you want a bookmark?)
45 (branches are permanent and global, did you want a bookmark?)
46 $ hg commit -d '5 0' -m "Adding c branch"
46 $ hg commit -d '5 0' -m "Adding c branch"
47
47
48 reserved names
48 reserved names
49
49
50 $ hg branch tip
50 $ hg branch tip
51 abort: the name 'tip' is reserved
51 abort: the name 'tip' is reserved
52 [255]
52 [255]
53 $ hg branch null
53 $ hg branch null
54 abort: the name 'null' is reserved
54 abort: the name 'null' is reserved
55 [255]
55 [255]
56 $ hg branch .
56 $ hg branch .
57 abort: the name '.' is reserved
57 abort: the name '.' is reserved
58 [255]
58 [255]
59
59
60 invalid characters
60 invalid characters
61
61
62 $ hg branch 'foo:bar'
62 $ hg branch 'foo:bar'
63 abort: ':' cannot be used in a name
63 abort: ':' cannot be used in a name
64 [255]
64 [255]
65
65
66 $ hg branch 'foo
66 $ hg branch 'foo
67 > bar'
67 > bar'
68 abort: '\n' cannot be used in a name
68 abort: '\n' cannot be used in a name
69 [255]
69 [255]
70
70
71 trailing or leading spaces should be stripped before testing duplicates
71 trailing or leading spaces should be stripped before testing duplicates
72
72
73 $ hg branch 'b '
73 $ hg branch 'b '
74 abort: a branch of the same name already exists
74 abort: a branch of the same name already exists
75 (use 'hg update' to switch to it)
75 (use 'hg update' to switch to it)
76 [255]
76 [255]
77
77
78 $ hg branch ' b'
78 $ hg branch ' b'
79 abort: a branch of the same name already exists
79 abort: a branch of the same name already exists
80 (use 'hg update' to switch to it)
80 (use 'hg update' to switch to it)
81 [255]
81 [255]
82
82
83 verify update will accept invalid legacy branch names
83 verify update will accept invalid legacy branch names
84
84
85 $ hg init test-invalid-branch-name
85 $ hg init test-invalid-branch-name
86 $ cd test-invalid-branch-name
86 $ cd test-invalid-branch-name
87 $ hg pull -u "$TESTDIR"/bundles/test-invalid-branch-name.hg
87 $ hg pull -u "$TESTDIR"/bundles/test-invalid-branch-name.hg
88 pulling from *test-invalid-branch-name.hg (glob)
88 pulling from *test-invalid-branch-name.hg (glob)
89 requesting all changes
89 requesting all changes
90 adding changesets
90 adding changesets
91 adding manifests
91 adding manifests
92 adding file changes
92 adding file changes
93 added 3 changesets with 3 changes to 2 files
93 added 3 changesets with 3 changes to 2 files
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
95
95
96 $ hg update '"colon:test"'
96 $ hg update '"colon:test"'
97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 $ cd ..
98 $ cd ..
99
99
100 $ echo 'd' >d
100 $ echo 'd' >d
101 $ hg add d
101 $ hg add d
102 $ hg branch 'a branch name much longer than the default justification used by branches'
102 $ hg branch 'a branch name much longer than the default justification used by branches'
103 marked working directory as branch a branch name much longer than the default justification used by branches
103 marked working directory as branch a branch name much longer than the default justification used by branches
104 (branches are permanent and global, did you want a bookmark?)
104 (branches are permanent and global, did you want a bookmark?)
105 $ hg commit -d '6 0' -m "Adding d branch"
105 $ hg commit -d '6 0' -m "Adding d branch"
106
106
107 $ hg branches
107 $ hg branches
108 a branch name much longer than the default justification used by branches 7:10ff5895aa57
108 a branch name much longer than the default justification used by branches 7:10ff5895aa57
109 b 4:aee39cd168d0
109 b 4:aee39cd168d0
110 c 6:589736a22561 (inactive)
110 c 6:589736a22561 (inactive)
111 a 5:d8cbc61dbaa6 (inactive)
111 a 5:d8cbc61dbaa6 (inactive)
112 default 0:19709c5a4e75 (inactive)
112 default 0:19709c5a4e75 (inactive)
113
113
114 -------
114 -------
115
115
116 $ hg branches -a
116 $ hg branches -a
117 a branch name much longer than the default justification used by branches 7:10ff5895aa57
117 a branch name much longer than the default justification used by branches 7:10ff5895aa57
118 b 4:aee39cd168d0
118 b 4:aee39cd168d0
119
119
120 --- Branch a
120 --- Branch a
121
121
122 $ hg log -b a
122 $ hg log -b a
123 changeset: 5:d8cbc61dbaa6
123 changeset: 5:d8cbc61dbaa6
124 branch: a
124 branch: a
125 parent: 2:881fe2b92ad0
125 parent: 2:881fe2b92ad0
126 user: test
126 user: test
127 date: Thu Jan 01 00:00:04 1970 +0000
127 date: Thu Jan 01 00:00:04 1970 +0000
128 summary: Adding b branch head 2
128 summary: Adding b branch head 2
129
129
130 changeset: 2:881fe2b92ad0
130 changeset: 2:881fe2b92ad0
131 branch: a
131 branch: a
132 user: test
132 user: test
133 date: Thu Jan 01 00:00:02 1970 +0000
133 date: Thu Jan 01 00:00:02 1970 +0000
134 summary: Adding to a branch
134 summary: Adding to a branch
135
135
136 changeset: 1:dd6b440dd85a
136 changeset: 1:dd6b440dd85a
137 branch: a
137 branch: a
138 user: test
138 user: test
139 date: Thu Jan 01 00:00:01 1970 +0000
139 date: Thu Jan 01 00:00:01 1970 +0000
140 summary: Adding a branch
140 summary: Adding a branch
141
141
142
142
143 ---- Branch b
143 ---- Branch b
144
144
145 $ hg log -b b
145 $ hg log -b b
146 changeset: 4:aee39cd168d0
146 changeset: 4:aee39cd168d0
147 branch: b
147 branch: b
148 user: test
148 user: test
149 date: Thu Jan 01 00:00:03 1970 +0000
149 date: Thu Jan 01 00:00:03 1970 +0000
150 summary: Adding b branch head 1
150 summary: Adding b branch head 1
151
151
152 changeset: 3:ac22033332d1
152 changeset: 3:ac22033332d1
153 branch: b
153 branch: b
154 parent: 0:19709c5a4e75
154 parent: 0:19709c5a4e75
155 user: test
155 user: test
156 date: Thu Jan 01 00:00:02 1970 +0000
156 date: Thu Jan 01 00:00:02 1970 +0000
157 summary: Adding b branch
157 summary: Adding b branch
158
158
159
159
160 ---- going to test branch closing
160 ---- going to test branch closing
161
161
162 $ hg branches
162 $ hg branches
163 a branch name much longer than the default justification used by branches 7:10ff5895aa57
163 a branch name much longer than the default justification used by branches 7:10ff5895aa57
164 b 4:aee39cd168d0
164 b 4:aee39cd168d0
165 c 6:589736a22561 (inactive)
165 c 6:589736a22561 (inactive)
166 a 5:d8cbc61dbaa6 (inactive)
166 a 5:d8cbc61dbaa6 (inactive)
167 default 0:19709c5a4e75 (inactive)
167 default 0:19709c5a4e75 (inactive)
168 $ hg up -C b
168 $ hg up -C b
169 2 files updated, 0 files merged, 4 files removed, 0 files unresolved
169 2 files updated, 0 files merged, 4 files removed, 0 files unresolved
170 $ echo 'xxx1' >> b
170 $ echo 'xxx1' >> b
171 $ hg commit -d '7 0' -m 'adding cset to branch b'
171 $ hg commit -d '7 0' -m 'adding cset to branch b'
172 $ hg up -C aee39cd168d0
172 $ hg up -C aee39cd168d0
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 $ echo 'xxx2' >> b
174 $ echo 'xxx2' >> b
175 $ hg commit -d '8 0' -m 'adding head to branch b'
175 $ hg commit -d '8 0' -m 'adding head to branch b'
176 created new head
176 created new head
177 $ echo 'xxx3' >> b
177 $ echo 'xxx3' >> b
178 $ hg commit -d '9 0' -m 'adding another cset to branch b'
178 $ hg commit -d '9 0' -m 'adding another cset to branch b'
179 $ hg branches
179 $ hg branches
180 b 10:bfbe841b666e
180 b 10:bfbe841b666e
181 a branch name much longer than the default justification used by branches 7:10ff5895aa57
181 a branch name much longer than the default justification used by branches 7:10ff5895aa57
182 c 6:589736a22561 (inactive)
182 c 6:589736a22561 (inactive)
183 a 5:d8cbc61dbaa6 (inactive)
183 a 5:d8cbc61dbaa6 (inactive)
184 default 0:19709c5a4e75 (inactive)
184 default 0:19709c5a4e75 (inactive)
185 $ hg heads --closed
185 $ hg heads --closed
186 changeset: 10:bfbe841b666e
186 changeset: 10:bfbe841b666e
187 branch: b
187 branch: b
188 tag: tip
188 tag: tip
189 user: test
189 user: test
190 date: Thu Jan 01 00:00:09 1970 +0000
190 date: Thu Jan 01 00:00:09 1970 +0000
191 summary: adding another cset to branch b
191 summary: adding another cset to branch b
192
192
193 changeset: 8:eebb944467c9
193 changeset: 8:eebb944467c9
194 branch: b
194 branch: b
195 parent: 4:aee39cd168d0
195 parent: 4:aee39cd168d0
196 user: test
196 user: test
197 date: Thu Jan 01 00:00:07 1970 +0000
197 date: Thu Jan 01 00:00:07 1970 +0000
198 summary: adding cset to branch b
198 summary: adding cset to branch b
199
199
200 changeset: 7:10ff5895aa57
200 changeset: 7:10ff5895aa57
201 branch: a branch name much longer than the default justification used by branches
201 branch: a branch name much longer than the default justification used by branches
202 user: test
202 user: test
203 date: Thu Jan 01 00:00:06 1970 +0000
203 date: Thu Jan 01 00:00:06 1970 +0000
204 summary: Adding d branch
204 summary: Adding d branch
205
205
206 changeset: 6:589736a22561
206 changeset: 6:589736a22561
207 branch: c
207 branch: c
208 user: test
208 user: test
209 date: Thu Jan 01 00:00:05 1970 +0000
209 date: Thu Jan 01 00:00:05 1970 +0000
210 summary: Adding c branch
210 summary: Adding c branch
211
211
212 changeset: 5:d8cbc61dbaa6
212 changeset: 5:d8cbc61dbaa6
213 branch: a
213 branch: a
214 parent: 2:881fe2b92ad0
214 parent: 2:881fe2b92ad0
215 user: test
215 user: test
216 date: Thu Jan 01 00:00:04 1970 +0000
216 date: Thu Jan 01 00:00:04 1970 +0000
217 summary: Adding b branch head 2
217 summary: Adding b branch head 2
218
218
219 changeset: 0:19709c5a4e75
219 changeset: 0:19709c5a4e75
220 user: test
220 user: test
221 date: Thu Jan 01 00:00:00 1970 +0000
221 date: Thu Jan 01 00:00:00 1970 +0000
222 summary: Adding root node
222 summary: Adding root node
223
223
224 $ hg heads
224 $ hg heads
225 changeset: 10:bfbe841b666e
225 changeset: 10:bfbe841b666e
226 branch: b
226 branch: b
227 tag: tip
227 tag: tip
228 user: test
228 user: test
229 date: Thu Jan 01 00:00:09 1970 +0000
229 date: Thu Jan 01 00:00:09 1970 +0000
230 summary: adding another cset to branch b
230 summary: adding another cset to branch b
231
231
232 changeset: 8:eebb944467c9
232 changeset: 8:eebb944467c9
233 branch: b
233 branch: b
234 parent: 4:aee39cd168d0
234 parent: 4:aee39cd168d0
235 user: test
235 user: test
236 date: Thu Jan 01 00:00:07 1970 +0000
236 date: Thu Jan 01 00:00:07 1970 +0000
237 summary: adding cset to branch b
237 summary: adding cset to branch b
238
238
239 changeset: 7:10ff5895aa57
239 changeset: 7:10ff5895aa57
240 branch: a branch name much longer than the default justification used by branches
240 branch: a branch name much longer than the default justification used by branches
241 user: test
241 user: test
242 date: Thu Jan 01 00:00:06 1970 +0000
242 date: Thu Jan 01 00:00:06 1970 +0000
243 summary: Adding d branch
243 summary: Adding d branch
244
244
245 changeset: 6:589736a22561
245 changeset: 6:589736a22561
246 branch: c
246 branch: c
247 user: test
247 user: test
248 date: Thu Jan 01 00:00:05 1970 +0000
248 date: Thu Jan 01 00:00:05 1970 +0000
249 summary: Adding c branch
249 summary: Adding c branch
250
250
251 changeset: 5:d8cbc61dbaa6
251 changeset: 5:d8cbc61dbaa6
252 branch: a
252 branch: a
253 parent: 2:881fe2b92ad0
253 parent: 2:881fe2b92ad0
254 user: test
254 user: test
255 date: Thu Jan 01 00:00:04 1970 +0000
255 date: Thu Jan 01 00:00:04 1970 +0000
256 summary: Adding b branch head 2
256 summary: Adding b branch head 2
257
257
258 changeset: 0:19709c5a4e75
258 changeset: 0:19709c5a4e75
259 user: test
259 user: test
260 date: Thu Jan 01 00:00:00 1970 +0000
260 date: Thu Jan 01 00:00:00 1970 +0000
261 summary: Adding root node
261 summary: Adding root node
262
262
263 $ hg commit -d '9 0' --close-branch -m 'prune bad branch'
263 $ hg commit -d '9 0' --close-branch -m 'prune bad branch'
264 $ hg branches -a
264 $ hg branches -a
265 b 8:eebb944467c9
265 b 8:eebb944467c9
266 a branch name much longer than the default justification used by branches 7:10ff5895aa57
266 a branch name much longer than the default justification used by branches 7:10ff5895aa57
267 $ hg up -C b
267 $ hg up -C b
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
269 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
270 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
270 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
271 abort: can only close branch heads
271 abort: can only close branch heads
272 [255]
272 [255]
273
273
274 $ hg log -r tip --debug
274 $ hg log -r tip --debug
275 changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f
275 changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f
276 branch: b
276 branch: b
277 tag: tip
277 tag: tip
278 phase: draft
278 phase: draft
279 parent: 8:eebb944467c9fb9651ed232aeaf31b3c0a7fc6c1
279 parent: 8:eebb944467c9fb9651ed232aeaf31b3c0a7fc6c1
280 parent: -1:0000000000000000000000000000000000000000
280 parent: -1:0000000000000000000000000000000000000000
281 manifest: 8:6f9ed32d2b310e391a4f107d5f0f071df785bfee
281 manifest: 8:6f9ed32d2b310e391a4f107d5f0f071df785bfee
282 user: test
282 user: test
283 date: Thu Jan 01 00:00:09 1970 +0000
283 date: Thu Jan 01 00:00:09 1970 +0000
284 extra: branch=b
284 extra: branch=b
285 extra: close=1
285 extra: close=1
286 description:
286 description:
287 close this part branch too
287 close this part branch too
288
288
289
289
290 --- b branch should be inactive
290 --- b branch should be inactive
291
291
292 $ hg branches
292 $ hg branches
293 a branch name much longer than the default justification used by branches 7:10ff5895aa57
293 a branch name much longer than the default justification used by branches 7:10ff5895aa57
294 c 6:589736a22561 (inactive)
294 c 6:589736a22561 (inactive)
295 a 5:d8cbc61dbaa6 (inactive)
295 a 5:d8cbc61dbaa6 (inactive)
296 default 0:19709c5a4e75 (inactive)
296 default 0:19709c5a4e75 (inactive)
297 $ hg branches -c
297 $ hg branches -c
298 a branch name much longer than the default justification used by branches 7:10ff5895aa57
298 a branch name much longer than the default justification used by branches 7:10ff5895aa57
299 b 12:e3d49c0575d8 (closed)
299 b 12:e3d49c0575d8 (closed)
300 c 6:589736a22561 (inactive)
300 c 6:589736a22561 (inactive)
301 a 5:d8cbc61dbaa6 (inactive)
301 a 5:d8cbc61dbaa6 (inactive)
302 default 0:19709c5a4e75 (inactive)
302 default 0:19709c5a4e75 (inactive)
303 $ hg branches -a
303 $ hg branches -a
304 a branch name much longer than the default justification used by branches 7:10ff5895aa57
304 a branch name much longer than the default justification used by branches 7:10ff5895aa57
305 $ hg branches -q
305 $ hg branches -q
306 a branch name much longer than the default justification used by branches
306 a branch name much longer than the default justification used by branches
307 c
307 c
308 a
308 a
309 default
309 default
310 $ hg heads b
310 $ hg heads b
311 no open branch heads found on branches b
311 no open branch heads found on branches b
312 [1]
312 [1]
313 $ hg heads --closed b
313 $ hg heads --closed b
314 changeset: 12:e3d49c0575d8
314 changeset: 12:e3d49c0575d8
315 branch: b
315 branch: b
316 tag: tip
316 tag: tip
317 parent: 8:eebb944467c9
317 parent: 8:eebb944467c9
318 user: test
318 user: test
319 date: Thu Jan 01 00:00:09 1970 +0000
319 date: Thu Jan 01 00:00:09 1970 +0000
320 summary: close this part branch too
320 summary: close this part branch too
321
321
322 changeset: 11:d3f163457ebf
322 changeset: 11:d3f163457ebf
323 branch: b
323 branch: b
324 user: test
324 user: test
325 date: Thu Jan 01 00:00:09 1970 +0000
325 date: Thu Jan 01 00:00:09 1970 +0000
326 summary: prune bad branch
326 summary: prune bad branch
327
327
328 $ echo 'xxx4' >> b
328 $ echo 'xxx4' >> b
329 $ hg commit -d '9 0' -m 'reopen branch with a change'
329 $ hg commit -d '9 0' -m 'reopen branch with a change'
330 reopening closed branch head 12
330 reopening closed branch head 12
331
331
332 --- branch b is back in action
332 --- branch b is back in action
333
333
334 $ hg branches -a
334 $ hg branches -a
335 b 13:e23b5505d1ad
335 b 13:e23b5505d1ad
336 a branch name much longer than the default justification used by branches 7:10ff5895aa57
336 a branch name much longer than the default justification used by branches 7:10ff5895aa57
337
337
338 ---- test heads listings
338 ---- test heads listings
339
339
340 $ hg heads
340 $ hg heads
341 changeset: 13:e23b5505d1ad
341 changeset: 13:e23b5505d1ad
342 branch: b
342 branch: b
343 tag: tip
343 tag: tip
344 user: test
344 user: test
345 date: Thu Jan 01 00:00:09 1970 +0000
345 date: Thu Jan 01 00:00:09 1970 +0000
346 summary: reopen branch with a change
346 summary: reopen branch with a change
347
347
348 changeset: 7:10ff5895aa57
348 changeset: 7:10ff5895aa57
349 branch: a branch name much longer than the default justification used by branches
349 branch: a branch name much longer than the default justification used by branches
350 user: test
350 user: test
351 date: Thu Jan 01 00:00:06 1970 +0000
351 date: Thu Jan 01 00:00:06 1970 +0000
352 summary: Adding d branch
352 summary: Adding d branch
353
353
354 changeset: 6:589736a22561
354 changeset: 6:589736a22561
355 branch: c
355 branch: c
356 user: test
356 user: test
357 date: Thu Jan 01 00:00:05 1970 +0000
357 date: Thu Jan 01 00:00:05 1970 +0000
358 summary: Adding c branch
358 summary: Adding c branch
359
359
360 changeset: 5:d8cbc61dbaa6
360 changeset: 5:d8cbc61dbaa6
361 branch: a
361 branch: a
362 parent: 2:881fe2b92ad0
362 parent: 2:881fe2b92ad0
363 user: test
363 user: test
364 date: Thu Jan 01 00:00:04 1970 +0000
364 date: Thu Jan 01 00:00:04 1970 +0000
365 summary: Adding b branch head 2
365 summary: Adding b branch head 2
366
366
367 changeset: 0:19709c5a4e75
367 changeset: 0:19709c5a4e75
368 user: test
368 user: test
369 date: Thu Jan 01 00:00:00 1970 +0000
369 date: Thu Jan 01 00:00:00 1970 +0000
370 summary: Adding root node
370 summary: Adding root node
371
371
372
372
373 branch default
373 branch default
374
374
375 $ hg heads default
375 $ hg heads default
376 changeset: 0:19709c5a4e75
376 changeset: 0:19709c5a4e75
377 user: test
377 user: test
378 date: Thu Jan 01 00:00:00 1970 +0000
378 date: Thu Jan 01 00:00:00 1970 +0000
379 summary: Adding root node
379 summary: Adding root node
380
380
381
381
382 branch a
382 branch a
383
383
384 $ hg heads a
384 $ hg heads a
385 changeset: 5:d8cbc61dbaa6
385 changeset: 5:d8cbc61dbaa6
386 branch: a
386 branch: a
387 parent: 2:881fe2b92ad0
387 parent: 2:881fe2b92ad0
388 user: test
388 user: test
389 date: Thu Jan 01 00:00:04 1970 +0000
389 date: Thu Jan 01 00:00:04 1970 +0000
390 summary: Adding b branch head 2
390 summary: Adding b branch head 2
391
391
392 $ hg heads --active a
392 $ hg heads --active a
393 no open branch heads found on branches a
393 no open branch heads found on branches a
394 [1]
394 [1]
395
395
396 branch b
396 branch b
397
397
398 $ hg heads b
398 $ hg heads b
399 changeset: 13:e23b5505d1ad
399 changeset: 13:e23b5505d1ad
400 branch: b
400 branch: b
401 tag: tip
401 tag: tip
402 user: test
402 user: test
403 date: Thu Jan 01 00:00:09 1970 +0000
403 date: Thu Jan 01 00:00:09 1970 +0000
404 summary: reopen branch with a change
404 summary: reopen branch with a change
405
405
406 $ hg heads --closed b
406 $ hg heads --closed b
407 changeset: 13:e23b5505d1ad
407 changeset: 13:e23b5505d1ad
408 branch: b
408 branch: b
409 tag: tip
409 tag: tip
410 user: test
410 user: test
411 date: Thu Jan 01 00:00:09 1970 +0000
411 date: Thu Jan 01 00:00:09 1970 +0000
412 summary: reopen branch with a change
412 summary: reopen branch with a change
413
413
414 changeset: 11:d3f163457ebf
414 changeset: 11:d3f163457ebf
415 branch: b
415 branch: b
416 user: test
416 user: test
417 date: Thu Jan 01 00:00:09 1970 +0000
417 date: Thu Jan 01 00:00:09 1970 +0000
418 summary: prune bad branch
418 summary: prune bad branch
419
419
420 default branch colors:
420 default branch colors:
421
421
422 $ echo "[extensions]" >> $HGRCPATH
422 $ cat <<EOF >> $HGRCPATH
423 $ echo "color =" >> $HGRCPATH
423 > [extensions]
424 $ echo "[color]" >> $HGRCPATH
424 > color =
425 $ echo "mode = ansi" >> $HGRCPATH
425 > [color]
426 > mode = ansi
427 > EOF
426
428
427 $ hg up -C c
429 $ hg up -C c
428 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
430 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
429 $ hg commit -d '9 0' --close-branch -m 'reclosing this branch'
431 $ hg commit -d '9 0' --close-branch -m 'reclosing this branch'
430 $ hg up -C b
432 $ hg up -C b
431 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
433 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
432 $ hg branches --color=always
434 $ hg branches --color=always
433 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
435 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
434 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
436 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
435 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
437 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
436 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
438 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
437
439
438 default closed branch color:
440 default closed branch color:
439
441
440 $ hg branches --color=always --closed
442 $ hg branches --color=always --closed
441 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
443 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
442 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
444 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
443 \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc)
445 \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc)
444 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
446 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
445 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
447 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
446
448
447 $ echo "[extensions]" >> $HGRCPATH
449 $ cat <<EOF >> $HGRCPATH
448 $ echo "color =" >> $HGRCPATH
450 > [extensions]
449 $ echo "[color]" >> $HGRCPATH
451 > color =
450 $ echo "branches.active = green" >> $HGRCPATH
452 > [color]
451 $ echo "branches.closed = blue" >> $HGRCPATH
453 > branches.active = green
452 $ echo "branches.current = red" >> $HGRCPATH
454 > branches.closed = blue
453 $ echo "branches.inactive = magenta" >> $HGRCPATH
455 > branches.current = red
454 $ echo "log.changeset = cyan" >> $HGRCPATH
456 > branches.inactive = magenta
457 > log.changeset = cyan
458 > EOF
455
459
456 custom branch colors:
460 custom branch colors:
457
461
458 $ hg branches --color=always
462 $ hg branches --color=always
459 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
463 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
460 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
464 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
461 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
465 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
462 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
466 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
463
467
464 custom closed branch color:
468 custom closed branch color:
465
469
466 $ hg branches --color=always --closed
470 $ hg branches --color=always --closed
467 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
471 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
468 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
472 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
469 \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc)
473 \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc)
470 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
474 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
471 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
475 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
472
476
473 template output:
477 template output:
474
478
475 $ hg branches -Tjson --closed
479 $ hg branches -Tjson --closed
476 [
480 [
477 {
481 {
478 "active": true,
482 "active": true,
479 "branch": "b",
483 "branch": "b",
480 "closed": false,
484 "closed": false,
481 "current": true,
485 "current": true,
482 "node": "e23b5505d1ad24aab6f84fd8c7cb8cd8e5e93be0",
486 "node": "e23b5505d1ad24aab6f84fd8c7cb8cd8e5e93be0",
483 "rev": 13
487 "rev": 13
484 },
488 },
485 {
489 {
486 "active": true,
490 "active": true,
487 "branch": "a branch name much longer than the default justification used by branches",
491 "branch": "a branch name much longer than the default justification used by branches",
488 "closed": false,
492 "closed": false,
489 "current": false,
493 "current": false,
490 "node": "10ff5895aa5793bd378da574af8cec8ea408d831",
494 "node": "10ff5895aa5793bd378da574af8cec8ea408d831",
491 "rev": 7
495 "rev": 7
492 },
496 },
493 {
497 {
494 "active": false,
498 "active": false,
495 "branch": "c",
499 "branch": "c",
496 "closed": true,
500 "closed": true,
497 "current": false,
501 "current": false,
498 "node": "f894c25619d3f1484639d81be950e0a07bc6f1f6",
502 "node": "f894c25619d3f1484639d81be950e0a07bc6f1f6",
499 "rev": 14
503 "rev": 14
500 },
504 },
501 {
505 {
502 "active": false,
506 "active": false,
503 "branch": "a",
507 "branch": "a",
504 "closed": false,
508 "closed": false,
505 "current": false,
509 "current": false,
506 "node": "d8cbc61dbaa6dc817175d1e301eecb863f280832",
510 "node": "d8cbc61dbaa6dc817175d1e301eecb863f280832",
507 "rev": 5
511 "rev": 5
508 },
512 },
509 {
513 {
510 "active": false,
514 "active": false,
511 "branch": "default",
515 "branch": "default",
512 "closed": false,
516 "closed": false,
513 "current": false,
517 "current": false,
514 "node": "19709c5a4e75bf938f8e349aff97438539bb729e",
518 "node": "19709c5a4e75bf938f8e349aff97438539bb729e",
515 "rev": 0
519 "rev": 0
516 }
520 }
517 ]
521 ]
518
522
519 $ cd ..
523 $ cd ..
@@ -1,90 +1,92 b''
1 hide outer repo
1 hide outer repo
2 $ hg init
2 $ hg init
3
3
4 Invalid syntax: no value
4 Invalid syntax: no value
5
5
6 $ cat > .hg/hgrc << EOF
6 $ cat > .hg/hgrc << EOF
7 > novaluekey
7 > novaluekey
8 > EOF
8 > EOF
9 $ hg showconfig
9 $ hg showconfig
10 hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey
10 hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey
11 [255]
11 [255]
12
12
13 Invalid syntax: no key
13 Invalid syntax: no key
14
14
15 $ cat > .hg/hgrc << EOF
15 $ cat > .hg/hgrc << EOF
16 > =nokeyvalue
16 > =nokeyvalue
17 > EOF
17 > EOF
18 $ hg showconfig
18 $ hg showconfig
19 hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue
19 hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue
20 [255]
20 [255]
21
21
22 Test hint about invalid syntax from leading white space
22 Test hint about invalid syntax from leading white space
23
23
24 $ cat > .hg/hgrc << EOF
24 $ cat > .hg/hgrc << EOF
25 > key=value
25 > key=value
26 > EOF
26 > EOF
27 $ hg showconfig
27 $ hg showconfig
28 hg: parse error at $TESTTMP/.hg/hgrc:1: key=value
28 hg: parse error at $TESTTMP/.hg/hgrc:1: key=value
29 unexpected leading whitespace
29 unexpected leading whitespace
30 [255]
30 [255]
31
31
32 $ cat > .hg/hgrc << EOF
32 $ cat > .hg/hgrc << EOF
33 > [section]
33 > [section]
34 > key=value
34 > key=value
35 > EOF
35 > EOF
36 $ hg showconfig
36 $ hg showconfig
37 hg: parse error at $TESTTMP/.hg/hgrc:1: [section]
37 hg: parse error at $TESTTMP/.hg/hgrc:1: [section]
38 unexpected leading whitespace
38 unexpected leading whitespace
39 [255]
39 [255]
40
40
41 Reset hgrc
41 Reset hgrc
42
42
43 $ echo > .hg/hgrc
43 $ echo > .hg/hgrc
44
44
45 Test case sensitive configuration
45 Test case sensitive configuration
46
46
47 $ echo '[Section]' >> $HGRCPATH
47 $ cat <<EOF >> $HGRCPATH
48 $ echo 'KeY = Case Sensitive' >> $HGRCPATH
48 > [Section]
49 $ echo 'key = lower case' >> $HGRCPATH
49 > KeY = Case Sensitive
50 > key = lower case
51 > EOF
50
52
51 $ hg showconfig Section
53 $ hg showconfig Section
52 Section.KeY=Case Sensitive
54 Section.KeY=Case Sensitive
53 Section.key=lower case
55 Section.key=lower case
54
56
55 Test "%unset"
57 Test "%unset"
56
58
57 $ cat >> $HGRCPATH <<EOF
59 $ cat >> $HGRCPATH <<EOF
58 > [unsettest]
60 > [unsettest]
59 > local-hgrcpath = should be unset (HGRCPATH)
61 > local-hgrcpath = should be unset (HGRCPATH)
60 > %unset local-hgrcpath
62 > %unset local-hgrcpath
61 >
63 >
62 > global = should be unset (HGRCPATH)
64 > global = should be unset (HGRCPATH)
63 >
65 >
64 > both = should be unset (HGRCPATH)
66 > both = should be unset (HGRCPATH)
65 >
67 >
66 > set-after-unset = should be unset (HGRCPATH)
68 > set-after-unset = should be unset (HGRCPATH)
67 > EOF
69 > EOF
68
70
69 $ cat >> .hg/hgrc <<EOF
71 $ cat >> .hg/hgrc <<EOF
70 > [unsettest]
72 > [unsettest]
71 > local-hgrc = should be unset (.hg/hgrc)
73 > local-hgrc = should be unset (.hg/hgrc)
72 > %unset local-hgrc
74 > %unset local-hgrc
73 >
75 >
74 > %unset global
76 > %unset global
75 >
77 >
76 > both = should be unset (.hg/hgrc)
78 > both = should be unset (.hg/hgrc)
77 > %unset both
79 > %unset both
78 >
80 >
79 > set-after-unset = should be unset (.hg/hgrc)
81 > set-after-unset = should be unset (.hg/hgrc)
80 > %unset set-after-unset
82 > %unset set-after-unset
81 > set-after-unset = should be set (.hg/hgrc)
83 > set-after-unset = should be set (.hg/hgrc)
82 > EOF
84 > EOF
83
85
84 $ hg showconfig unsettest
86 $ hg showconfig unsettest
85 unsettest.set-after-unset=should be set (.hg/hgrc)
87 unsettest.set-after-unset=should be set (.hg/hgrc)
86
88
87 Test exit code when no config matches
89 Test exit code when no config matches
88
90
89 $ hg config Section.idontexist
91 $ hg config Section.idontexist
90 [1]
92 [1]
@@ -1,88 +1,90 b''
1
1
2 $ echo "[extensions]" >> $HGRCPATH
2 $ cat <<EOF >> $HGRCPATH
3 $ echo "convert = " >> $HGRCPATH
3 > [extensions]
4 $ echo "[convert]" >> $HGRCPATH
4 > convert =
5 $ echo "hg.tagsbranch=0" >> $HGRCPATH
5 > [convert]
6 > hg.tagsbranch = 0
7 > EOF
6 $ hg init source
8 $ hg init source
7 $ cd source
9 $ cd source
8 $ echo a > a
10 $ echo a > a
9 $ hg ci -qAm adda
11 $ hg ci -qAm adda
10
12
11 Add a merge with one parent in the same branch
13 Add a merge with one parent in the same branch
12
14
13 $ echo a >> a
15 $ echo a >> a
14 $ hg ci -qAm changea
16 $ hg ci -qAm changea
15 $ hg up -qC 0
17 $ hg up -qC 0
16 $ hg branch branch0
18 $ hg branch branch0
17 marked working directory as branch branch0
19 marked working directory as branch branch0
18 (branches are permanent and global, did you want a bookmark?)
20 (branches are permanent and global, did you want a bookmark?)
19 $ echo b > b
21 $ echo b > b
20 $ hg ci -qAm addb
22 $ hg ci -qAm addb
21 $ hg up -qC
23 $ hg up -qC
22 $ hg merge default
24 $ hg merge default
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 (branch merge, don't forget to commit)
26 (branch merge, don't forget to commit)
25 $ hg ci -qm mergeab
27 $ hg ci -qm mergeab
26 $ hg tag -ql mergeab
28 $ hg tag -ql mergeab
27 $ cd ..
29 $ cd ..
28
30
29 Miss perl... sometimes
31 Miss perl... sometimes
30
32
31 $ cat > filter.py <<EOF
33 $ cat > filter.py <<EOF
32 > import sys, re
34 > import sys, re
33 >
35 >
34 > r = re.compile(r'^(?:\d+|pulling from)')
36 > r = re.compile(r'^(?:\d+|pulling from)')
35 > sys.stdout.writelines([l for l in sys.stdin if r.search(l)])
37 > sys.stdout.writelines([l for l in sys.stdin if r.search(l)])
36 > EOF
38 > EOF
37
39
38 convert
40 convert
39
41
40 $ hg convert -v --config convert.hg.clonebranches=1 source dest |
42 $ hg convert -v --config convert.hg.clonebranches=1 source dest |
41 > python filter.py
43 > python filter.py
42 3 adda
44 3 adda
43 2 changea
45 2 changea
44 1 addb
46 1 addb
45 pulling from default into branch0
47 pulling from default into branch0
46 1 changesets found
48 1 changesets found
47 0 mergeab
49 0 mergeab
48 pulling from default into branch0
50 pulling from default into branch0
49 1 changesets found
51 1 changesets found
50
52
51 Add a merge with both parents and child in different branches
53 Add a merge with both parents and child in different branches
52
54
53 $ cd source
55 $ cd source
54 $ hg branch branch1
56 $ hg branch branch1
55 marked working directory as branch branch1
57 marked working directory as branch branch1
56 (branches are permanent and global, did you want a bookmark?)
58 (branches are permanent and global, did you want a bookmark?)
57 $ echo a > file1
59 $ echo a > file1
58 $ hg ci -qAm c1
60 $ hg ci -qAm c1
59 $ hg up -qC mergeab
61 $ hg up -qC mergeab
60 $ hg branch branch2
62 $ hg branch branch2
61 marked working directory as branch branch2
63 marked working directory as branch branch2
62 (branches are permanent and global, did you want a bookmark?)
64 (branches are permanent and global, did you want a bookmark?)
63 $ echo a > file2
65 $ echo a > file2
64 $ hg ci -qAm c2
66 $ hg ci -qAm c2
65 $ hg merge branch1
67 $ hg merge branch1
66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 (branch merge, don't forget to commit)
69 (branch merge, don't forget to commit)
68 $ hg branch branch3
70 $ hg branch branch3
69 marked working directory as branch branch3
71 marked working directory as branch branch3
70 (branches are permanent and global, did you want a bookmark?)
72 (branches are permanent and global, did you want a bookmark?)
71 $ hg ci -qAm c3
73 $ hg ci -qAm c3
72 $ cd ..
74 $ cd ..
73
75
74 incremental conversion
76 incremental conversion
75
77
76 $ hg convert -v --config convert.hg.clonebranches=1 source dest |
78 $ hg convert -v --config convert.hg.clonebranches=1 source dest |
77 > python filter.py
79 > python filter.py
78 2 c1
80 2 c1
79 pulling from branch0 into branch1
81 pulling from branch0 into branch1
80 4 changesets found
82 4 changesets found
81 1 c2
83 1 c2
82 pulling from branch0 into branch2
84 pulling from branch0 into branch2
83 4 changesets found
85 4 changesets found
84 0 c3
86 0 c3
85 pulling from branch1 into branch3
87 pulling from branch1 into branch3
86 5 changesets found
88 5 changesets found
87 pulling from branch2 into branch3
89 pulling from branch2 into branch3
88 1 changesets found
90 1 changesets found
@@ -1,193 +1,195 b''
1 #require cvs
1 #require cvs
2
2
3 This is http://mercurial.selenic.com/bts/issue1148
3 This is http://mercurial.selenic.com/bts/issue1148
4 and http://mercurial.selenic.com/bts/issue1447
4 and http://mercurial.selenic.com/bts/issue1447
5
5
6 $ cvscall()
6 $ cvscall()
7 > {
7 > {
8 > cvs -f "$@" > /dev/null
8 > cvs -f "$@" > /dev/null
9 > }
9 > }
10 $ echo "[extensions]" >> $HGRCPATH
10 $ cat <<EOF >> $HGRCPATH
11 $ echo "convert = " >> $HGRCPATH
11 > [extensions]
12 $ echo "[convert]" >> $HGRCPATH
12 > convert =
13 $ echo "cvsps.cache=0" >> $HGRCPATH
13 > [convert]
14 > cvsps.cache = 0
15 > EOF
14
16
15 create cvs repository
17 create cvs repository
16
18
17 $ mkdir cvsrepo
19 $ mkdir cvsrepo
18 $ cd cvsrepo
20 $ cd cvsrepo
19 $ CVSROOT=`pwd`
21 $ CVSROOT=`pwd`
20 $ export CVSROOT
22 $ export CVSROOT
21 $ CVS_OPTIONS=-f
23 $ CVS_OPTIONS=-f
22 $ export CVS_OPTIONS
24 $ export CVS_OPTIONS
23 $ cd ..
25 $ cd ..
24 $ cvscall -q -d "$CVSROOT" init
26 $ cvscall -q -d "$CVSROOT" init
25
27
26 Create a new project
28 Create a new project
27
29
28 $ mkdir src
30 $ mkdir src
29 $ cd src
31 $ cd src
30 $ echo "1" > a
32 $ echo "1" > a
31 $ echo "1" > b
33 $ echo "1" > b
32 $ cvscall import -m "init" src v0 r0 | sort
34 $ cvscall import -m "init" src v0 r0 | sort
33 $ cd ..
35 $ cd ..
34 $ cvscall co src
36 $ cvscall co src
35 cvs checkout: Updating src
37 cvs checkout: Updating src
36 $ cd src
38 $ cd src
37
39
38 Branch the project
40 Branch the project
39
41
40 $ cvscall tag -b BRANCH
42 $ cvscall tag -b BRANCH
41 cvs tag: Tagging .
43 cvs tag: Tagging .
42 $ cvscall up -r BRANCH > /dev/null
44 $ cvscall up -r BRANCH > /dev/null
43 cvs update: Updating .
45 cvs update: Updating .
44
46
45 Modify file a, then b, then a
47 Modify file a, then b, then a
46
48
47 $ sleep 1
49 $ sleep 1
48 $ echo "2" > a
50 $ echo "2" > a
49 $ cvscall ci -m "mod a"
51 $ cvscall ci -m "mod a"
50 cvs commit: Examining .
52 cvs commit: Examining .
51 $ echo "2" > b
53 $ echo "2" > b
52 $ cvscall ci -m "mod b"
54 $ cvscall ci -m "mod b"
53 cvs commit: Examining .
55 cvs commit: Examining .
54 $ sleep 1
56 $ sleep 1
55 $ echo "3" > a
57 $ echo "3" > a
56 $ cvscall ci -m "mod a again"
58 $ cvscall ci -m "mod a again"
57 cvs commit: Examining .
59 cvs commit: Examining .
58
60
59 Convert
61 Convert
60
62
61 $ cd ..
63 $ cd ..
62 $ hg convert src
64 $ hg convert src
63 assuming destination src-hg
65 assuming destination src-hg
64 initializing destination src-hg repository
66 initializing destination src-hg repository
65 connecting to $TESTTMP/cvsrepo
67 connecting to $TESTTMP/cvsrepo
66 scanning source...
68 scanning source...
67 collecting CVS rlog
69 collecting CVS rlog
68 7 log entries
70 7 log entries
69 creating changesets
71 creating changesets
70 5 changeset entries
72 5 changeset entries
71 sorting...
73 sorting...
72 converting...
74 converting...
73 4 Initial revision
75 4 Initial revision
74 3 init
76 3 init
75 2 mod a
77 2 mod a
76 1 mod b
78 1 mod b
77 0 mod a again
79 0 mod a again
78 updating tags
80 updating tags
79
81
80 Check the result
82 Check the result
81
83
82 $ hg -R src-hg log -G --template '{rev} ({branches}) {desc} files: {files}\n'
84 $ hg -R src-hg log -G --template '{rev} ({branches}) {desc} files: {files}\n'
83 o 5 () update tags files: .hgtags
85 o 5 () update tags files: .hgtags
84 |
86 |
85 | o 4 (BRANCH) mod a again files: a
87 | o 4 (BRANCH) mod a again files: a
86 | |
88 | |
87 | o 3 (BRANCH) mod b files: b
89 | o 3 (BRANCH) mod b files: b
88 | |
90 | |
89 | o 2 (BRANCH) mod a files: a
91 | o 2 (BRANCH) mod a files: a
90 | |
92 | |
91 | o 1 (v0) init files:
93 | o 1 (v0) init files:
92 |/
94 |/
93 o 0 () Initial revision files: a b
95 o 0 () Initial revision files: a b
94
96
95
97
96
98
97 issue 1447
99 issue 1447
98
100
99 $ cvscall()
101 $ cvscall()
100 > {
102 > {
101 > cvs -f "$@" > /dev/null
103 > cvs -f "$@" > /dev/null
102 > sleep 1
104 > sleep 1
103 > }
105 > }
104 $ cvsci()
106 $ cvsci()
105 > {
107 > {
106 > cvs -f ci "$@" >/dev/null
108 > cvs -f ci "$@" >/dev/null
107 > sleep 1
109 > sleep 1
108 > }
110 > }
109 $ cvscall -Q -d `pwd`/cvsmaster2 init
111 $ cvscall -Q -d `pwd`/cvsmaster2 init
110 $ cd cvsmaster2
112 $ cd cvsmaster2
111 $ CVSROOT=`pwd`
113 $ CVSROOT=`pwd`
112 $ export CVSROOT
114 $ export CVSROOT
113 $ mkdir foo
115 $ mkdir foo
114 $ cd ..
116 $ cd ..
115 $ cvscall -Q co -d cvswork2 foo
117 $ cvscall -Q co -d cvswork2 foo
116 $ cd cvswork2
118 $ cd cvswork2
117 $ echo foo > a.txt
119 $ echo foo > a.txt
118 $ echo bar > b.txt
120 $ echo bar > b.txt
119 $ cvscall -Q add a.txt b.txt
121 $ cvscall -Q add a.txt b.txt
120 $ cvsci -m "Initial commit"
122 $ cvsci -m "Initial commit"
121 cvs commit: Examining .
123 cvs commit: Examining .
122 $ echo foo > b.txt
124 $ echo foo > b.txt
123 $ cvsci -m "Fix b on HEAD"
125 $ cvsci -m "Fix b on HEAD"
124 cvs commit: Examining .
126 cvs commit: Examining .
125 $ echo bar > a.txt
127 $ echo bar > a.txt
126 $ cvsci -m "Small fix in a on HEAD"
128 $ cvsci -m "Small fix in a on HEAD"
127 cvs commit: Examining .
129 cvs commit: Examining .
128 $ cvscall -Q tag -b BRANCH
130 $ cvscall -Q tag -b BRANCH
129 $ cvscall -Q up -P -rBRANCH
131 $ cvscall -Q up -P -rBRANCH
130 $ echo baz > b.txt
132 $ echo baz > b.txt
131 $ cvsci -m "Change on BRANCH in b"
133 $ cvsci -m "Change on BRANCH in b"
132 cvs commit: Examining .
134 cvs commit: Examining .
133 $ hg debugcvsps -x --parents foo
135 $ hg debugcvsps -x --parents foo
134 collecting CVS rlog
136 collecting CVS rlog
135 5 log entries
137 5 log entries
136 creating changesets
138 creating changesets
137 4 changeset entries
139 4 changeset entries
138 ---------------------
140 ---------------------
139 PatchSet 1
141 PatchSet 1
140 Date: * (glob)
142 Date: * (glob)
141 Author: * (glob)
143 Author: * (glob)
142 Branch: HEAD
144 Branch: HEAD
143 Tag: (none)
145 Tag: (none)
144 Log:
146 Log:
145 Initial commit
147 Initial commit
146
148
147 Members:
149 Members:
148 a.txt:INITIAL->1.1
150 a.txt:INITIAL->1.1
149 b.txt:INITIAL->1.1
151 b.txt:INITIAL->1.1
150
152
151 ---------------------
153 ---------------------
152 PatchSet 2
154 PatchSet 2
153 Date: * (glob)
155 Date: * (glob)
154 Author: * (glob)
156 Author: * (glob)
155 Branch: HEAD
157 Branch: HEAD
156 Tag: (none)
158 Tag: (none)
157 Branchpoints: BRANCH
159 Branchpoints: BRANCH
158 Parent: 1
160 Parent: 1
159 Log:
161 Log:
160 Fix b on HEAD
162 Fix b on HEAD
161
163
162 Members:
164 Members:
163 b.txt:1.1->1.2
165 b.txt:1.1->1.2
164
166
165 ---------------------
167 ---------------------
166 PatchSet 3
168 PatchSet 3
167 Date: * (glob)
169 Date: * (glob)
168 Author: * (glob)
170 Author: * (glob)
169 Branch: HEAD
171 Branch: HEAD
170 Tag: (none)
172 Tag: (none)
171 Branchpoints: BRANCH
173 Branchpoints: BRANCH
172 Parent: 2
174 Parent: 2
173 Log:
175 Log:
174 Small fix in a on HEAD
176 Small fix in a on HEAD
175
177
176 Members:
178 Members:
177 a.txt:1.1->1.2
179 a.txt:1.1->1.2
178
180
179 ---------------------
181 ---------------------
180 PatchSet 4
182 PatchSet 4
181 Date: * (glob)
183 Date: * (glob)
182 Author: * (glob)
184 Author: * (glob)
183 Branch: BRANCH
185 Branch: BRANCH
184 Tag: (none)
186 Tag: (none)
185 Parent: 3
187 Parent: 3
186 Log:
188 Log:
187 Change on BRANCH in b
189 Change on BRANCH in b
188
190
189 Members:
191 Members:
190 b.txt:1.2->1.2.2.1
192 b.txt:1.2->1.2.2.1
191
193
192
194
193 $ cd ..
195 $ cd ..
@@ -1,233 +1,235 b''
1 #require cvs
1 #require cvs
2
2
3 Test config convert.cvsps.mergefrom config setting.
3 Test config convert.cvsps.mergefrom config setting.
4 (Should test similar mergeto feature, but I don't understand it yet.)
4 (Should test similar mergeto feature, but I don't understand it yet.)
5 Requires builtin cvsps.
5 Requires builtin cvsps.
6
6
7 $ CVSROOT=`pwd`/cvsrepo
7 $ CVSROOT=`pwd`/cvsrepo
8 $ export CVSROOT
8 $ export CVSROOT
9
9
10 $ cvscall()
10 $ cvscall()
11 > {
11 > {
12 > cvs -f "$@"
12 > cvs -f "$@"
13 > }
13 > }
14
14
15 output of 'cvs ci' varies unpredictably, so just discard it
15 output of 'cvs ci' varies unpredictably, so just discard it
16 XXX copied from test-convert-cvs-synthetic
16 XXX copied from test-convert-cvs-synthetic
17
17
18 $ cvsci()
18 $ cvsci()
19 > {
19 > {
20 > sleep 1
20 > sleep 1
21 > cvs -f ci "$@" > /dev/null
21 > cvs -f ci "$@" > /dev/null
22 > }
22 > }
23
23
24 XXX copied from test-convert-cvs-synthetic
24 XXX copied from test-convert-cvs-synthetic
25
25
26 $ echo "[extensions]" >> $HGRCPATH
26 $ cat <<EOF >> $HGRCPATH
27 $ echo "convert = " >> $HGRCPATH
27 > [extensions]
28 $ echo "[convert]" >> $HGRCPATH
28 > convert =
29 $ echo "cvsps.cache=0" >> $HGRCPATH
29 > [convert]
30 $ echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH
30 > cvsps.cache = 0
31 > cvsps.mergefrom = \[MERGE from (\S+)\]
32 > EOF
31
33
32 create cvs repository with one project
34 create cvs repository with one project
33
35
34 $ mkdir cvsrepo
36 $ mkdir cvsrepo
35 $ cvscall -q -d "$CVSROOT" init
37 $ cvscall -q -d "$CVSROOT" init
36 $ mkdir cvsrepo/proj
38 $ mkdir cvsrepo/proj
37
39
38 populate cvs repository
40 populate cvs repository
39
41
40 $ cvscall -Q co proj
42 $ cvscall -Q co proj
41 $ cd proj
43 $ cd proj
42 $ touch file1
44 $ touch file1
43 $ cvscall -Q add file1
45 $ cvscall -Q add file1
44 $ cvsci -m"add file1 on trunk"
46 $ cvsci -m"add file1 on trunk"
45 cvs commit: Examining .
47 cvs commit: Examining .
46
48
47 create two release branches
49 create two release branches
48
50
49 $ cvscall -q tag -b v1_0
51 $ cvscall -q tag -b v1_0
50 T file1
52 T file1
51 $ cvscall -q tag -b v1_1
53 $ cvscall -q tag -b v1_1
52 T file1
54 T file1
53
55
54 modify file1 on branch v1_0
56 modify file1 on branch v1_0
55
57
56 $ cvscall -Q update -rv1_0
58 $ cvscall -Q update -rv1_0
57 $ sleep 1
59 $ sleep 1
58 $ echo "change" >> file1
60 $ echo "change" >> file1
59 $ cvsci -m"add text"
61 $ cvsci -m"add text"
60 cvs commit: Examining .
62 cvs commit: Examining .
61
63
62 make unrelated change on v1_1
64 make unrelated change on v1_1
63
65
64 $ cvscall -Q update -rv1_1
66 $ cvscall -Q update -rv1_1
65 $ touch unrelated
67 $ touch unrelated
66 $ cvscall -Q add unrelated
68 $ cvscall -Q add unrelated
67 $ cvsci -m"unrelated change"
69 $ cvsci -m"unrelated change"
68 cvs commit: Examining .
70 cvs commit: Examining .
69
71
70 merge file1 to v1_1
72 merge file1 to v1_1
71
73
72 $ cvscall -Q update -jv1_0
74 $ cvscall -Q update -jv1_0
73 RCS file: $TESTTMP/cvsrepo/proj/file1,v
75 RCS file: $TESTTMP/cvsrepo/proj/file1,v
74 retrieving revision 1.1
76 retrieving revision 1.1
75 retrieving revision 1.1.2.1
77 retrieving revision 1.1.2.1
76 Merging differences between 1.1 and 1.1.2.1 into file1
78 Merging differences between 1.1 and 1.1.2.1 into file1
77 $ cvsci -m"add text [MERGE from v1_0]"
79 $ cvsci -m"add text [MERGE from v1_0]"
78 cvs commit: Examining .
80 cvs commit: Examining .
79
81
80 merge change to trunk
82 merge change to trunk
81
83
82 $ cvscall -Q update -A
84 $ cvscall -Q update -A
83 $ cvscall -Q update -jv1_1
85 $ cvscall -Q update -jv1_1
84 RCS file: $TESTTMP/cvsrepo/proj/file1,v
86 RCS file: $TESTTMP/cvsrepo/proj/file1,v
85 retrieving revision 1.1
87 retrieving revision 1.1
86 retrieving revision 1.1.4.1
88 retrieving revision 1.1.4.1
87 Merging differences between 1.1 and 1.1.4.1 into file1
89 Merging differences between 1.1 and 1.1.4.1 into file1
88 $ cvsci -m"add text [MERGE from v1_1]"
90 $ cvsci -m"add text [MERGE from v1_1]"
89 cvs commit: Examining .
91 cvs commit: Examining .
90
92
91 non-merged change on trunk
93 non-merged change on trunk
92
94
93 $ echo "foo" > file2
95 $ echo "foo" > file2
94 $ cvscall -Q add file2
96 $ cvscall -Q add file2
95 $ cvsci -m"add file2 on trunk" file2
97 $ cvsci -m"add file2 on trunk" file2
96
98
97 this will create rev 1.3
99 this will create rev 1.3
98 change on trunk to backport
100 change on trunk to backport
99
101
100 $ echo "backport me" >> file1
102 $ echo "backport me" >> file1
101 $ cvsci -m"add other text" file1
103 $ cvsci -m"add other text" file1
102 $ cvscall log file1
104 $ cvscall log file1
103
105
104 RCS file: $TESTTMP/cvsrepo/proj/file1,v
106 RCS file: $TESTTMP/cvsrepo/proj/file1,v
105 Working file: file1
107 Working file: file1
106 head: 1.3
108 head: 1.3
107 branch:
109 branch:
108 locks: strict
110 locks: strict
109 access list:
111 access list:
110 symbolic names:
112 symbolic names:
111 v1_1: 1.1.0.4
113 v1_1: 1.1.0.4
112 v1_0: 1.1.0.2
114 v1_0: 1.1.0.2
113 keyword substitution: kv
115 keyword substitution: kv
114 total revisions: 5; selected revisions: 5
116 total revisions: 5; selected revisions: 5
115 description:
117 description:
116 ----------------------------
118 ----------------------------
117 revision 1.3
119 revision 1.3
118 date: * (glob)
120 date: * (glob)
119 add other text
121 add other text
120 ----------------------------
122 ----------------------------
121 revision 1.2
123 revision 1.2
122 date: * (glob)
124 date: * (glob)
123 add text [MERGE from v1_1]
125 add text [MERGE from v1_1]
124 ----------------------------
126 ----------------------------
125 revision 1.1
127 revision 1.1
126 date: * (glob)
128 date: * (glob)
127 branches: 1.1.2; 1.1.4;
129 branches: 1.1.2; 1.1.4;
128 add file1 on trunk
130 add file1 on trunk
129 ----------------------------
131 ----------------------------
130 revision 1.1.4.1
132 revision 1.1.4.1
131 date: * (glob)
133 date: * (glob)
132 add text [MERGE from v1_0]
134 add text [MERGE from v1_0]
133 ----------------------------
135 ----------------------------
134 revision 1.1.2.1
136 revision 1.1.2.1
135 date: * (glob)
137 date: * (glob)
136 add text
138 add text
137 =============================================================================
139 =============================================================================
138
140
139 XXX how many ways are there to spell "trunk" with CVS?
141 XXX how many ways are there to spell "trunk" with CVS?
140 backport trunk change to v1_1
142 backport trunk change to v1_1
141
143
142 $ cvscall -Q update -rv1_1
144 $ cvscall -Q update -rv1_1
143 $ cvscall -Q update -j1.2 -j1.3 file1
145 $ cvscall -Q update -j1.2 -j1.3 file1
144 RCS file: $TESTTMP/cvsrepo/proj/file1,v
146 RCS file: $TESTTMP/cvsrepo/proj/file1,v
145 retrieving revision 1.2
147 retrieving revision 1.2
146 retrieving revision 1.3
148 retrieving revision 1.3
147 Merging differences between 1.2 and 1.3 into file1
149 Merging differences between 1.2 and 1.3 into file1
148 $ cvsci -m"add other text [MERGE from HEAD]" file1
150 $ cvsci -m"add other text [MERGE from HEAD]" file1
149
151
150 fix bug on v1_1, merge to trunk with error
152 fix bug on v1_1, merge to trunk with error
151
153
152 $ cvscall -Q update -rv1_1
154 $ cvscall -Q update -rv1_1
153 $ echo "merge forward" >> file1
155 $ echo "merge forward" >> file1
154 $ cvscall -Q tag unmerged
156 $ cvscall -Q tag unmerged
155 $ cvsci -m"fix file1"
157 $ cvsci -m"fix file1"
156 cvs commit: Examining .
158 cvs commit: Examining .
157 $ cvscall -Q update -A
159 $ cvscall -Q update -A
158 $ cvscall -Q update -junmerged -jv1_1
160 $ cvscall -Q update -junmerged -jv1_1
159 RCS file: $TESTTMP/cvsrepo/proj/file1,v
161 RCS file: $TESTTMP/cvsrepo/proj/file1,v
160 retrieving revision 1.1.4.2
162 retrieving revision 1.1.4.2
161 retrieving revision 1.1.4.3
163 retrieving revision 1.1.4.3
162 Merging differences between 1.1.4.2 and 1.1.4.3 into file1
164 Merging differences between 1.1.4.2 and 1.1.4.3 into file1
163
165
164 note the typo in the commit log message
166 note the typo in the commit log message
165
167
166 $ cvsci -m"fix file1 [MERGE from v1-1]"
168 $ cvsci -m"fix file1 [MERGE from v1-1]"
167 cvs commit: Examining .
169 cvs commit: Examining .
168 $ cvs -Q tag -d unmerged
170 $ cvs -Q tag -d unmerged
169
171
170 convert to hg
172 convert to hg
171
173
172 $ cd ..
174 $ cd ..
173 $ hg convert proj proj.hg
175 $ hg convert proj proj.hg
174 initializing destination proj.hg repository
176 initializing destination proj.hg repository
175 connecting to $TESTTMP/cvsrepo
177 connecting to $TESTTMP/cvsrepo
176 scanning source...
178 scanning source...
177 collecting CVS rlog
179 collecting CVS rlog
178 12 log entries
180 12 log entries
179 creating changesets
181 creating changesets
180 warning: CVS commit message references non-existent branch 'v1-1':
182 warning: CVS commit message references non-existent branch 'v1-1':
181 fix file1 [MERGE from v1-1]
183 fix file1 [MERGE from v1-1]
182 10 changeset entries
184 10 changeset entries
183 sorting...
185 sorting...
184 converting...
186 converting...
185 9 add file1 on trunk
187 9 add file1 on trunk
186 8 unrelated change
188 8 unrelated change
187 7 add text
189 7 add text
188 6 add text [MERGE from v1_0]
190 6 add text [MERGE from v1_0]
189 5 add text [MERGE from v1_1]
191 5 add text [MERGE from v1_1]
190 4 add file2 on trunk
192 4 add file2 on trunk
191 3 add other text
193 3 add other text
192 2 add other text [MERGE from HEAD]
194 2 add other text [MERGE from HEAD]
193 1 fix file1
195 1 fix file1
194 0 fix file1 [MERGE from v1-1]
196 0 fix file1 [MERGE from v1-1]
195
197
196 complete log
198 complete log
197
199
198 $ template="{rev}: '{branches}' {desc}\n"
200 $ template="{rev}: '{branches}' {desc}\n"
199 $ hg -R proj.hg log --template="$template"
201 $ hg -R proj.hg log --template="$template"
200 9: '' fix file1 [MERGE from v1-1]
202 9: '' fix file1 [MERGE from v1-1]
201 8: 'v1_1' fix file1
203 8: 'v1_1' fix file1
202 7: 'v1_1' add other text [MERGE from HEAD]
204 7: 'v1_1' add other text [MERGE from HEAD]
203 6: '' add other text
205 6: '' add other text
204 5: '' add file2 on trunk
206 5: '' add file2 on trunk
205 4: '' add text [MERGE from v1_1]
207 4: '' add text [MERGE from v1_1]
206 3: 'v1_1' add text [MERGE from v1_0]
208 3: 'v1_1' add text [MERGE from v1_0]
207 2: 'v1_0' add text
209 2: 'v1_0' add text
208 1: 'v1_1' unrelated change
210 1: 'v1_1' unrelated change
209 0: '' add file1 on trunk
211 0: '' add file1 on trunk
210
212
211 graphical log
213 graphical log
212
214
213 $ hg -R proj.hg log -G --template="$template"
215 $ hg -R proj.hg log -G --template="$template"
214 o 9: '' fix file1 [MERGE from v1-1]
216 o 9: '' fix file1 [MERGE from v1-1]
215 |
217 |
216 | o 8: 'v1_1' fix file1
218 | o 8: 'v1_1' fix file1
217 | |
219 | |
218 | o 7: 'v1_1' add other text [MERGE from HEAD]
220 | o 7: 'v1_1' add other text [MERGE from HEAD]
219 |/|
221 |/|
220 o | 6: '' add other text
222 o | 6: '' add other text
221 | |
223 | |
222 o | 5: '' add file2 on trunk
224 o | 5: '' add file2 on trunk
223 | |
225 | |
224 o | 4: '' add text [MERGE from v1_1]
226 o | 4: '' add text [MERGE from v1_1]
225 |\|
227 |\|
226 | o 3: 'v1_1' add text [MERGE from v1_0]
228 | o 3: 'v1_1' add text [MERGE from v1_0]
227 | |\
229 | |\
228 +---o 2: 'v1_0' add text
230 +---o 2: 'v1_0' add text
229 | |
231 | |
230 | o 1: 'v1_1' unrelated change
232 | o 1: 'v1_1' unrelated change
231 |/
233 |/
232 o 0: '' add file1 on trunk
234 o 0: '' add file1 on trunk
233
235
@@ -1,467 +1,469 b''
1 #require cvs
1 #require cvs
2
2
3 $ cvscall()
3 $ cvscall()
4 > {
4 > {
5 > cvs -f "$@"
5 > cvs -f "$@"
6 > }
6 > }
7 $ hgcat()
7 $ hgcat()
8 > {
8 > {
9 > hg --cwd src-hg cat -r tip "$1"
9 > hg --cwd src-hg cat -r tip "$1"
10 > }
10 > }
11 $ echo "[extensions]" >> $HGRCPATH
11 $ echo "[extensions]" >> $HGRCPATH
12 $ echo "convert = " >> $HGRCPATH
12 $ echo "convert = " >> $HGRCPATH
13 $ cat > cvshooks.py <<EOF
13 $ cat > cvshooks.py <<EOF
14 > def cvslog(ui,repo,hooktype,log):
14 > def cvslog(ui,repo,hooktype,log):
15 > print "%s hook: %d entries"%(hooktype,len(log))
15 > print "%s hook: %d entries"%(hooktype,len(log))
16 >
16 >
17 > def cvschangesets(ui,repo,hooktype,changesets):
17 > def cvschangesets(ui,repo,hooktype,changesets):
18 > print "%s hook: %d changesets"%(hooktype,len(changesets))
18 > print "%s hook: %d changesets"%(hooktype,len(changesets))
19 > EOF
19 > EOF
20 $ hookpath=`pwd`
20 $ hookpath=`pwd`
21 $ echo "[hooks]" >> $HGRCPATH
21 $ cat <<EOF >> $HGRCPATH
22 $ echo "cvslog=python:$hookpath/cvshooks.py:cvslog" >> $HGRCPATH
22 > [hooks]
23 $ echo "cvschangesets=python:$hookpath/cvshooks.py:cvschangesets" >> $HGRCPATH
23 > cvslog = python:$hookpath/cvshooks.py:cvslog
24 > cvschangesets = python:$hookpath/cvshooks.py:cvschangesets
25 > EOF
24
26
25 create cvs repository
27 create cvs repository
26
28
27 $ mkdir cvsrepo
29 $ mkdir cvsrepo
28 $ cd cvsrepo
30 $ cd cvsrepo
29 $ CVSROOT=`pwd`
31 $ CVSROOT=`pwd`
30 $ export CVSROOT
32 $ export CVSROOT
31 $ CVS_OPTIONS=-f
33 $ CVS_OPTIONS=-f
32 $ export CVS_OPTIONS
34 $ export CVS_OPTIONS
33 $ cd ..
35 $ cd ..
34 $ cvscall -q -d "$CVSROOT" init
36 $ cvscall -q -d "$CVSROOT" init
35
37
36 create source directory
38 create source directory
37
39
38 $ mkdir src-temp
40 $ mkdir src-temp
39 $ cd src-temp
41 $ cd src-temp
40 $ echo a > a
42 $ echo a > a
41 $ mkdir b
43 $ mkdir b
42 $ cd b
44 $ cd b
43 $ echo c > c
45 $ echo c > c
44 $ cd ..
46 $ cd ..
45
47
46 import source directory
48 import source directory
47
49
48 $ cvscall -q import -m import src INITIAL start
50 $ cvscall -q import -m import src INITIAL start
49 N src/a
51 N src/a
50 N src/b/c
52 N src/b/c
51
53
52 No conflicts created by this import
54 No conflicts created by this import
53
55
54 $ cd ..
56 $ cd ..
55
57
56 checkout source directory
58 checkout source directory
57
59
58 $ cvscall -q checkout src
60 $ cvscall -q checkout src
59 U src/a
61 U src/a
60 U src/b/c
62 U src/b/c
61
63
62 commit a new revision changing b/c
64 commit a new revision changing b/c
63
65
64 $ cd src
66 $ cd src
65 $ sleep 1
67 $ sleep 1
66 $ echo c >> b/c
68 $ echo c >> b/c
67 $ cvscall -q commit -mci0 . | grep '<--'
69 $ cvscall -q commit -mci0 . | grep '<--'
68 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
70 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
69 $ cd ..
71 $ cd ..
70
72
71 convert fresh repo and also check localtimezone option
73 convert fresh repo and also check localtimezone option
72
74
73 NOTE: This doesn't check all time zones -- it merely determines that
75 NOTE: This doesn't check all time zones -- it merely determines that
74 the configuration option is taking effect.
76 the configuration option is taking effect.
75
77
76 An arbitrary (U.S.) time zone is used here. TZ=US/Hawaii is selected
78 An arbitrary (U.S.) time zone is used here. TZ=US/Hawaii is selected
77 since it does not use DST (unlike other U.S. time zones) and is always
79 since it does not use DST (unlike other U.S. time zones) and is always
78 a fixed difference from UTC.
80 a fixed difference from UTC.
79
81
80 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg
82 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg
81 initializing destination src-hg repository
83 initializing destination src-hg repository
82 connecting to $TESTTMP/cvsrepo
84 connecting to $TESTTMP/cvsrepo
83 scanning source...
85 scanning source...
84 collecting CVS rlog
86 collecting CVS rlog
85 5 log entries
87 5 log entries
86 cvslog hook: 5 entries
88 cvslog hook: 5 entries
87 creating changesets
89 creating changesets
88 3 changeset entries
90 3 changeset entries
89 cvschangesets hook: 3 changesets
91 cvschangesets hook: 3 changesets
90 sorting...
92 sorting...
91 converting...
93 converting...
92 2 Initial revision
94 2 Initial revision
93 1 ci0
95 1 ci0
94 0 import
96 0 import
95 updating tags
97 updating tags
96 $ hgcat a
98 $ hgcat a
97 a
99 a
98 $ hgcat b/c
100 $ hgcat b/c
99 c
101 c
100 c
102 c
101
103
102 convert fresh repo with --filemap
104 convert fresh repo with --filemap
103
105
104 $ echo include b/c > filemap
106 $ echo include b/c > filemap
105 $ hg convert --filemap filemap src src-filemap
107 $ hg convert --filemap filemap src src-filemap
106 initializing destination src-filemap repository
108 initializing destination src-filemap repository
107 connecting to $TESTTMP/cvsrepo
109 connecting to $TESTTMP/cvsrepo
108 scanning source...
110 scanning source...
109 collecting CVS rlog
111 collecting CVS rlog
110 5 log entries
112 5 log entries
111 cvslog hook: 5 entries
113 cvslog hook: 5 entries
112 creating changesets
114 creating changesets
113 3 changeset entries
115 3 changeset entries
114 cvschangesets hook: 3 changesets
116 cvschangesets hook: 3 changesets
115 sorting...
117 sorting...
116 converting...
118 converting...
117 2 Initial revision
119 2 Initial revision
118 1 ci0
120 1 ci0
119 0 import
121 0 import
120 filtering out empty revision
122 filtering out empty revision
121 repository tip rolled back to revision 1 (undo commit)
123 repository tip rolled back to revision 1 (undo commit)
122 updating tags
124 updating tags
123 $ hgcat b/c
125 $ hgcat b/c
124 c
126 c
125 c
127 c
126 $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
128 $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
127 2 update tags files: .hgtags
129 2 update tags files: .hgtags
128 1 ci0 files: b/c
130 1 ci0 files: b/c
129 0 Initial revision files: b/c
131 0 Initial revision files: b/c
130
132
131 convert full repository (issue1649)
133 convert full repository (issue1649)
132
134
133 $ cvscall -q -d "$CVSROOT" checkout -d srcfull "." | grep -v CVSROOT
135 $ cvscall -q -d "$CVSROOT" checkout -d srcfull "." | grep -v CVSROOT
134 U srcfull/src/a
136 U srcfull/src/a
135 U srcfull/src/b/c
137 U srcfull/src/b/c
136 $ ls srcfull
138 $ ls srcfull
137 CVS
139 CVS
138 CVSROOT
140 CVSROOT
139 src
141 src
140 $ hg convert srcfull srcfull-hg \
142 $ hg convert srcfull srcfull-hg \
141 > | grep -v 'log entries' | grep -v 'hook:' \
143 > | grep -v 'log entries' | grep -v 'hook:' \
142 > | grep -v '^[0-3] .*' # filter instable changeset order
144 > | grep -v '^[0-3] .*' # filter instable changeset order
143 initializing destination srcfull-hg repository
145 initializing destination srcfull-hg repository
144 connecting to $TESTTMP/cvsrepo
146 connecting to $TESTTMP/cvsrepo
145 scanning source...
147 scanning source...
146 collecting CVS rlog
148 collecting CVS rlog
147 creating changesets
149 creating changesets
148 4 changeset entries
150 4 changeset entries
149 sorting...
151 sorting...
150 converting...
152 converting...
151 updating tags
153 updating tags
152 $ hg cat -r tip --cwd srcfull-hg src/a
154 $ hg cat -r tip --cwd srcfull-hg src/a
153 a
155 a
154 $ hg cat -r tip --cwd srcfull-hg src/b/c
156 $ hg cat -r tip --cwd srcfull-hg src/b/c
155 c
157 c
156 c
158 c
157
159
158 commit new file revisions
160 commit new file revisions
159
161
160 $ cd src
162 $ cd src
161 $ echo a >> a
163 $ echo a >> a
162 $ echo c >> b/c
164 $ echo c >> b/c
163 $ cvscall -q commit -mci1 . | grep '<--'
165 $ cvscall -q commit -mci1 . | grep '<--'
164 $TESTTMP/cvsrepo/src/a,v <-- a
166 $TESTTMP/cvsrepo/src/a,v <-- a
165 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
167 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
166 $ cd ..
168 $ cd ..
167
169
168 convert again
170 convert again
169
171
170 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg
172 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg
171 connecting to $TESTTMP/cvsrepo
173 connecting to $TESTTMP/cvsrepo
172 scanning source...
174 scanning source...
173 collecting CVS rlog
175 collecting CVS rlog
174 7 log entries
176 7 log entries
175 cvslog hook: 7 entries
177 cvslog hook: 7 entries
176 creating changesets
178 creating changesets
177 4 changeset entries
179 4 changeset entries
178 cvschangesets hook: 4 changesets
180 cvschangesets hook: 4 changesets
179 sorting...
181 sorting...
180 converting...
182 converting...
181 0 ci1
183 0 ci1
182 $ hgcat a
184 $ hgcat a
183 a
185 a
184 a
186 a
185 $ hgcat b/c
187 $ hgcat b/c
186 c
188 c
187 c
189 c
188 c
190 c
189
191
190 convert again with --filemap
192 convert again with --filemap
191
193
192 $ hg convert --filemap filemap src src-filemap
194 $ hg convert --filemap filemap src src-filemap
193 connecting to $TESTTMP/cvsrepo
195 connecting to $TESTTMP/cvsrepo
194 scanning source...
196 scanning source...
195 collecting CVS rlog
197 collecting CVS rlog
196 7 log entries
198 7 log entries
197 cvslog hook: 7 entries
199 cvslog hook: 7 entries
198 creating changesets
200 creating changesets
199 4 changeset entries
201 4 changeset entries
200 cvschangesets hook: 4 changesets
202 cvschangesets hook: 4 changesets
201 sorting...
203 sorting...
202 converting...
204 converting...
203 0 ci1
205 0 ci1
204 $ hgcat b/c
206 $ hgcat b/c
205 c
207 c
206 c
208 c
207 c
209 c
208 $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
210 $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
209 3 ci1 files: b/c
211 3 ci1 files: b/c
210 2 update tags files: .hgtags
212 2 update tags files: .hgtags
211 1 ci0 files: b/c
213 1 ci0 files: b/c
212 0 Initial revision files: b/c
214 0 Initial revision files: b/c
213
215
214 commit branch
216 commit branch
215
217
216 $ cd src
218 $ cd src
217 $ cvs -q update -r1.1 b/c
219 $ cvs -q update -r1.1 b/c
218 U b/c
220 U b/c
219 $ cvs -q tag -b branch
221 $ cvs -q tag -b branch
220 T a
222 T a
221 T b/c
223 T b/c
222 $ cvs -q update -r branch > /dev/null
224 $ cvs -q update -r branch > /dev/null
223 $ echo d >> b/c
225 $ echo d >> b/c
224 $ cvs -q commit -mci2 . | grep '<--'
226 $ cvs -q commit -mci2 . | grep '<--'
225 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
227 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
226 $ cd ..
228 $ cd ..
227
229
228 convert again
230 convert again
229
231
230 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg
232 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg
231 connecting to $TESTTMP/cvsrepo
233 connecting to $TESTTMP/cvsrepo
232 scanning source...
234 scanning source...
233 collecting CVS rlog
235 collecting CVS rlog
234 8 log entries
236 8 log entries
235 cvslog hook: 8 entries
237 cvslog hook: 8 entries
236 creating changesets
238 creating changesets
237 5 changeset entries
239 5 changeset entries
238 cvschangesets hook: 5 changesets
240 cvschangesets hook: 5 changesets
239 sorting...
241 sorting...
240 converting...
242 converting...
241 0 ci2
243 0 ci2
242 $ hgcat b/c
244 $ hgcat b/c
243 c
245 c
244 d
246 d
245
247
246 convert again with --filemap
248 convert again with --filemap
247
249
248 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True --filemap filemap src src-filemap
250 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True --filemap filemap src src-filemap
249 connecting to $TESTTMP/cvsrepo
251 connecting to $TESTTMP/cvsrepo
250 scanning source...
252 scanning source...
251 collecting CVS rlog
253 collecting CVS rlog
252 8 log entries
254 8 log entries
253 cvslog hook: 8 entries
255 cvslog hook: 8 entries
254 creating changesets
256 creating changesets
255 5 changeset entries
257 5 changeset entries
256 cvschangesets hook: 5 changesets
258 cvschangesets hook: 5 changesets
257 sorting...
259 sorting...
258 converting...
260 converting...
259 0 ci2
261 0 ci2
260 $ hgcat b/c
262 $ hgcat b/c
261 c
263 c
262 d
264 d
263 $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
265 $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
264 4 ci2 files: b/c
266 4 ci2 files: b/c
265 3 ci1 files: b/c
267 3 ci1 files: b/c
266 2 update tags files: .hgtags
268 2 update tags files: .hgtags
267 1 ci0 files: b/c
269 1 ci0 files: b/c
268 0 Initial revision files: b/c
270 0 Initial revision files: b/c
269
271
270 commit a new revision with funny log message
272 commit a new revision with funny log message
271
273
272 $ cd src
274 $ cd src
273 $ sleep 1
275 $ sleep 1
274 $ echo e >> a
276 $ echo e >> a
275 $ cvscall -q commit -m'funny
277 $ cvscall -q commit -m'funny
276 > ----------------------------
278 > ----------------------------
277 > log message' . | grep '<--' |\
279 > log message' . | grep '<--' |\
278 > sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
280 > sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
279 checking in src/a,v
281 checking in src/a,v
280
282
281 commit new file revisions with some fuzz
283 commit new file revisions with some fuzz
282
284
283 $ sleep 1
285 $ sleep 1
284 $ echo f >> a
286 $ echo f >> a
285 $ cvscall -q commit -mfuzzy . | grep '<--'
287 $ cvscall -q commit -mfuzzy . | grep '<--'
286 $TESTTMP/cvsrepo/src/a,v <-- a
288 $TESTTMP/cvsrepo/src/a,v <-- a
287 $ sleep 4 # the two changes will be split if fuzz < 4
289 $ sleep 4 # the two changes will be split if fuzz < 4
288 $ echo g >> b/c
290 $ echo g >> b/c
289 $ cvscall -q commit -mfuzzy . | grep '<--'
291 $ cvscall -q commit -mfuzzy . | grep '<--'
290 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
292 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
291 $ cd ..
293 $ cd ..
292
294
293 convert again
295 convert again
294
296
295 $ TZ=US/Hawaii hg convert --config convert.cvsps.fuzz=2 --config convert.localtimezone=True src src-hg
297 $ TZ=US/Hawaii hg convert --config convert.cvsps.fuzz=2 --config convert.localtimezone=True src src-hg
296 connecting to $TESTTMP/cvsrepo
298 connecting to $TESTTMP/cvsrepo
297 scanning source...
299 scanning source...
298 collecting CVS rlog
300 collecting CVS rlog
299 11 log entries
301 11 log entries
300 cvslog hook: 11 entries
302 cvslog hook: 11 entries
301 creating changesets
303 creating changesets
302 8 changeset entries
304 8 changeset entries
303 cvschangesets hook: 8 changesets
305 cvschangesets hook: 8 changesets
304 sorting...
306 sorting...
305 converting...
307 converting...
306 2 funny
308 2 funny
307 1 fuzzy
309 1 fuzzy
308 0 fuzzy
310 0 fuzzy
309 $ hg -R src-hg log -G --template '{rev} ({branches}) {desc} date: {date|date} files: {files}\n'
311 $ hg -R src-hg log -G --template '{rev} ({branches}) {desc} date: {date|date} files: {files}\n'
310 o 8 (branch) fuzzy date: * -1000 files: b/c (glob)
312 o 8 (branch) fuzzy date: * -1000 files: b/c (glob)
311 |
313 |
312 o 7 (branch) fuzzy date: * -1000 files: a (glob)
314 o 7 (branch) fuzzy date: * -1000 files: a (glob)
313 |
315 |
314 o 6 (branch) funny
316 o 6 (branch) funny
315 | ----------------------------
317 | ----------------------------
316 | log message date: * -1000 files: a (glob)
318 | log message date: * -1000 files: a (glob)
317 o 5 (branch) ci2 date: * -1000 files: b/c (glob)
319 o 5 (branch) ci2 date: * -1000 files: b/c (glob)
318
320
319 o 4 () ci1 date: * -1000 files: a b/c (glob)
321 o 4 () ci1 date: * -1000 files: a b/c (glob)
320 |
322 |
321 o 3 () update tags date: * +0000 files: .hgtags (glob)
323 o 3 () update tags date: * +0000 files: .hgtags (glob)
322 |
324 |
323 | o 2 (INITIAL) import date: * -1000 files: (glob)
325 | o 2 (INITIAL) import date: * -1000 files: (glob)
324 | |
326 | |
325 o | 1 () ci0 date: * -1000 files: b/c (glob)
327 o | 1 () ci0 date: * -1000 files: b/c (glob)
326 |/
328 |/
327 o 0 () Initial revision date: * -1000 files: a b/c (glob)
329 o 0 () Initial revision date: * -1000 files: a b/c (glob)
328
330
329
331
330 testing debugcvsps
332 testing debugcvsps
331
333
332 $ cd src
334 $ cd src
333 $ hg debugcvsps --fuzz=2
335 $ hg debugcvsps --fuzz=2
334 collecting CVS rlog
336 collecting CVS rlog
335 11 log entries
337 11 log entries
336 cvslog hook: 11 entries
338 cvslog hook: 11 entries
337 creating changesets
339 creating changesets
338 10 changeset entries
340 10 changeset entries
339 cvschangesets hook: 10 changesets
341 cvschangesets hook: 10 changesets
340 ---------------------
342 ---------------------
341 PatchSet 1
343 PatchSet 1
342 Date: * (glob)
344 Date: * (glob)
343 Author: * (glob)
345 Author: * (glob)
344 Branch: HEAD
346 Branch: HEAD
345 Tag: (none)
347 Tag: (none)
346 Branchpoints: INITIAL
348 Branchpoints: INITIAL
347 Log:
349 Log:
348 Initial revision
350 Initial revision
349
351
350 Members:
352 Members:
351 a:INITIAL->1.1
353 a:INITIAL->1.1
352
354
353 ---------------------
355 ---------------------
354 PatchSet 2
356 PatchSet 2
355 Date: * (glob)
357 Date: * (glob)
356 Author: * (glob)
358 Author: * (glob)
357 Branch: HEAD
359 Branch: HEAD
358 Tag: (none)
360 Tag: (none)
359 Branchpoints: INITIAL, branch
361 Branchpoints: INITIAL, branch
360 Log:
362 Log:
361 Initial revision
363 Initial revision
362
364
363 Members:
365 Members:
364 b/c:INITIAL->1.1
366 b/c:INITIAL->1.1
365
367
366 ---------------------
368 ---------------------
367 PatchSet 3
369 PatchSet 3
368 Date: * (glob)
370 Date: * (glob)
369 Author: * (glob)
371 Author: * (glob)
370 Branch: INITIAL
372 Branch: INITIAL
371 Tag: start
373 Tag: start
372 Log:
374 Log:
373 import
375 import
374
376
375 Members:
377 Members:
376 a:1.1->1.1.1.1
378 a:1.1->1.1.1.1
377 b/c:1.1->1.1.1.1
379 b/c:1.1->1.1.1.1
378
380
379 ---------------------
381 ---------------------
380 PatchSet 4
382 PatchSet 4
381 Date: * (glob)
383 Date: * (glob)
382 Author: * (glob)
384 Author: * (glob)
383 Branch: HEAD
385 Branch: HEAD
384 Tag: (none)
386 Tag: (none)
385 Log:
387 Log:
386 ci0
388 ci0
387
389
388 Members:
390 Members:
389 b/c:1.1->1.2
391 b/c:1.1->1.2
390
392
391 ---------------------
393 ---------------------
392 PatchSet 5
394 PatchSet 5
393 Date: * (glob)
395 Date: * (glob)
394 Author: * (glob)
396 Author: * (glob)
395 Branch: HEAD
397 Branch: HEAD
396 Tag: (none)
398 Tag: (none)
397 Log:
399 Log:
398 ci1
400 ci1
399
401
400 Members:
402 Members:
401 b/c:1.2->1.3
403 b/c:1.2->1.3
402
404
403 ---------------------
405 ---------------------
404 PatchSet 6
406 PatchSet 6
405 Date: * (glob)
407 Date: * (glob)
406 Author: * (glob)
408 Author: * (glob)
407 Branch: HEAD
409 Branch: HEAD
408 Tag: (none)
410 Tag: (none)
409 Branchpoints: branch
411 Branchpoints: branch
410 Log:
412 Log:
411 ci1
413 ci1
412
414
413 Members:
415 Members:
414 a:1.1->1.2
416 a:1.1->1.2
415
417
416 ---------------------
418 ---------------------
417 PatchSet 7
419 PatchSet 7
418 Date: * (glob)
420 Date: * (glob)
419 Author: * (glob)
421 Author: * (glob)
420 Branch: branch
422 Branch: branch
421 Tag: (none)
423 Tag: (none)
422 Log:
424 Log:
423 ci2
425 ci2
424
426
425 Members:
427 Members:
426 b/c:1.1->1.1.2.1
428 b/c:1.1->1.1.2.1
427
429
428 ---------------------
430 ---------------------
429 PatchSet 8
431 PatchSet 8
430 Date: * (glob)
432 Date: * (glob)
431 Author: * (glob)
433 Author: * (glob)
432 Branch: branch
434 Branch: branch
433 Tag: (none)
435 Tag: (none)
434 Log:
436 Log:
435 funny
437 funny
436 ----------------------------
438 ----------------------------
437 log message
439 log message
438
440
439 Members:
441 Members:
440 a:1.2->1.2.2.1
442 a:1.2->1.2.2.1
441
443
442 ---------------------
444 ---------------------
443 PatchSet 9
445 PatchSet 9
444 Date: * (glob)
446 Date: * (glob)
445 Author: * (glob)
447 Author: * (glob)
446 Branch: branch
448 Branch: branch
447 Tag: (none)
449 Tag: (none)
448 Log:
450 Log:
449 fuzzy
451 fuzzy
450
452
451 Members:
453 Members:
452 a:1.2.2.1->1.2.2.2
454 a:1.2.2.1->1.2.2.2
453
455
454 ---------------------
456 ---------------------
455 PatchSet 10
457 PatchSet 10
456 Date: * (glob)
458 Date: * (glob)
457 Author: * (glob)
459 Author: * (glob)
458 Branch: branch
460 Branch: branch
459 Tag: (none)
461 Tag: (none)
460 Log:
462 Log:
461 fuzzy
463 fuzzy
462
464
463 Members:
465 Members:
464 b/c:1.1.2.1->1.1.2.2
466 b/c:1.1.2.1->1.1.2.2
465
467
466
468
467 $ cd ..
469 $ cd ..
@@ -1,116 +1,118 b''
1 #require svn svn-bindings
1 #require svn svn-bindings
2
2
3 $ echo "[extensions]" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 $ echo "convert = " >> $HGRCPATH
4 > [extensions]
5 $ echo "mq = " >> $HGRCPATH
5 > convert =
6 > mq =
7 > EOF
6
8
7 $ SVNREPOPATH=`pwd`/svn-repo
9 $ SVNREPOPATH=`pwd`/svn-repo
8 #if windows
10 #if windows
9 $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
11 $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
10 #else
12 #else
11 $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
13 $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
12 #endif
14 #endif
13
15
14 $ svnadmin create "$SVNREPOPATH"
16 $ svnadmin create "$SVNREPOPATH"
15 $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change <<EOF
17 $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change <<EOF
16 > #!/bin/sh
18 > #!/bin/sh
17 >
19 >
18 > REPOS="$1"
20 > REPOS="$1"
19 > REV="$2"
21 > REV="$2"
20 > USER="$3"
22 > USER="$3"
21 > PROPNAME="$4"
23 > PROPNAME="$4"
22 > ACTION="$5"
24 > ACTION="$5"
23 >
25 >
24 > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
26 > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
25 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi
27 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi
26 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi
28 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi
27 >
29 >
28 > echo "Changing prohibited revision property" >&2
30 > echo "Changing prohibited revision property" >&2
29 > exit 1
31 > exit 1
30 > EOF
32 > EOF
31 $ chmod +x "$SVNREPOPATH"/hooks/pre-revprop-change
33 $ chmod +x "$SVNREPOPATH"/hooks/pre-revprop-change
32 $ svn co "$SVNREPOURL" "$SVNREPOPATH"-wc
34 $ svn co "$SVNREPOURL" "$SVNREPOPATH"-wc
33 Checked out revision 0.
35 Checked out revision 0.
34 $ cd "$SVNREPOPATH"-wc
36 $ cd "$SVNREPOPATH"-wc
35 $ echo a > a
37 $ echo a > a
36 $ svn add a
38 $ svn add a
37 A a
39 A a
38 $ svn ci -m'added a' a
40 $ svn ci -m'added a' a
39 Adding a
41 Adding a
40 Transmitting file data .
42 Transmitting file data .
41 Committed revision 1.
43 Committed revision 1.
42 $ cd ..
44 $ cd ..
43
45
44 initial roundtrip
46 initial roundtrip
45
47
46 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | grep -v initializing
48 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | grep -v initializing
47 scanning source...
49 scanning source...
48 sorting...
50 sorting...
49 converting...
51 converting...
50 0 added a
52 0 added a
51 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
53 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
52 scanning source...
54 scanning source...
53 sorting...
55 sorting...
54 converting...
56 converting...
55
57
56 second roundtrip should do nothing
58 second roundtrip should do nothing
57
59
58 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg
60 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg
59 scanning source...
61 scanning source...
60 sorting...
62 sorting...
61 converting...
63 converting...
62 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
64 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
63 scanning source...
65 scanning source...
64 sorting...
66 sorting...
65 converting...
67 converting...
66
68
67 new hg rev
69 new hg rev
68
70
69 $ hg clone "$SVNREPOPATH"-hg "$SVNREPOPATH"-work
71 $ hg clone "$SVNREPOPATH"-hg "$SVNREPOPATH"-work
70 updating to branch default
72 updating to branch default
71 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 $ cd "$SVNREPOPATH"-work
74 $ cd "$SVNREPOPATH"-work
73 $ echo b > b
75 $ echo b > b
74 $ hg add b
76 $ hg add b
75 $ hg ci -mb
77 $ hg ci -mb
76
78
77 adding an empty revision
79 adding an empty revision
78
80
79 $ hg qnew -m emtpy empty
81 $ hg qnew -m emtpy empty
80 $ hg qfinish -a
82 $ hg qfinish -a
81 $ cd ..
83 $ cd ..
82
84
83 echo hg to svn
85 echo hg to svn
84
86
85 $ hg --cwd "$SVNREPOPATH"-hg pull -q "$SVNREPOPATH"-work
87 $ hg --cwd "$SVNREPOPATH"-hg pull -q "$SVNREPOPATH"-work
86 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
88 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
87 scanning source...
89 scanning source...
88 sorting...
90 sorting...
89 converting...
91 converting...
90 1 b
92 1 b
91 0 emtpy
93 0 emtpy
92
94
93 svn back to hg should do nothing
95 svn back to hg should do nothing
94
96
95 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg
97 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg
96 scanning source...
98 scanning source...
97 sorting...
99 sorting...
98 converting...
100 converting...
99
101
100 hg back to svn should do nothing
102 hg back to svn should do nothing
101
103
102 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
104 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
103 scanning source...
105 scanning source...
104 sorting...
106 sorting...
105 converting...
107 converting...
106
108
107 verify which shamap format we are storing and must be able to handle
109 verify which shamap format we are storing and must be able to handle
108
110
109 $ cat svn-repo-hg/.hg/shamap
111 $ cat svn-repo-hg/.hg/shamap
110 svn:????????-????-????-????-????????????@1 ???????????????????????????????????????? (glob)
112 svn:????????-????-????-????-????????????@1 ???????????????????????????????????????? (glob)
111 svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob)
113 svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob)
112 svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob)
114 svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob)
113 $ cat svn-repo-wc/.svn/hg-shamap
115 $ cat svn-repo-wc/.svn/hg-shamap
114 ???????????????????????????????????????? 1 (glob)
116 ???????????????????????????????????????? 1 (glob)
115 ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob)
117 ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob)
116 ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob)
118 ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob)
@@ -1,89 +1,91 b''
1 #require git
1 #require git
2
2
3 $ echo "[core]" >> $HOME/.gitconfig
3 $ echo "[core]" >> $HOME/.gitconfig
4 $ echo "autocrlf = false" >> $HOME/.gitconfig
4 $ echo "autocrlf = false" >> $HOME/.gitconfig
5 $ echo "[core]" >> $HOME/.gitconfig
5 $ echo "[core]" >> $HOME/.gitconfig
6 $ echo "autocrlf = false" >> $HOME/.gitconfig
6 $ echo "autocrlf = false" >> $HOME/.gitconfig
7 $ echo "[extensions]" >> $HGRCPATH
7 $ cat <<EOF >> $HGRCPATH
8 $ echo "convert=" >> $HGRCPATH
8 > [extensions]
9 $ echo '[convert]' >> $HGRCPATH
9 > convert =
10 $ echo 'hg.usebranchnames = True' >> $HGRCPATH
10 > [convert]
11 $ echo 'hg.tagsbranch = tags-update' >> $HGRCPATH
11 > hg.usebranchnames = True
12 > hg.tagsbranch = tags-update
13 > EOF
12 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
14 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
13 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
15 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
14 $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
16 $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
15 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
17 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
16 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
18 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
17 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
19 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
18 $ count=10
20 $ count=10
19 $ action()
21 $ action()
20 > {
22 > {
21 > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
23 > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
22 > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
24 > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
23 > git "$@" >/dev/null 2>/dev/null || echo "git command error"
25 > git "$@" >/dev/null 2>/dev/null || echo "git command error"
24 > count=`expr $count + 1`
26 > count=`expr $count + 1`
25 > }
27 > }
26 $ glog()
28 $ glog()
27 > {
29 > {
28 > hg log -G --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
30 > hg log -G --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
29 > }
31 > }
30 $ convertrepo()
32 $ convertrepo()
31 > {
33 > {
32 > hg convert --datesort git-repo hg-repo
34 > hg convert --datesort git-repo hg-repo
33 > }
35 > }
34
36
35 Build a GIT repo with at least 1 tag
37 Build a GIT repo with at least 1 tag
36
38
37 $ mkdir git-repo
39 $ mkdir git-repo
38 $ cd git-repo
40 $ cd git-repo
39 $ git init >/dev/null 2>&1
41 $ git init >/dev/null 2>&1
40 $ echo a > a
42 $ echo a > a
41 $ git add a
43 $ git add a
42 $ action commit -m "rev1"
44 $ action commit -m "rev1"
43 $ action tag -m "tag1" tag1
45 $ action tag -m "tag1" tag1
44 $ cd ..
46 $ cd ..
45
47
46 Do a first conversion
48 Do a first conversion
47
49
48 $ convertrepo
50 $ convertrepo
49 initializing destination hg-repo repository
51 initializing destination hg-repo repository
50 scanning source...
52 scanning source...
51 sorting...
53 sorting...
52 converting...
54 converting...
53 0 rev1
55 0 rev1
54 updating tags
56 updating tags
55 updating bookmarks
57 updating bookmarks
56
58
57 Simulate upstream updates after first conversion
59 Simulate upstream updates after first conversion
58
60
59 $ cd git-repo
61 $ cd git-repo
60 $ echo b > a
62 $ echo b > a
61 $ git add a
63 $ git add a
62 $ action commit -m "rev2"
64 $ action commit -m "rev2"
63 $ action tag -m "tag2" tag2
65 $ action tag -m "tag2" tag2
64 $ cd ..
66 $ cd ..
65
67
66 Perform an incremental conversion
68 Perform an incremental conversion
67
69
68 $ convertrepo
70 $ convertrepo
69 scanning source...
71 scanning source...
70 sorting...
72 sorting...
71 converting...
73 converting...
72 0 rev2
74 0 rev2
73 updating tags
75 updating tags
74 updating bookmarks
76 updating bookmarks
75
77
76 Print the log
78 Print the log
77
79
78 $ cd hg-repo
80 $ cd hg-repo
79 $ glog
81 $ glog
80 o 3 "update tags" files: .hgtags
82 o 3 "update tags" files: .hgtags
81 |
83 |
82 | o 2 "rev2" files: a
84 | o 2 "rev2" files: a
83 | |
85 | |
84 o | 1 "update tags" files: .hgtags
86 o | 1 "update tags" files: .hgtags
85 /
87 /
86 o 0 "rev1" files: a
88 o 0 "rev1" files: a
87
89
88
90
89 $ cd ..
91 $ cd ..
@@ -1,206 +1,210 b''
1 Setup
1 Setup
2
2
3 $ echo "[color]" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 $ echo "mode = ansi" >> $HGRCPATH
4 > [color]
5 $ echo "[extensions]" >> $HGRCPATH
5 > mode = ansi
6 $ echo "color=" >> $HGRCPATH
6 > [extensions]
7 > color =
8 > EOF
7 $ hg init repo
9 $ hg init repo
8 $ cd repo
10 $ cd repo
9 $ cat > a <<EOF
11 $ cat > a <<EOF
10 > c
12 > c
11 > c
13 > c
12 > a
14 > a
13 > a
15 > a
14 > b
16 > b
15 > a
17 > a
16 > a
18 > a
17 > c
19 > c
18 > c
20 > c
19 > EOF
21 > EOF
20 $ hg ci -Am adda
22 $ hg ci -Am adda
21 adding a
23 adding a
22 $ cat > a <<EOF
24 $ cat > a <<EOF
23 > c
25 > c
24 > c
26 > c
25 > a
27 > a
26 > a
28 > a
27 > dd
29 > dd
28 > a
30 > a
29 > a
31 > a
30 > c
32 > c
31 > c
33 > c
32 > EOF
34 > EOF
33
35
34 default context
36 default context
35
37
36 $ hg diff --nodates --color=always
38 $ hg diff --nodates --color=always
37 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
39 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
38 \x1b[0;31;1m--- a/a\x1b[0m (esc)
40 \x1b[0;31;1m--- a/a\x1b[0m (esc)
39 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
41 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
40 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
42 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
41 c
43 c
42 a
44 a
43 a
45 a
44 \x1b[0;31m-b\x1b[0m (esc)
46 \x1b[0;31m-b\x1b[0m (esc)
45 \x1b[0;32m+dd\x1b[0m (esc)
47 \x1b[0;32m+dd\x1b[0m (esc)
46 a
48 a
47 a
49 a
48 c
50 c
49
51
50 --unified=2
52 --unified=2
51
53
52 $ hg diff --nodates -U 2 --color=always
54 $ hg diff --nodates -U 2 --color=always
53 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
55 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
54 \x1b[0;31;1m--- a/a\x1b[0m (esc)
56 \x1b[0;31;1m--- a/a\x1b[0m (esc)
55 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
57 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
56 \x1b[0;35m@@ -3,5 +3,5 @@\x1b[0m (esc)
58 \x1b[0;35m@@ -3,5 +3,5 @@\x1b[0m (esc)
57 a
59 a
58 a
60 a
59 \x1b[0;31m-b\x1b[0m (esc)
61 \x1b[0;31m-b\x1b[0m (esc)
60 \x1b[0;32m+dd\x1b[0m (esc)
62 \x1b[0;32m+dd\x1b[0m (esc)
61 a
63 a
62 a
64 a
63
65
64 diffstat
66 diffstat
65
67
66 $ hg diff --stat --color=always
68 $ hg diff --stat --color=always
67 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
69 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
68 1 files changed, 1 insertions(+), 1 deletions(-)
70 1 files changed, 1 insertions(+), 1 deletions(-)
69 $ echo "record=" >> $HGRCPATH
71 $ cat <<EOF >> $HGRCPATH
70 $ echo "[ui]" >> $HGRCPATH
72 > record =
71 $ echo "interactive=true" >> $HGRCPATH
73 > [ui]
72 $ echo "[diff]" >> $HGRCPATH
74 > interactive = true
73 $ echo "git=True" >> $HGRCPATH
75 > [diff]
76 > git = True
77 > EOF
74
78
75 #if execbit
79 #if execbit
76
80
77 record
81 record
78
82
79 $ chmod +x a
83 $ chmod +x a
80 $ hg record --color=always -m moda a <<EOF
84 $ hg record --color=always -m moda a <<EOF
81 > y
85 > y
82 > y
86 > y
83 > EOF
87 > EOF
84 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
88 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
85 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
89 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
86 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
90 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
87 1 hunks, 1 lines changed
91 1 hunks, 1 lines changed
88 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
92 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
89
93
90 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
94 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
91 c
95 c
92 a
96 a
93 a
97 a
94 \x1b[0;31m-b\x1b[0m (esc)
98 \x1b[0;31m-b\x1b[0m (esc)
95 \x1b[0;32m+dd\x1b[0m (esc)
99 \x1b[0;32m+dd\x1b[0m (esc)
96 a
100 a
97 a
101 a
98 c
102 c
99 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
103 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
100
104
101
105
102 $ echo "[extensions]" >> $HGRCPATH
106 $ echo "[extensions]" >> $HGRCPATH
103 $ echo "mq=" >> $HGRCPATH
107 $ echo "mq=" >> $HGRCPATH
104 $ hg rollback
108 $ hg rollback
105 repository tip rolled back to revision 0 (undo commit)
109 repository tip rolled back to revision 0 (undo commit)
106 working directory now based on revision 0
110 working directory now based on revision 0
107
111
108 qrecord
112 qrecord
109
113
110 $ hg qrecord --color=always -m moda patch <<EOF
114 $ hg qrecord --color=always -m moda patch <<EOF
111 > y
115 > y
112 > y
116 > y
113 > EOF
117 > EOF
114 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
118 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
115 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
119 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
116 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
120 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
117 1 hunks, 1 lines changed
121 1 hunks, 1 lines changed
118 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
122 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
119
123
120 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
124 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
121 c
125 c
122 a
126 a
123 a
127 a
124 \x1b[0;31m-b\x1b[0m (esc)
128 \x1b[0;31m-b\x1b[0m (esc)
125 \x1b[0;32m+dd\x1b[0m (esc)
129 \x1b[0;32m+dd\x1b[0m (esc)
126 a
130 a
127 a
131 a
128 c
132 c
129 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
133 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
130
134
131
135
132 $ hg qpop -a
136 $ hg qpop -a
133 popping patch
137 popping patch
134 patch queue now empty
138 patch queue now empty
135
139
136 #endif
140 #endif
137
141
138 issue3712: test colorization of subrepo diff
142 issue3712: test colorization of subrepo diff
139
143
140 $ hg init sub
144 $ hg init sub
141 $ echo b > sub/b
145 $ echo b > sub/b
142 $ hg -R sub commit -Am 'create sub'
146 $ hg -R sub commit -Am 'create sub'
143 adding b
147 adding b
144 $ echo 'sub = sub' > .hgsub
148 $ echo 'sub = sub' > .hgsub
145 $ hg add .hgsub
149 $ hg add .hgsub
146 $ hg commit -m 'add subrepo sub'
150 $ hg commit -m 'add subrepo sub'
147 $ echo aa >> a
151 $ echo aa >> a
148 $ echo bb >> sub/b
152 $ echo bb >> sub/b
149
153
150 $ hg diff --color=always -S
154 $ hg diff --color=always -S
151 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
155 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
152 \x1b[0;31;1m--- a/a\x1b[0m (esc)
156 \x1b[0;31;1m--- a/a\x1b[0m (esc)
153 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
157 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
154 \x1b[0;35m@@ -7,3 +7,4 @@\x1b[0m (esc)
158 \x1b[0;35m@@ -7,3 +7,4 @@\x1b[0m (esc)
155 a
159 a
156 c
160 c
157 c
161 c
158 \x1b[0;32m+aa\x1b[0m (esc)
162 \x1b[0;32m+aa\x1b[0m (esc)
159 \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (esc)
163 \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (esc)
160 \x1b[0;31;1m--- a/sub/b\x1b[0m (esc)
164 \x1b[0;31;1m--- a/sub/b\x1b[0m (esc)
161 \x1b[0;32;1m+++ b/sub/b\x1b[0m (esc)
165 \x1b[0;32;1m+++ b/sub/b\x1b[0m (esc)
162 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
166 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
163 b
167 b
164 \x1b[0;32m+bb\x1b[0m (esc)
168 \x1b[0;32m+bb\x1b[0m (esc)
165
169
166 test tabs
170 test tabs
167
171
168 $ cat >> a <<EOF
172 $ cat >> a <<EOF
169 > one tab
173 > one tab
170 > two tabs
174 > two tabs
171 > end tab
175 > end tab
172 > mid tab
176 > mid tab
173 > all tabs
177 > all tabs
174 > EOF
178 > EOF
175 $ hg diff --nodates --color=always
179 $ hg diff --nodates --color=always
176 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
180 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
177 \x1b[0;31;1m--- a/a\x1b[0m (esc)
181 \x1b[0;31;1m--- a/a\x1b[0m (esc)
178 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
182 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
179 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
183 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
180 a
184 a
181 c
185 c
182 c
186 c
183 \x1b[0;32m+aa\x1b[0m (esc)
187 \x1b[0;32m+aa\x1b[0m (esc)
184 \x1b[0;32m+\x1b[0m \x1b[0;32mone tab\x1b[0m (esc)
188 \x1b[0;32m+\x1b[0m \x1b[0;32mone tab\x1b[0m (esc)
185 \x1b[0;32m+\x1b[0m \x1b[0;32mtwo tabs\x1b[0m (esc)
189 \x1b[0;32m+\x1b[0m \x1b[0;32mtwo tabs\x1b[0m (esc)
186 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
190 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
187 \x1b[0;32m+mid\x1b[0m \x1b[0;32mtab\x1b[0m (esc)
191 \x1b[0;32m+mid\x1b[0m \x1b[0;32mtab\x1b[0m (esc)
188 \x1b[0;32m+\x1b[0m \x1b[0;32mall\x1b[0m \x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
192 \x1b[0;32m+\x1b[0m \x1b[0;32mall\x1b[0m \x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
189 $ echo "[color]" >> $HGRCPATH
193 $ echo "[color]" >> $HGRCPATH
190 $ echo "diff.tab = bold magenta" >> $HGRCPATH
194 $ echo "diff.tab = bold magenta" >> $HGRCPATH
191 $ hg diff --nodates --color=always
195 $ hg diff --nodates --color=always
192 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
196 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
193 \x1b[0;31;1m--- a/a\x1b[0m (esc)
197 \x1b[0;31;1m--- a/a\x1b[0m (esc)
194 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
198 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
195 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
199 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
196 a
200 a
197 c
201 c
198 c
202 c
199 \x1b[0;32m+aa\x1b[0m (esc)
203 \x1b[0;32m+aa\x1b[0m (esc)
200 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mone tab\x1b[0m (esc)
204 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mone tab\x1b[0m (esc)
201 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtwo tabs\x1b[0m (esc)
205 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtwo tabs\x1b[0m (esc)
202 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
206 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
203 \x1b[0;32m+mid\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtab\x1b[0m (esc)
207 \x1b[0;32m+mid\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtab\x1b[0m (esc)
204 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mall\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
208 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mall\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
205
209
206 $ cd ..
210 $ cd ..
@@ -1,288 +1,290 b''
1 #require execbit
1 #require execbit
2
2
3 $ echo "[extensions]" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 $ echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
4 > [extensions]
5 $ echo "[diff]" >> $HGRCPATH
5 > autodiff = $TESTDIR/autodiff.py
6 $ echo "nodates=1" >> $HGRCPATH
6 > [diff]
7 > nodates = 1
8 > EOF
7
9
8 $ hg init repo
10 $ hg init repo
9 $ cd repo
11 $ cd repo
10
12
11
13
12
14
13 make a combination of new, changed and deleted file
15 make a combination of new, changed and deleted file
14
16
15 $ echo regular > regular
17 $ echo regular > regular
16 $ echo rmregular > rmregular
18 $ echo rmregular > rmregular
17 $ $PYTHON -c "file('bintoregular', 'wb').write('\0')"
19 $ $PYTHON -c "file('bintoregular', 'wb').write('\0')"
18 $ touch rmempty
20 $ touch rmempty
19 $ echo exec > exec
21 $ echo exec > exec
20 $ chmod +x exec
22 $ chmod +x exec
21 $ echo rmexec > rmexec
23 $ echo rmexec > rmexec
22 $ chmod +x rmexec
24 $ chmod +x rmexec
23 $ echo setexec > setexec
25 $ echo setexec > setexec
24 $ echo unsetexec > unsetexec
26 $ echo unsetexec > unsetexec
25 $ chmod +x unsetexec
27 $ chmod +x unsetexec
26 $ echo binary > binary
28 $ echo binary > binary
27 $ $PYTHON -c "file('rmbinary', 'wb').write('\0')"
29 $ $PYTHON -c "file('rmbinary', 'wb').write('\0')"
28 $ hg ci -Am addfiles
30 $ hg ci -Am addfiles
29 adding binary
31 adding binary
30 adding bintoregular
32 adding bintoregular
31 adding exec
33 adding exec
32 adding regular
34 adding regular
33 adding rmbinary
35 adding rmbinary
34 adding rmempty
36 adding rmempty
35 adding rmexec
37 adding rmexec
36 adding rmregular
38 adding rmregular
37 adding setexec
39 adding setexec
38 adding unsetexec
40 adding unsetexec
39 $ echo regular >> regular
41 $ echo regular >> regular
40 $ echo newregular >> newregular
42 $ echo newregular >> newregular
41 $ rm rmempty
43 $ rm rmempty
42 $ touch newempty
44 $ touch newempty
43 $ rm rmregular
45 $ rm rmregular
44 $ echo exec >> exec
46 $ echo exec >> exec
45 $ echo newexec > newexec
47 $ echo newexec > newexec
46 $ echo bintoregular > bintoregular
48 $ echo bintoregular > bintoregular
47 $ chmod +x newexec
49 $ chmod +x newexec
48 $ rm rmexec
50 $ rm rmexec
49 $ chmod +x setexec
51 $ chmod +x setexec
50 $ chmod -x unsetexec
52 $ chmod -x unsetexec
51 $ $PYTHON -c "file('binary', 'wb').write('\0\0')"
53 $ $PYTHON -c "file('binary', 'wb').write('\0\0')"
52 $ $PYTHON -c "file('newbinary', 'wb').write('\0')"
54 $ $PYTHON -c "file('newbinary', 'wb').write('\0')"
53 $ rm rmbinary
55 $ rm rmbinary
54 $ hg addremove -s 0
56 $ hg addremove -s 0
55 adding newbinary
57 adding newbinary
56 adding newempty
58 adding newempty
57 adding newexec
59 adding newexec
58 adding newregular
60 adding newregular
59 removing rmbinary
61 removing rmbinary
60 removing rmempty
62 removing rmempty
61 removing rmexec
63 removing rmexec
62 removing rmregular
64 removing rmregular
63
65
64 git=no: regular diff for all files
66 git=no: regular diff for all files
65
67
66 $ hg autodiff --git=no
68 $ hg autodiff --git=no
67 diff -r a66d19b9302d binary
69 diff -r a66d19b9302d binary
68 Binary file binary has changed
70 Binary file binary has changed
69 diff -r a66d19b9302d bintoregular
71 diff -r a66d19b9302d bintoregular
70 Binary file bintoregular has changed
72 Binary file bintoregular has changed
71 diff -r a66d19b9302d exec
73 diff -r a66d19b9302d exec
72 --- a/exec
74 --- a/exec
73 +++ b/exec
75 +++ b/exec
74 @@ -1,1 +1,2 @@
76 @@ -1,1 +1,2 @@
75 exec
77 exec
76 +exec
78 +exec
77 diff -r a66d19b9302d newbinary
79 diff -r a66d19b9302d newbinary
78 Binary file newbinary has changed
80 Binary file newbinary has changed
79 diff -r a66d19b9302d newexec
81 diff -r a66d19b9302d newexec
80 --- /dev/null
82 --- /dev/null
81 +++ b/newexec
83 +++ b/newexec
82 @@ -0,0 +1,1 @@
84 @@ -0,0 +1,1 @@
83 +newexec
85 +newexec
84 diff -r a66d19b9302d newregular
86 diff -r a66d19b9302d newregular
85 --- /dev/null
87 --- /dev/null
86 +++ b/newregular
88 +++ b/newregular
87 @@ -0,0 +1,1 @@
89 @@ -0,0 +1,1 @@
88 +newregular
90 +newregular
89 diff -r a66d19b9302d regular
91 diff -r a66d19b9302d regular
90 --- a/regular
92 --- a/regular
91 +++ b/regular
93 +++ b/regular
92 @@ -1,1 +1,2 @@
94 @@ -1,1 +1,2 @@
93 regular
95 regular
94 +regular
96 +regular
95 diff -r a66d19b9302d rmbinary
97 diff -r a66d19b9302d rmbinary
96 Binary file rmbinary has changed
98 Binary file rmbinary has changed
97 diff -r a66d19b9302d rmexec
99 diff -r a66d19b9302d rmexec
98 --- a/rmexec
100 --- a/rmexec
99 +++ /dev/null
101 +++ /dev/null
100 @@ -1,1 +0,0 @@
102 @@ -1,1 +0,0 @@
101 -rmexec
103 -rmexec
102 diff -r a66d19b9302d rmregular
104 diff -r a66d19b9302d rmregular
103 --- a/rmregular
105 --- a/rmregular
104 +++ /dev/null
106 +++ /dev/null
105 @@ -1,1 +0,0 @@
107 @@ -1,1 +0,0 @@
106 -rmregular
108 -rmregular
107
109
108 git=yes: git diff for single regular file
110 git=yes: git diff for single regular file
109
111
110 $ hg autodiff --git=yes regular
112 $ hg autodiff --git=yes regular
111 diff --git a/regular b/regular
113 diff --git a/regular b/regular
112 --- a/regular
114 --- a/regular
113 +++ b/regular
115 +++ b/regular
114 @@ -1,1 +1,2 @@
116 @@ -1,1 +1,2 @@
115 regular
117 regular
116 +regular
118 +regular
117
119
118 git=auto: regular diff for regular files and non-binary removals
120 git=auto: regular diff for regular files and non-binary removals
119
121
120 $ hg autodiff --git=auto regular newregular rmregular rmexec
122 $ hg autodiff --git=auto regular newregular rmregular rmexec
121 diff -r a66d19b9302d newregular
123 diff -r a66d19b9302d newregular
122 --- /dev/null
124 --- /dev/null
123 +++ b/newregular
125 +++ b/newregular
124 @@ -0,0 +1,1 @@
126 @@ -0,0 +1,1 @@
125 +newregular
127 +newregular
126 diff -r a66d19b9302d regular
128 diff -r a66d19b9302d regular
127 --- a/regular
129 --- a/regular
128 +++ b/regular
130 +++ b/regular
129 @@ -1,1 +1,2 @@
131 @@ -1,1 +1,2 @@
130 regular
132 regular
131 +regular
133 +regular
132 diff -r a66d19b9302d rmexec
134 diff -r a66d19b9302d rmexec
133 --- a/rmexec
135 --- a/rmexec
134 +++ /dev/null
136 +++ /dev/null
135 @@ -1,1 +0,0 @@
137 @@ -1,1 +0,0 @@
136 -rmexec
138 -rmexec
137 diff -r a66d19b9302d rmregular
139 diff -r a66d19b9302d rmregular
138 --- a/rmregular
140 --- a/rmregular
139 +++ /dev/null
141 +++ /dev/null
140 @@ -1,1 +0,0 @@
142 @@ -1,1 +0,0 @@
141 -rmregular
143 -rmregular
142
144
143 $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty rmbinary bintoregular; do
145 $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty rmbinary bintoregular; do
144 > echo
146 > echo
145 > echo '% git=auto: git diff for' $f
147 > echo '% git=auto: git diff for' $f
146 > hg autodiff --git=auto $f
148 > hg autodiff --git=auto $f
147 > done
149 > done
148
150
149 % git=auto: git diff for exec
151 % git=auto: git diff for exec
150 diff -r a66d19b9302d exec
152 diff -r a66d19b9302d exec
151 --- a/exec
153 --- a/exec
152 +++ b/exec
154 +++ b/exec
153 @@ -1,1 +1,2 @@
155 @@ -1,1 +1,2 @@
154 exec
156 exec
155 +exec
157 +exec
156
158
157 % git=auto: git diff for newexec
159 % git=auto: git diff for newexec
158 diff --git a/newexec b/newexec
160 diff --git a/newexec b/newexec
159 new file mode 100755
161 new file mode 100755
160 --- /dev/null
162 --- /dev/null
161 +++ b/newexec
163 +++ b/newexec
162 @@ -0,0 +1,1 @@
164 @@ -0,0 +1,1 @@
163 +newexec
165 +newexec
164
166
165 % git=auto: git diff for setexec
167 % git=auto: git diff for setexec
166 diff --git a/setexec b/setexec
168 diff --git a/setexec b/setexec
167 old mode 100644
169 old mode 100644
168 new mode 100755
170 new mode 100755
169
171
170 % git=auto: git diff for unsetexec
172 % git=auto: git diff for unsetexec
171 diff --git a/unsetexec b/unsetexec
173 diff --git a/unsetexec b/unsetexec
172 old mode 100755
174 old mode 100755
173 new mode 100644
175 new mode 100644
174
176
175 % git=auto: git diff for binary
177 % git=auto: git diff for binary
176 diff --git a/binary b/binary
178 diff --git a/binary b/binary
177 index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
179 index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
178 GIT binary patch
180 GIT binary patch
179 literal 2
181 literal 2
180 Jc${Nk0000200961
182 Jc${Nk0000200961
181
183
182
184
183 % git=auto: git diff for newbinary
185 % git=auto: git diff for newbinary
184 diff --git a/newbinary b/newbinary
186 diff --git a/newbinary b/newbinary
185 new file mode 100644
187 new file mode 100644
186 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f76dd238ade08917e6712764a16a22005a50573d
188 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f76dd238ade08917e6712764a16a22005a50573d
187 GIT binary patch
189 GIT binary patch
188 literal 1
190 literal 1
189 Ic${MZ000310RR91
191 Ic${MZ000310RR91
190
192
191
193
192 % git=auto: git diff for newempty
194 % git=auto: git diff for newempty
193 diff --git a/newempty b/newempty
195 diff --git a/newempty b/newempty
194 new file mode 100644
196 new file mode 100644
195
197
196 % git=auto: git diff for rmempty
198 % git=auto: git diff for rmempty
197 diff --git a/rmempty b/rmempty
199 diff --git a/rmempty b/rmempty
198 deleted file mode 100644
200 deleted file mode 100644
199
201
200 % git=auto: git diff for rmbinary
202 % git=auto: git diff for rmbinary
201 diff --git a/rmbinary b/rmbinary
203 diff --git a/rmbinary b/rmbinary
202 deleted file mode 100644
204 deleted file mode 100644
203 index f76dd238ade08917e6712764a16a22005a50573d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
205 index f76dd238ade08917e6712764a16a22005a50573d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
204 GIT binary patch
206 GIT binary patch
205 literal 0
207 literal 0
206 Hc$@<O00001
208 Hc$@<O00001
207
209
208
210
209 % git=auto: git diff for bintoregular
211 % git=auto: git diff for bintoregular
210 diff --git a/bintoregular b/bintoregular
212 diff --git a/bintoregular b/bintoregular
211 index f76dd238ade08917e6712764a16a22005a50573d..9c42f2b6427d8bf034b7bc23986152dc01bfd3ab
213 index f76dd238ade08917e6712764a16a22005a50573d..9c42f2b6427d8bf034b7bc23986152dc01bfd3ab
212 GIT binary patch
214 GIT binary patch
213 literal 13
215 literal 13
214 Uc$`bh%qz(+N=+}#Ni5<5043uE82|tP
216 Uc$`bh%qz(+N=+}#Ni5<5043uE82|tP
215
217
216
218
217
219
218 git=warn: regular diff with data loss warnings
220 git=warn: regular diff with data loss warnings
219
221
220 $ hg autodiff --git=warn
222 $ hg autodiff --git=warn
221 diff -r a66d19b9302d binary
223 diff -r a66d19b9302d binary
222 Binary file binary has changed
224 Binary file binary has changed
223 diff -r a66d19b9302d bintoregular
225 diff -r a66d19b9302d bintoregular
224 Binary file bintoregular has changed
226 Binary file bintoregular has changed
225 diff -r a66d19b9302d exec
227 diff -r a66d19b9302d exec
226 --- a/exec
228 --- a/exec
227 +++ b/exec
229 +++ b/exec
228 @@ -1,1 +1,2 @@
230 @@ -1,1 +1,2 @@
229 exec
231 exec
230 +exec
232 +exec
231 diff -r a66d19b9302d newbinary
233 diff -r a66d19b9302d newbinary
232 Binary file newbinary has changed
234 Binary file newbinary has changed
233 diff -r a66d19b9302d newexec
235 diff -r a66d19b9302d newexec
234 --- /dev/null
236 --- /dev/null
235 +++ b/newexec
237 +++ b/newexec
236 @@ -0,0 +1,1 @@
238 @@ -0,0 +1,1 @@
237 +newexec
239 +newexec
238 diff -r a66d19b9302d newregular
240 diff -r a66d19b9302d newregular
239 --- /dev/null
241 --- /dev/null
240 +++ b/newregular
242 +++ b/newregular
241 @@ -0,0 +1,1 @@
243 @@ -0,0 +1,1 @@
242 +newregular
244 +newregular
243 diff -r a66d19b9302d regular
245 diff -r a66d19b9302d regular
244 --- a/regular
246 --- a/regular
245 +++ b/regular
247 +++ b/regular
246 @@ -1,1 +1,2 @@
248 @@ -1,1 +1,2 @@
247 regular
249 regular
248 +regular
250 +regular
249 diff -r a66d19b9302d rmbinary
251 diff -r a66d19b9302d rmbinary
250 Binary file rmbinary has changed
252 Binary file rmbinary has changed
251 diff -r a66d19b9302d rmexec
253 diff -r a66d19b9302d rmexec
252 --- a/rmexec
254 --- a/rmexec
253 +++ /dev/null
255 +++ /dev/null
254 @@ -1,1 +0,0 @@
256 @@ -1,1 +0,0 @@
255 -rmexec
257 -rmexec
256 diff -r a66d19b9302d rmregular
258 diff -r a66d19b9302d rmregular
257 --- a/rmregular
259 --- a/rmregular
258 +++ /dev/null
260 +++ /dev/null
259 @@ -1,1 +0,0 @@
261 @@ -1,1 +0,0 @@
260 -rmregular
262 -rmregular
261 data lost for: binary
263 data lost for: binary
262 data lost for: bintoregular
264 data lost for: bintoregular
263 data lost for: newbinary
265 data lost for: newbinary
264 data lost for: newempty
266 data lost for: newempty
265 data lost for: newexec
267 data lost for: newexec
266 data lost for: rmbinary
268 data lost for: rmbinary
267 data lost for: rmempty
269 data lost for: rmempty
268 data lost for: setexec
270 data lost for: setexec
269 data lost for: unsetexec
271 data lost for: unsetexec
270
272
271 git=abort: fail on execute bit change
273 git=abort: fail on execute bit change
272
274
273 $ hg autodiff --git=abort regular setexec
275 $ hg autodiff --git=abort regular setexec
274 abort: losing data for setexec
276 abort: losing data for setexec
275 [255]
277 [255]
276
278
277 git=abort: succeed on regular file
279 git=abort: succeed on regular file
278
280
279 $ hg autodiff --git=abort regular
281 $ hg autodiff --git=abort regular
280 diff -r a66d19b9302d regular
282 diff -r a66d19b9302d regular
281 --- a/regular
283 --- a/regular
282 +++ b/regular
284 +++ b/regular
283 @@ -1,1 +1,2 @@
285 @@ -1,1 +1,2 @@
284 regular
286 regular
285 +regular
287 +regular
286
288
287 $ cd ..
289 $ cd ..
288
290
@@ -1,543 +1,545 b''
1 Test EOL extension
1 Test EOL extension
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [diff]
4 > [diff]
5 > git = True
5 > git = True
6 > EOF
6 > EOF
7
7
8 Set up helpers
8 Set up helpers
9
9
10 $ cat > switch-eol.py <<EOF
10 $ cat > switch-eol.py <<EOF
11 > import sys
11 > import sys
12 > try:
12 > try:
13 > import os, msvcrt
13 > import os, msvcrt
14 > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
14 > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
15 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
15 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
16 > except ImportError:
16 > except ImportError:
17 > pass
17 > pass
18 > (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n')
18 > (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n')
19 > print "%% switching encoding from %r to %r" % (old, new)
19 > print "%% switching encoding from %r to %r" % (old, new)
20 > for path in sys.argv[2:]:
20 > for path in sys.argv[2:]:
21 > data = file(path, 'rb').read()
21 > data = file(path, 'rb').read()
22 > data = data.replace(old, new)
22 > data = data.replace(old, new)
23 > file(path, 'wb').write(data)
23 > file(path, 'wb').write(data)
24 > EOF
24 > EOF
25
25
26 $ seteol () {
26 $ seteol () {
27 > if [ $1 = "LF" ]; then
27 > if [ $1 = "LF" ]; then
28 > EOL='\n'
28 > EOL='\n'
29 > else
29 > else
30 > EOL='\r\n'
30 > EOL='\r\n'
31 > fi
31 > fi
32 > }
32 > }
33
33
34 $ makerepo () {
34 $ makerepo () {
35 > seteol $1
35 > seteol $1
36 > echo "% setup $1 repository"
36 > echo "% setup $1 repository"
37 > hg init repo
37 > hg init repo
38 > cd repo
38 > cd repo
39 > cat > .hgeol <<EOF
39 > cat > .hgeol <<EOF
40 > [repository]
40 > [repository]
41 > native = $1
41 > native = $1
42 > [patterns]
42 > [patterns]
43 > mixed.txt = BIN
43 > mixed.txt = BIN
44 > **.txt = native
44 > **.txt = native
45 > EOF
45 > EOF
46 > printf "first${EOL}second${EOL}third${EOL}" > a.txt
46 > printf "first${EOL}second${EOL}third${EOL}" > a.txt
47 > hg commit --addremove -m 'checkin'
47 > hg commit --addremove -m 'checkin'
48 > echo
48 > echo
49 > cd ..
49 > cd ..
50 > }
50 > }
51
51
52 $ dotest () {
52 $ dotest () {
53 > seteol $1
53 > seteol $1
54 > echo "% hg clone repo repo-$1"
54 > echo "% hg clone repo repo-$1"
55 > hg clone --noupdate repo repo-$1
55 > hg clone --noupdate repo repo-$1
56 > cd repo-$1
56 > cd repo-$1
57 > cat > .hg/hgrc <<EOF
57 > cat > .hg/hgrc <<EOF
58 > [extensions]
58 > [extensions]
59 > eol =
59 > eol =
60 > [eol]
60 > [eol]
61 > native = $1
61 > native = $1
62 > EOF
62 > EOF
63 > hg update
63 > hg update
64 > echo '% a.txt'
64 > echo '% a.txt'
65 > cat a.txt
65 > cat a.txt
66 > echo '% hg cat a.txt'
66 > echo '% hg cat a.txt'
67 > hg cat a.txt
67 > hg cat a.txt
68 > printf "fourth${EOL}" >> a.txt
68 > printf "fourth${EOL}" >> a.txt
69 > echo '% a.txt'
69 > echo '% a.txt'
70 > cat a.txt
70 > cat a.txt
71 > hg diff
71 > hg diff
72 > python ../switch-eol.py $1 a.txt
72 > python ../switch-eol.py $1 a.txt
73 > echo '% hg diff only reports a single changed line:'
73 > echo '% hg diff only reports a single changed line:'
74 > hg diff
74 > hg diff
75 > echo "% reverting back to $1 format"
75 > echo "% reverting back to $1 format"
76 > hg revert a.txt
76 > hg revert a.txt
77 > cat a.txt
77 > cat a.txt
78 > printf "first\r\nsecond\n" > mixed.txt
78 > printf "first\r\nsecond\n" > mixed.txt
79 > hg add mixed.txt
79 > hg add mixed.txt
80 > echo "% hg commit of inconsistent .txt file marked as binary (should work)"
80 > echo "% hg commit of inconsistent .txt file marked as binary (should work)"
81 > hg commit -m 'binary file'
81 > hg commit -m 'binary file'
82 > echo "% hg commit of inconsistent .txt file marked as native (should fail)"
82 > echo "% hg commit of inconsistent .txt file marked as native (should fail)"
83 > printf "first\nsecond\r\nthird\nfourth\r\n" > a.txt
83 > printf "first\nsecond\r\nthird\nfourth\r\n" > a.txt
84 > hg commit -m 'inconsistent file'
84 > hg commit -m 'inconsistent file'
85 > echo "% hg commit --config eol.only-consistent=False (should work)"
85 > echo "% hg commit --config eol.only-consistent=False (should work)"
86 > hg commit --config eol.only-consistent=False -m 'inconsistent file'
86 > hg commit --config eol.only-consistent=False -m 'inconsistent file'
87 > echo "% hg commit of binary .txt file marked as native (binary files always okay)"
87 > echo "% hg commit of binary .txt file marked as native (binary files always okay)"
88 > printf "first${EOL}\0${EOL}third${EOL}" > a.txt
88 > printf "first${EOL}\0${EOL}third${EOL}" > a.txt
89 > hg commit -m 'binary file'
89 > hg commit -m 'binary file'
90 > cd ..
90 > cd ..
91 > rm -r repo-$1
91 > rm -r repo-$1
92 > }
92 > }
93
93
94 $ makemixedrepo () {
94 $ makemixedrepo () {
95 > echo
95 > echo
96 > echo "# setup $1 repository"
96 > echo "# setup $1 repository"
97 > hg init mixed
97 > hg init mixed
98 > cd mixed
98 > cd mixed
99 > printf "foo\r\nbar\r\nbaz\r\n" > win.txt
99 > printf "foo\r\nbar\r\nbaz\r\n" > win.txt
100 > printf "foo\nbar\nbaz\n" > unix.txt
100 > printf "foo\nbar\nbaz\n" > unix.txt
101 > #printf "foo\r\nbar\nbaz\r\n" > mixed.txt
101 > #printf "foo\r\nbar\nbaz\r\n" > mixed.txt
102 > hg commit --addremove -m 'created mixed files'
102 > hg commit --addremove -m 'created mixed files'
103 > echo "# setting repository-native EOLs to $1"
103 > echo "# setting repository-native EOLs to $1"
104 > cat > .hgeol <<EOF
104 > cat > .hgeol <<EOF
105 > [repository]
105 > [repository]
106 > native = $1
106 > native = $1
107 > [patterns]
107 > [patterns]
108 > **.txt = native
108 > **.txt = native
109 > EOF
109 > EOF
110 > hg commit --addremove -m 'added .hgeol'
110 > hg commit --addremove -m 'added .hgeol'
111 > cd ..
111 > cd ..
112 > }
112 > }
113
113
114 $ testmixed () {
114 $ testmixed () {
115 > echo
115 > echo
116 > echo "% hg clone mixed mixed-$1"
116 > echo "% hg clone mixed mixed-$1"
117 > hg clone mixed mixed-$1
117 > hg clone mixed mixed-$1
118 > cd mixed-$1
118 > cd mixed-$1
119 > echo '% hg status (eol extension not yet activated)'
119 > echo '% hg status (eol extension not yet activated)'
120 > hg status
120 > hg status
121 > cat > .hg/hgrc <<EOF
121 > cat > .hg/hgrc <<EOF
122 > [extensions]
122 > [extensions]
123 > eol =
123 > eol =
124 > [eol]
124 > [eol]
125 > native = $1
125 > native = $1
126 > EOF
126 > EOF
127 > echo '% hg status (eol activated)'
127 > echo '% hg status (eol activated)'
128 > hg status
128 > hg status
129 > echo '% hg commit'
129 > echo '% hg commit'
130 > hg commit -m 'synchronized EOLs'
130 > hg commit -m 'synchronized EOLs'
131 > echo '% hg status'
131 > echo '% hg status'
132 > hg status
132 > hg status
133 > cd ..
133 > cd ..
134 > rm -r mixed-$1
134 > rm -r mixed-$1
135 > }
135 > }
136
136
137 Basic tests
137 Basic tests
138
138
139 $ makerepo LF
139 $ makerepo LF
140 % setup LF repository
140 % setup LF repository
141 adding .hgeol
141 adding .hgeol
142 adding a.txt
142 adding a.txt
143
143
144 $ dotest LF
144 $ dotest LF
145 % hg clone repo repo-LF
145 % hg clone repo repo-LF
146 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 % a.txt
147 % a.txt
148 first
148 first
149 second
149 second
150 third
150 third
151 % hg cat a.txt
151 % hg cat a.txt
152 first
152 first
153 second
153 second
154 third
154 third
155 % a.txt
155 % a.txt
156 first
156 first
157 second
157 second
158 third
158 third
159 fourth
159 fourth
160 diff --git a/a.txt b/a.txt
160 diff --git a/a.txt b/a.txt
161 --- a/a.txt
161 --- a/a.txt
162 +++ b/a.txt
162 +++ b/a.txt
163 @@ -1,3 +1,4 @@
163 @@ -1,3 +1,4 @@
164 first
164 first
165 second
165 second
166 third
166 third
167 +fourth
167 +fourth
168 % switching encoding from '\n' to '\r\n'
168 % switching encoding from '\n' to '\r\n'
169 % hg diff only reports a single changed line:
169 % hg diff only reports a single changed line:
170 diff --git a/a.txt b/a.txt
170 diff --git a/a.txt b/a.txt
171 --- a/a.txt
171 --- a/a.txt
172 +++ b/a.txt
172 +++ b/a.txt
173 @@ -1,3 +1,4 @@
173 @@ -1,3 +1,4 @@
174 first
174 first
175 second
175 second
176 third
176 third
177 +fourth
177 +fourth
178 % reverting back to LF format
178 % reverting back to LF format
179 first
179 first
180 second
180 second
181 third
181 third
182 % hg commit of inconsistent .txt file marked as binary (should work)
182 % hg commit of inconsistent .txt file marked as binary (should work)
183 % hg commit of inconsistent .txt file marked as native (should fail)
183 % hg commit of inconsistent .txt file marked as native (should fail)
184 abort: inconsistent newline style in a.txt
184 abort: inconsistent newline style in a.txt
185
185
186 % hg commit --config eol.only-consistent=False (should work)
186 % hg commit --config eol.only-consistent=False (should work)
187 % hg commit of binary .txt file marked as native (binary files always okay)
187 % hg commit of binary .txt file marked as native (binary files always okay)
188 $ dotest CRLF
188 $ dotest CRLF
189 % hg clone repo repo-CRLF
189 % hg clone repo repo-CRLF
190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 % a.txt
191 % a.txt
192 first\r (esc)
192 first\r (esc)
193 second\r (esc)
193 second\r (esc)
194 third\r (esc)
194 third\r (esc)
195 % hg cat a.txt
195 % hg cat a.txt
196 first
196 first
197 second
197 second
198 third
198 third
199 % a.txt
199 % a.txt
200 first\r (esc)
200 first\r (esc)
201 second\r (esc)
201 second\r (esc)
202 third\r (esc)
202 third\r (esc)
203 fourth\r (esc)
203 fourth\r (esc)
204 diff --git a/a.txt b/a.txt
204 diff --git a/a.txt b/a.txt
205 --- a/a.txt
205 --- a/a.txt
206 +++ b/a.txt
206 +++ b/a.txt
207 @@ -1,3 +1,4 @@
207 @@ -1,3 +1,4 @@
208 first
208 first
209 second
209 second
210 third
210 third
211 +fourth
211 +fourth
212 % switching encoding from '\r\n' to '\n'
212 % switching encoding from '\r\n' to '\n'
213 % hg diff only reports a single changed line:
213 % hg diff only reports a single changed line:
214 diff --git a/a.txt b/a.txt
214 diff --git a/a.txt b/a.txt
215 --- a/a.txt
215 --- a/a.txt
216 +++ b/a.txt
216 +++ b/a.txt
217 @@ -1,3 +1,4 @@
217 @@ -1,3 +1,4 @@
218 first
218 first
219 second
219 second
220 third
220 third
221 +fourth
221 +fourth
222 % reverting back to CRLF format
222 % reverting back to CRLF format
223 first\r (esc)
223 first\r (esc)
224 second\r (esc)
224 second\r (esc)
225 third\r (esc)
225 third\r (esc)
226 % hg commit of inconsistent .txt file marked as binary (should work)
226 % hg commit of inconsistent .txt file marked as binary (should work)
227 % hg commit of inconsistent .txt file marked as native (should fail)
227 % hg commit of inconsistent .txt file marked as native (should fail)
228 abort: inconsistent newline style in a.txt
228 abort: inconsistent newline style in a.txt
229
229
230 % hg commit --config eol.only-consistent=False (should work)
230 % hg commit --config eol.only-consistent=False (should work)
231 % hg commit of binary .txt file marked as native (binary files always okay)
231 % hg commit of binary .txt file marked as native (binary files always okay)
232 $ rm -r repo
232 $ rm -r repo
233 $ makerepo CRLF
233 $ makerepo CRLF
234 % setup CRLF repository
234 % setup CRLF repository
235 adding .hgeol
235 adding .hgeol
236 adding a.txt
236 adding a.txt
237
237
238 $ dotest LF
238 $ dotest LF
239 % hg clone repo repo-LF
239 % hg clone repo repo-LF
240 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
240 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 % a.txt
241 % a.txt
242 first
242 first
243 second
243 second
244 third
244 third
245 % hg cat a.txt
245 % hg cat a.txt
246 first\r (esc)
246 first\r (esc)
247 second\r (esc)
247 second\r (esc)
248 third\r (esc)
248 third\r (esc)
249 % a.txt
249 % a.txt
250 first
250 first
251 second
251 second
252 third
252 third
253 fourth
253 fourth
254 diff --git a/a.txt b/a.txt
254 diff --git a/a.txt b/a.txt
255 --- a/a.txt
255 --- a/a.txt
256 +++ b/a.txt
256 +++ b/a.txt
257 @@ -1,3 +1,4 @@
257 @@ -1,3 +1,4 @@
258 first\r (esc)
258 first\r (esc)
259 second\r (esc)
259 second\r (esc)
260 third\r (esc)
260 third\r (esc)
261 +fourth\r (esc)
261 +fourth\r (esc)
262 % switching encoding from '\n' to '\r\n'
262 % switching encoding from '\n' to '\r\n'
263 % hg diff only reports a single changed line:
263 % hg diff only reports a single changed line:
264 diff --git a/a.txt b/a.txt
264 diff --git a/a.txt b/a.txt
265 --- a/a.txt
265 --- a/a.txt
266 +++ b/a.txt
266 +++ b/a.txt
267 @@ -1,3 +1,4 @@
267 @@ -1,3 +1,4 @@
268 first\r (esc)
268 first\r (esc)
269 second\r (esc)
269 second\r (esc)
270 third\r (esc)
270 third\r (esc)
271 +fourth\r (esc)
271 +fourth\r (esc)
272 % reverting back to LF format
272 % reverting back to LF format
273 first
273 first
274 second
274 second
275 third
275 third
276 % hg commit of inconsistent .txt file marked as binary (should work)
276 % hg commit of inconsistent .txt file marked as binary (should work)
277 % hg commit of inconsistent .txt file marked as native (should fail)
277 % hg commit of inconsistent .txt file marked as native (should fail)
278 abort: inconsistent newline style in a.txt
278 abort: inconsistent newline style in a.txt
279
279
280 % hg commit --config eol.only-consistent=False (should work)
280 % hg commit --config eol.only-consistent=False (should work)
281 % hg commit of binary .txt file marked as native (binary files always okay)
281 % hg commit of binary .txt file marked as native (binary files always okay)
282 $ dotest CRLF
282 $ dotest CRLF
283 % hg clone repo repo-CRLF
283 % hg clone repo repo-CRLF
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
285 % a.txt
285 % a.txt
286 first\r (esc)
286 first\r (esc)
287 second\r (esc)
287 second\r (esc)
288 third\r (esc)
288 third\r (esc)
289 % hg cat a.txt
289 % hg cat a.txt
290 first\r (esc)
290 first\r (esc)
291 second\r (esc)
291 second\r (esc)
292 third\r (esc)
292 third\r (esc)
293 % a.txt
293 % a.txt
294 first\r (esc)
294 first\r (esc)
295 second\r (esc)
295 second\r (esc)
296 third\r (esc)
296 third\r (esc)
297 fourth\r (esc)
297 fourth\r (esc)
298 diff --git a/a.txt b/a.txt
298 diff --git a/a.txt b/a.txt
299 --- a/a.txt
299 --- a/a.txt
300 +++ b/a.txt
300 +++ b/a.txt
301 @@ -1,3 +1,4 @@
301 @@ -1,3 +1,4 @@
302 first\r (esc)
302 first\r (esc)
303 second\r (esc)
303 second\r (esc)
304 third\r (esc)
304 third\r (esc)
305 +fourth\r (esc)
305 +fourth\r (esc)
306 % switching encoding from '\r\n' to '\n'
306 % switching encoding from '\r\n' to '\n'
307 % hg diff only reports a single changed line:
307 % hg diff only reports a single changed line:
308 diff --git a/a.txt b/a.txt
308 diff --git a/a.txt b/a.txt
309 --- a/a.txt
309 --- a/a.txt
310 +++ b/a.txt
310 +++ b/a.txt
311 @@ -1,3 +1,4 @@
311 @@ -1,3 +1,4 @@
312 first\r (esc)
312 first\r (esc)
313 second\r (esc)
313 second\r (esc)
314 third\r (esc)
314 third\r (esc)
315 +fourth\r (esc)
315 +fourth\r (esc)
316 % reverting back to CRLF format
316 % reverting back to CRLF format
317 first\r (esc)
317 first\r (esc)
318 second\r (esc)
318 second\r (esc)
319 third\r (esc)
319 third\r (esc)
320 % hg commit of inconsistent .txt file marked as binary (should work)
320 % hg commit of inconsistent .txt file marked as binary (should work)
321 % hg commit of inconsistent .txt file marked as native (should fail)
321 % hg commit of inconsistent .txt file marked as native (should fail)
322 abort: inconsistent newline style in a.txt
322 abort: inconsistent newline style in a.txt
323
323
324 % hg commit --config eol.only-consistent=False (should work)
324 % hg commit --config eol.only-consistent=False (should work)
325 % hg commit of binary .txt file marked as native (binary files always okay)
325 % hg commit of binary .txt file marked as native (binary files always okay)
326 $ rm -r repo
326 $ rm -r repo
327
327
328 Mixed tests
328 Mixed tests
329
329
330 $ makemixedrepo LF
330 $ makemixedrepo LF
331
331
332 # setup LF repository
332 # setup LF repository
333 adding unix.txt
333 adding unix.txt
334 adding win.txt
334 adding win.txt
335 # setting repository-native EOLs to LF
335 # setting repository-native EOLs to LF
336 adding .hgeol
336 adding .hgeol
337 $ testmixed LF
337 $ testmixed LF
338
338
339 % hg clone mixed mixed-LF
339 % hg clone mixed mixed-LF
340 updating to branch default
340 updating to branch default
341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 % hg status (eol extension not yet activated)
342 % hg status (eol extension not yet activated)
343 % hg status (eol activated)
343 % hg status (eol activated)
344 M win.txt
344 M win.txt
345 % hg commit
345 % hg commit
346 % hg status
346 % hg status
347 $ testmixed CRLF
347 $ testmixed CRLF
348
348
349 % hg clone mixed mixed-CRLF
349 % hg clone mixed mixed-CRLF
350 updating to branch default
350 updating to branch default
351 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
351 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
352 % hg status (eol extension not yet activated)
352 % hg status (eol extension not yet activated)
353 % hg status (eol activated)
353 % hg status (eol activated)
354 M win.txt
354 M win.txt
355 % hg commit
355 % hg commit
356 % hg status
356 % hg status
357 $ rm -r mixed
357 $ rm -r mixed
358 $ makemixedrepo CRLF
358 $ makemixedrepo CRLF
359
359
360 # setup CRLF repository
360 # setup CRLF repository
361 adding unix.txt
361 adding unix.txt
362 adding win.txt
362 adding win.txt
363 # setting repository-native EOLs to CRLF
363 # setting repository-native EOLs to CRLF
364 adding .hgeol
364 adding .hgeol
365 $ testmixed LF
365 $ testmixed LF
366
366
367 % hg clone mixed mixed-LF
367 % hg clone mixed mixed-LF
368 updating to branch default
368 updating to branch default
369 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
369 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
370 % hg status (eol extension not yet activated)
370 % hg status (eol extension not yet activated)
371 % hg status (eol activated)
371 % hg status (eol activated)
372 M unix.txt
372 M unix.txt
373 % hg commit
373 % hg commit
374 % hg status
374 % hg status
375 $ testmixed CRLF
375 $ testmixed CRLF
376
376
377 % hg clone mixed mixed-CRLF
377 % hg clone mixed mixed-CRLF
378 updating to branch default
378 updating to branch default
379 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
379 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 % hg status (eol extension not yet activated)
380 % hg status (eol extension not yet activated)
381 % hg status (eol activated)
381 % hg status (eol activated)
382 M unix.txt
382 M unix.txt
383 % hg commit
383 % hg commit
384 % hg status
384 % hg status
385 $ rm -r mixed
385 $ rm -r mixed
386
386
387 $ echo '[extensions]' >> $HGRCPATH
387 $ echo '[extensions]' >> $HGRCPATH
388 $ echo 'eol =' >> $HGRCPATH
388 $ echo 'eol =' >> $HGRCPATH
389
389
390 #if unix-permissions
390 #if unix-permissions
391
391
392 Test issue2569 -- eol extension takes write lock on reading:
392 Test issue2569 -- eol extension takes write lock on reading:
393
393
394 $ hg init repo
394 $ hg init repo
395 $ cd repo
395 $ cd repo
396 $ touch .hgeol
396 $ touch .hgeol
397 $ hg status
397 $ hg status
398 ? .hgeol
398 ? .hgeol
399 $ chmod -R -w .hg
399 $ chmod -R -w .hg
400 $ sleep 1
400 $ sleep 1
401 $ touch .hgeol
401 $ touch .hgeol
402 $ hg status --traceback
402 $ hg status --traceback
403 ? .hgeol
403 ? .hgeol
404 $ chmod -R u+w .hg
404 $ chmod -R u+w .hg
405 $ cd ..
405 $ cd ..
406
406
407 #endif
407 #endif
408
408
409 Test cleverencode: and cleverdecode: aliases for win32text extension
409 Test cleverencode: and cleverdecode: aliases for win32text extension
410
410
411 $ echo '[encode]' >> $HGRCPATH
411 $ cat <<EOF >> $HGRCPATH
412 $ echo '**.txt = cleverencode:' >> $HGRCPATH
412 > [encode]
413 $ echo '[decode]' >> $HGRCPATH
413 > **.txt = cleverencode:
414 $ echo '**.txt = cleverdecode:' >> $HGRCPATH
414 > [decode]
415 > **.txt = cleverdecode:
416 > EOF
415
417
416 $ hg init win32compat
418 $ hg init win32compat
417 $ cd win32compat
419 $ cd win32compat
418 $ printf "foo\r\nbar\r\nbaz\r\n" > win.txt
420 $ printf "foo\r\nbar\r\nbaz\r\n" > win.txt
419 $ printf "foo\nbar\nbaz\n" > unix.txt
421 $ printf "foo\nbar\nbaz\n" > unix.txt
420 $ hg add
422 $ hg add
421 adding unix.txt
423 adding unix.txt
422 adding win.txt
424 adding win.txt
423 $ hg commit -m checkin
425 $ hg commit -m checkin
424
426
425 Check that both files have LF line-endings in the repository:
427 Check that both files have LF line-endings in the repository:
426
428
427 $ hg cat win.txt
429 $ hg cat win.txt
428 foo
430 foo
429 bar
431 bar
430 baz
432 baz
431 $ hg cat unix.txt
433 $ hg cat unix.txt
432 foo
434 foo
433 bar
435 bar
434 baz
436 baz
435
437
436 Test handling of a broken .hgeol file:
438 Test handling of a broken .hgeol file:
437
439
438 $ touch .hgeol
440 $ touch .hgeol
439 $ hg add .hgeol
441 $ hg add .hgeol
440 $ hg commit -m 'clean version'
442 $ hg commit -m 'clean version'
441 $ echo "bad" > .hgeol
443 $ echo "bad" > .hgeol
442 $ hg status
444 $ hg status
443 warning: ignoring .hgeol file due to parse error at .hgeol:1: bad
445 warning: ignoring .hgeol file due to parse error at .hgeol:1: bad
444 M .hgeol
446 M .hgeol
445 $ hg revert .hgeol
447 $ hg revert .hgeol
446 warning: ignoring .hgeol file due to parse error at .hgeol:1: bad
448 warning: ignoring .hgeol file due to parse error at .hgeol:1: bad
447 $ hg status
449 $ hg status
448 ? .hgeol.orig
450 ? .hgeol.orig
449
451
450 Test eol.only-consistent can be specified in .hgeol
452 Test eol.only-consistent can be specified in .hgeol
451
453
452 $ cd $TESTTMP
454 $ cd $TESTTMP
453 $ hg init only-consistent
455 $ hg init only-consistent
454 $ cd only-consistent
456 $ cd only-consistent
455 $ printf "first\nsecond\r\n" > a.txt
457 $ printf "first\nsecond\r\n" > a.txt
456 $ hg add a.txt
458 $ hg add a.txt
457 $ cat > .hgeol << EOF
459 $ cat > .hgeol << EOF
458 > [eol]
460 > [eol]
459 > only-consistent = True
461 > only-consistent = True
460 > EOF
462 > EOF
461 $ hg commit -m 'inconsistent'
463 $ hg commit -m 'inconsistent'
462 abort: inconsistent newline style in a.txt
464 abort: inconsistent newline style in a.txt
463
465
464 [255]
466 [255]
465 $ cat > .hgeol << EOF
467 $ cat > .hgeol << EOF
466 > [eol]
468 > [eol]
467 > only-consistent = False
469 > only-consistent = False
468 > EOF
470 > EOF
469 $ hg commit -m 'consistent'
471 $ hg commit -m 'consistent'
470
472
471
473
472 Test trailing newline
474 Test trailing newline
473
475
474 $ cat >> $HGRCPATH <<EOF
476 $ cat >> $HGRCPATH <<EOF
475 > [extensions]
477 > [extensions]
476 > eol=
478 > eol=
477 > EOF
479 > EOF
478
480
479 setup repository
481 setup repository
480
482
481 $ cd $TESTTMP
483 $ cd $TESTTMP
482 $ hg init trailing
484 $ hg init trailing
483 $ cd trailing
485 $ cd trailing
484 $ cat > .hgeol <<EOF
486 $ cat > .hgeol <<EOF
485 > [patterns]
487 > [patterns]
486 > **.txt = native
488 > **.txt = native
487 > [eol]
489 > [eol]
488 > fix-trailing-newline = False
490 > fix-trailing-newline = False
489 > EOF
491 > EOF
490
492
491 add text without trailing newline
493 add text without trailing newline
492
494
493 $ printf "first\nsecond" > a.txt
495 $ printf "first\nsecond" > a.txt
494 $ hg commit --addremove -m 'checking in'
496 $ hg commit --addremove -m 'checking in'
495 adding .hgeol
497 adding .hgeol
496 adding a.txt
498 adding a.txt
497 $ rm a.txt
499 $ rm a.txt
498 $ hg update -C -q
500 $ hg update -C -q
499 $ cat a.txt
501 $ cat a.txt
500 first
502 first
501 second (no-eol)
503 second (no-eol)
502
504
503 $ cat > .hgeol <<EOF
505 $ cat > .hgeol <<EOF
504 > [patterns]
506 > [patterns]
505 > **.txt = native
507 > **.txt = native
506 > [eol]
508 > [eol]
507 > fix-trailing-newline = True
509 > fix-trailing-newline = True
508 > EOF
510 > EOF
509 $ printf "third\nfourth" > a.txt
511 $ printf "third\nfourth" > a.txt
510 $ hg commit -m 'checking in with newline fix'
512 $ hg commit -m 'checking in with newline fix'
511 $ rm a.txt
513 $ rm a.txt
512 $ hg update -C -q
514 $ hg update -C -q
513 $ cat a.txt
515 $ cat a.txt
514 third
516 third
515 fourth
517 fourth
516
518
517 append a line without trailing newline
519 append a line without trailing newline
518
520
519 $ printf "fifth" >> a.txt
521 $ printf "fifth" >> a.txt
520 $ hg commit -m 'adding another line line'
522 $ hg commit -m 'adding another line line'
521 $ rm a.txt
523 $ rm a.txt
522 $ hg update -C -q
524 $ hg update -C -q
523 $ cat a.txt
525 $ cat a.txt
524 third
526 third
525 fourth
527 fourth
526 fifth
528 fifth
527
529
528 amend of changesets with renamed/deleted files expose new code paths
530 amend of changesets with renamed/deleted files expose new code paths
529
531
530 $ hg mv a.txt b.txt
532 $ hg mv a.txt b.txt
531 $ hg ci --amend -q
533 $ hg ci --amend -q
532 $ hg diff -c.
534 $ hg diff -c.
533 diff --git a/a.txt b/b.txt
535 diff --git a/a.txt b/b.txt
534 rename from a.txt
536 rename from a.txt
535 rename to b.txt
537 rename to b.txt
536 --- a/a.txt
538 --- a/a.txt
537 +++ b/b.txt
539 +++ b/b.txt
538 @@ -1,2 +1,3 @@
540 @@ -1,2 +1,3 @@
539 third
541 third
540 fourth
542 fourth
541 +fifth
543 +fifth
542
544
543 $ cd ..
545 $ cd ..
@@ -1,76 +1,78 b''
1 #require eol-in-paths
1 #require eol-in-paths
2
2
3 http://mercurial.selenic.com/bts/issue352
3 http://mercurial.selenic.com/bts/issue352
4
4
5 test issue352
5 test issue352
6
6
7 $ hg init foo
7 $ hg init foo
8 $ cd foo
8 $ cd foo
9 $ A=`printf 'he\rllo'`
9 $ A=`printf 'he\rllo'`
10 $ echo foo > "$A"
10 $ echo foo > "$A"
11 $ hg add
11 $ hg add
12 adding he\r (no-eol) (esc)
12 adding he\r (no-eol) (esc)
13 llo
13 llo
14 abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
14 abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
15 [255]
15 [255]
16 $ hg ci -A -m m
16 $ hg ci -A -m m
17 adding he\r (no-eol) (esc)
17 adding he\r (no-eol) (esc)
18 llo
18 llo
19 abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
19 abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
20 [255]
20 [255]
21 $ rm "$A"
21 $ rm "$A"
22 $ echo foo > "hell
22 $ echo foo > "hell
23 > o"
23 > o"
24 $ hg add
24 $ hg add
25 adding hell
25 adding hell
26 o
26 o
27 abort: '\n' and '\r' disallowed in filenames: 'hell\no'
27 abort: '\n' and '\r' disallowed in filenames: 'hell\no'
28 [255]
28 [255]
29 $ hg ci -A -m m
29 $ hg ci -A -m m
30 adding hell
30 adding hell
31 o
31 o
32 abort: '\n' and '\r' disallowed in filenames: 'hell\no'
32 abort: '\n' and '\r' disallowed in filenames: 'hell\no'
33 [255]
33 [255]
34 $ echo foo > "$A"
34 $ echo foo > "$A"
35 $ hg debugwalk
35 $ hg debugwalk
36 f he\r (no-eol) (esc)
36 f he\r (no-eol) (esc)
37 llo he\r (no-eol) (esc)
37 llo he\r (no-eol) (esc)
38 llo
38 llo
39 f hell
39 f hell
40 o hell
40 o hell
41 o
41 o
42
42
43 $ echo bla > quickfox
43 $ echo bla > quickfox
44 $ hg add quickfox
44 $ hg add quickfox
45 $ hg ci -m 2
45 $ hg ci -m 2
46 $ A=`printf 'quick\rfox'`
46 $ A=`printf 'quick\rfox'`
47 $ hg cp quickfox "$A"
47 $ hg cp quickfox "$A"
48 abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
48 abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
49 [255]
49 [255]
50 $ hg mv quickfox "$A"
50 $ hg mv quickfox "$A"
51 abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
51 abort: '\n' and '\r' disallowed in filenames: 'quick\rfox'
52 [255]
52 [255]
53
53
54 http://mercurial.selenic.com/bts/issue2036
54 http://mercurial.selenic.com/bts/issue2036
55
55
56 $ cd ..
56 $ cd ..
57
57
58 test issue2039
58 test issue2039
59
59
60 $ hg init bar
60 $ hg init bar
61 $ cd bar
61 $ cd bar
62 $ echo "[extensions]" >> $HGRCPATH
62 $ cat <<EOF >> $HGRCPATH
63 $ echo "color=" >> $HGRCPATH
63 > [extensions]
64 $ echo "[color]" >> $HGRCPATH
64 > color =
65 $ echo "mode = ansi" >> $HGRCPATH
65 > [color]
66 > mode = ansi
67 > EOF
66 $ A=`printf 'foo\nbar'`
68 $ A=`printf 'foo\nbar'`
67 $ B=`printf 'foo\nbar.baz'`
69 $ B=`printf 'foo\nbar.baz'`
68 $ touch "$A"
70 $ touch "$A"
69 $ touch "$B"
71 $ touch "$B"
70 $ hg status --color=always
72 $ hg status --color=always
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mfoo\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mfoo\x1b[0m (esc)
72 \x1b[0;35;1;4mbar\x1b[0m (esc)
74 \x1b[0;35;1;4mbar\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mfoo\x1b[0m (esc)
75 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mfoo\x1b[0m (esc)
74 \x1b[0;35;1;4mbar.baz\x1b[0m (esc)
76 \x1b[0;35;1;4mbar.baz\x1b[0m (esc)
75
77
76 $ cd ..
78 $ cd ..
@@ -1,203 +1,205 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ touch foo
3 $ touch foo
4 $ hg add foo
4 $ hg add foo
5 $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
5 $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
6 > echo "foo-$i" >> foo
6 > echo "foo-$i" >> foo
7 > hg ci -m "foo-$i"
7 > hg ci -m "foo-$i"
8 > done
8 > done
9
9
10 $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do
10 $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do
11 > echo
11 > echo
12 > echo "# foo-$out.patch"
12 > echo "# foo-$out.patch"
13 > hg export -v -o "foo-$out.patch" 2:tip
13 > hg export -v -o "foo-$out.patch" 2:tip
14 > done
14 > done
15
15
16 # foo-%nof%N.patch
16 # foo-%nof%N.patch
17 exporting patches:
17 exporting patches:
18 foo-01of10.patch
18 foo-01of10.patch
19 foo-02of10.patch
19 foo-02of10.patch
20 foo-03of10.patch
20 foo-03of10.patch
21 foo-04of10.patch
21 foo-04of10.patch
22 foo-05of10.patch
22 foo-05of10.patch
23 foo-06of10.patch
23 foo-06of10.patch
24 foo-07of10.patch
24 foo-07of10.patch
25 foo-08of10.patch
25 foo-08of10.patch
26 foo-09of10.patch
26 foo-09of10.patch
27 foo-10of10.patch
27 foo-10of10.patch
28
28
29 # foo-%%%H.patch
29 # foo-%%%H.patch
30 exporting patches:
30 exporting patches:
31 foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch
31 foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch
32 foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch
32 foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch
33 foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch
33 foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch
34 foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch
34 foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch
35 foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch
35 foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch
36 foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch
36 foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch
37 foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch
37 foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch
38 foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch
38 foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch
39 foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch
39 foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch
40 foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch
40 foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch
41
41
42 # foo-%b-%R.patch
42 # foo-%b-%R.patch
43 exporting patches:
43 exporting patches:
44 foo-repo-2.patch
44 foo-repo-2.patch
45 foo-repo-3.patch
45 foo-repo-3.patch
46 foo-repo-4.patch
46 foo-repo-4.patch
47 foo-repo-5.patch
47 foo-repo-5.patch
48 foo-repo-6.patch
48 foo-repo-6.patch
49 foo-repo-7.patch
49 foo-repo-7.patch
50 foo-repo-8.patch
50 foo-repo-8.patch
51 foo-repo-9.patch
51 foo-repo-9.patch
52 foo-repo-10.patch
52 foo-repo-10.patch
53 foo-repo-11.patch
53 foo-repo-11.patch
54
54
55 # foo-%h.patch
55 # foo-%h.patch
56 exporting patches:
56 exporting patches:
57 foo-617188a1c80f.patch
57 foo-617188a1c80f.patch
58 foo-dd41a5ff707a.patch
58 foo-dd41a5ff707a.patch
59 foo-f95a5410f866.patch
59 foo-f95a5410f866.patch
60 foo-4346bcfde53b.patch
60 foo-4346bcfde53b.patch
61 foo-afda8c3a009c.patch
61 foo-afda8c3a009c.patch
62 foo-35284ce2b6b9.patch
62 foo-35284ce2b6b9.patch
63 foo-9688c41894e6.patch
63 foo-9688c41894e6.patch
64 foo-747d3c68f8ec.patch
64 foo-747d3c68f8ec.patch
65 foo-5f17a83f5fbd.patch
65 foo-5f17a83f5fbd.patch
66 foo-f3acbafac161.patch
66 foo-f3acbafac161.patch
67
67
68 # foo-%r.patch
68 # foo-%r.patch
69 exporting patches:
69 exporting patches:
70 foo-02.patch
70 foo-02.patch
71 foo-03.patch
71 foo-03.patch
72 foo-04.patch
72 foo-04.patch
73 foo-05.patch
73 foo-05.patch
74 foo-06.patch
74 foo-06.patch
75 foo-07.patch
75 foo-07.patch
76 foo-08.patch
76 foo-08.patch
77 foo-09.patch
77 foo-09.patch
78 foo-10.patch
78 foo-10.patch
79 foo-11.patch
79 foo-11.patch
80
80
81 # foo-%m.patch
81 # foo-%m.patch
82 exporting patches:
82 exporting patches:
83 foo-foo_2.patch
83 foo-foo_2.patch
84 foo-foo_3.patch
84 foo-foo_3.patch
85 foo-foo_4.patch
85 foo-foo_4.patch
86 foo-foo_5.patch
86 foo-foo_5.patch
87 foo-foo_6.patch
87 foo-foo_6.patch
88 foo-foo_7.patch
88 foo-foo_7.patch
89 foo-foo_8.patch
89 foo-foo_8.patch
90 foo-foo_9.patch
90 foo-foo_9.patch
91 foo-foo_10.patch
91 foo-foo_10.patch
92 foo-foo_11.patch
92 foo-foo_11.patch
93
93
94 Doing it again clobbers the files rather than appending:
94 Doing it again clobbers the files rather than appending:
95 $ hg export -v -o "foo-%m.patch" 2:3
95 $ hg export -v -o "foo-%m.patch" 2:3
96 exporting patches:
96 exporting patches:
97 foo-foo_2.patch
97 foo-foo_2.patch
98 foo-foo_3.patch
98 foo-foo_3.patch
99 $ grep HG foo-foo_2.patch | wc -l
99 $ grep HG foo-foo_2.patch | wc -l
100 \s*1 (re)
100 \s*1 (re)
101 $ grep HG foo-foo_3.patch | wc -l
101 $ grep HG foo-foo_3.patch | wc -l
102 \s*1 (re)
102 \s*1 (re)
103
103
104 Exporting 4 changesets to a file:
104 Exporting 4 changesets to a file:
105
105
106 $ hg export -o export_internal 1 2 3 4
106 $ hg export -o export_internal 1 2 3 4
107 $ grep HG export_internal | wc -l
107 $ grep HG export_internal | wc -l
108 \s*4 (re)
108 \s*4 (re)
109
109
110 Doing it again clobbers the file rather than appending:
110 Doing it again clobbers the file rather than appending:
111 $ hg export -o export_internal 1 2 3 4
111 $ hg export -o export_internal 1 2 3 4
112 $ grep HG export_internal | wc -l
112 $ grep HG export_internal | wc -l
113 \s*4 (re)
113 \s*4 (re)
114
114
115 Exporting 4 changesets to stdout:
115 Exporting 4 changesets to stdout:
116
116
117 $ hg export 1 2 3 4 | grep HG | wc -l
117 $ hg export 1 2 3 4 | grep HG | wc -l
118 \s*4 (re)
118 \s*4 (re)
119
119
120 Exporting revision -2 to a file:
120 Exporting revision -2 to a file:
121
121
122 $ hg export -- -2
122 $ hg export -- -2
123 # HG changeset patch
123 # HG changeset patch
124 # User test
124 # User test
125 # Date 0 0
125 # Date 0 0
126 # Thu Jan 01 00:00:00 1970 +0000
126 # Thu Jan 01 00:00:00 1970 +0000
127 # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd
127 # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd
128 # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f
128 # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f
129 foo-10
129 foo-10
130
130
131 diff -r 747d3c68f8ec -r 5f17a83f5fbd foo
131 diff -r 747d3c68f8ec -r 5f17a83f5fbd foo
132 --- a/foo Thu Jan 01 00:00:00 1970 +0000
132 --- a/foo Thu Jan 01 00:00:00 1970 +0000
133 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
133 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
134 @@ -8,3 +8,4 @@
134 @@ -8,3 +8,4 @@
135 foo-7
135 foo-7
136 foo-8
136 foo-8
137 foo-9
137 foo-9
138 +foo-10
138 +foo-10
139
139
140 Checking if only alphanumeric characters are used in the file name (%m option):
140 Checking if only alphanumeric characters are used in the file name (%m option):
141
141
142 $ echo "line" >> foo
142 $ echo "line" >> foo
143 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
143 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
144 $ hg export -v -o %m.patch tip
144 $ hg export -v -o %m.patch tip
145 exporting patch:
145 exporting patch:
146 ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch
146 ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch
147
147
148 Catch exporting unknown revisions (especially empty revsets, see issue3353)
148 Catch exporting unknown revisions (especially empty revsets, see issue3353)
149
149
150 $ hg export
150 $ hg export
151 # HG changeset patch
151 # HG changeset patch
152 # User test
152 # User test
153 # Date 0 0
153 # Date 0 0
154 # Thu Jan 01 00:00:00 1970 +0000
154 # Thu Jan 01 00:00:00 1970 +0000
155 # Node ID 197ecd81a57f760b54f34a58817ad5b04991fa47
155 # Node ID 197ecd81a57f760b54f34a58817ad5b04991fa47
156 # Parent f3acbafac161ec68f1598af38f794f28847ca5d3
156 # Parent f3acbafac161ec68f1598af38f794f28847ca5d3
157 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
157 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
158
158
159 diff -r f3acbafac161 -r 197ecd81a57f foo
159 diff -r f3acbafac161 -r 197ecd81a57f foo
160 --- a/foo Thu Jan 01 00:00:00 1970 +0000
160 --- a/foo Thu Jan 01 00:00:00 1970 +0000
161 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
161 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
162 @@ -10,3 +10,4 @@
162 @@ -10,3 +10,4 @@
163 foo-9
163 foo-9
164 foo-10
164 foo-10
165 foo-11
165 foo-11
166 +line
166 +line
167
167
168 $ hg export ""
168 $ hg export ""
169 hg: parse error: empty query
169 hg: parse error: empty query
170 [255]
170 [255]
171 $ hg export 999
171 $ hg export 999
172 abort: unknown revision '999'!
172 abort: unknown revision '999'!
173 [255]
173 [255]
174 $ hg export "not all()"
174 $ hg export "not all()"
175 abort: export requires at least one changeset
175 abort: export requires at least one changeset
176 [255]
176 [255]
177
177
178 Check for color output
178 Check for color output
179 $ echo "[color]" >> $HGRCPATH
179 $ cat <<EOF >> $HGRCPATH
180 $ echo "mode = ansi" >> $HGRCPATH
180 > [color]
181 $ echo "[extensions]" >> $HGRCPATH
181 > mode = ansi
182 $ echo "color=" >> $HGRCPATH
182 > [extensions]
183 > color =
184 > EOF
183
185
184 $ hg export --color always --nodates tip
186 $ hg export --color always --nodates tip
185 # HG changeset patch
187 # HG changeset patch
186 # User test
188 # User test
187 # Date 0 0
189 # Date 0 0
188 # Thu Jan 01 00:00:00 1970 +0000
190 # Thu Jan 01 00:00:00 1970 +0000
189 # Node ID * (glob)
191 # Node ID * (glob)
190 # Parent * (glob)
192 # Parent * (glob)
191 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
193 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
192
194
193 \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc)
195 \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc)
194 \x1b[0;31;1m--- a/foo\x1b[0m (esc)
196 \x1b[0;31;1m--- a/foo\x1b[0m (esc)
195 \x1b[0;32;1m+++ b/foo\x1b[0m (esc)
197 \x1b[0;32;1m+++ b/foo\x1b[0m (esc)
196 \x1b[0;35m@@ -10,3 +10,4 @@\x1b[0m (esc)
198 \x1b[0;35m@@ -10,3 +10,4 @@\x1b[0m (esc)
197 foo-9
199 foo-9
198 foo-10
200 foo-10
199 foo-11
201 foo-11
200 \x1b[0;32m+line\x1b[0m (esc)
202 \x1b[0;32m+line\x1b[0m (esc)
201
203
202
204
203 $ cd ..
205 $ cd ..
@@ -1,234 +1,236 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "extdiff=" >> $HGRCPATH
2 $ echo "extdiff=" >> $HGRCPATH
3
3
4 $ hg init a
4 $ hg init a
5 $ cd a
5 $ cd a
6 $ echo a > a
6 $ echo a > a
7 $ echo b > b
7 $ echo b > b
8 $ hg add
8 $ hg add
9 adding a
9 adding a
10 adding b
10 adding b
11
11
12 Should diff cloned directories:
12 Should diff cloned directories:
13
13
14 $ hg extdiff -o -r $opt
14 $ hg extdiff -o -r $opt
15 Only in a: a
15 Only in a: a
16 Only in a: b
16 Only in a: b
17 [1]
17 [1]
18
18
19 $ echo "[extdiff]" >> $HGRCPATH
19 $ cat <<EOF >> $HGRCPATH
20 $ echo "cmd.falabala=echo" >> $HGRCPATH
20 > [extdiff]
21 $ echo "opts.falabala=diffing" >> $HGRCPATH
21 > cmd.falabala = echo
22 $ echo "cmd.edspace=echo" >> $HGRCPATH
22 > opts.falabala = diffing
23 $ echo 'opts.edspace="name <user@example.com>"' >> $HGRCPATH
23 > cmd.edspace = echo
24 > opts.edspace = "name <user@example.com>"
25 > EOF
24
26
25 $ hg falabala
27 $ hg falabala
26 diffing a.000000000000 a
28 diffing a.000000000000 a
27 [1]
29 [1]
28
30
29 $ hg help falabala
31 $ hg help falabala
30 hg falabala [OPTION]... [FILE]...
32 hg falabala [OPTION]... [FILE]...
31
33
32 use 'echo' to diff repository (or selected files)
34 use 'echo' to diff repository (or selected files)
33
35
34 Show differences between revisions for the specified files, using the
36 Show differences between revisions for the specified files, using the
35 'echo' program.
37 'echo' program.
36
38
37 When two revision arguments are given, then changes are shown between
39 When two revision arguments are given, then changes are shown between
38 those revisions. If only one revision is specified then that revision is
40 those revisions. If only one revision is specified then that revision is
39 compared to the working directory, and, when no revisions are specified,
41 compared to the working directory, and, when no revisions are specified,
40 the working directory files are compared to its parent.
42 the working directory files are compared to its parent.
41
43
42 options ([+] can be repeated):
44 options ([+] can be repeated):
43
45
44 -o --option OPT [+] pass option to comparison program
46 -o --option OPT [+] pass option to comparison program
45 -r --rev REV [+] revision
47 -r --rev REV [+] revision
46 -c --change REV change made by revision
48 -c --change REV change made by revision
47 -I --include PATTERN [+] include names matching the given patterns
49 -I --include PATTERN [+] include names matching the given patterns
48 -X --exclude PATTERN [+] exclude names matching the given patterns
50 -X --exclude PATTERN [+] exclude names matching the given patterns
49
51
50 (some details hidden, use --verbose to show complete help)
52 (some details hidden, use --verbose to show complete help)
51
53
52 $ hg ci -d '0 0' -mtest1
54 $ hg ci -d '0 0' -mtest1
53
55
54 $ echo b >> a
56 $ echo b >> a
55 $ hg ci -d '1 0' -mtest2
57 $ hg ci -d '1 0' -mtest2
56
58
57 Should diff cloned files directly:
59 Should diff cloned files directly:
58
60
59 $ hg falabala -r 0:1
61 $ hg falabala -r 0:1
60 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
62 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
61 [1]
63 [1]
62
64
63 Test diff during merge:
65 Test diff during merge:
64
66
65 $ hg update -C 0
67 $ hg update -C 0
66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 $ echo c >> c
69 $ echo c >> c
68 $ hg add c
70 $ hg add c
69 $ hg ci -m "new branch" -d '1 0'
71 $ hg ci -m "new branch" -d '1 0'
70 created new head
72 created new head
71 $ hg merge 1
73 $ hg merge 1
72 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 (branch merge, don't forget to commit)
75 (branch merge, don't forget to commit)
74
76
75 Should diff cloned file against wc file:
77 Should diff cloned file against wc file:
76
78
77 $ hg falabala
79 $ hg falabala
78 diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob)
80 diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob)
79 [1]
81 [1]
80
82
81
83
82 Test --change option:
84 Test --change option:
83
85
84 $ hg ci -d '2 0' -mtest3
86 $ hg ci -d '2 0' -mtest3
85 $ hg falabala -c 1
87 $ hg falabala -c 1
86 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
88 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
87 [1]
89 [1]
88
90
89 Check diff are made from the first parent:
91 Check diff are made from the first parent:
90
92
91 $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
93 $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
92 diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob)
94 diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob)
93 diff-like tools yield a non-zero exit code
95 diff-like tools yield a non-zero exit code
94
96
95 #if execbit
97 #if execbit
96
98
97 Test extdiff of multiple files in tmp dir:
99 Test extdiff of multiple files in tmp dir:
98
100
99 $ hg update -C 0 > /dev/null
101 $ hg update -C 0 > /dev/null
100 $ echo changed > a
102 $ echo changed > a
101 $ echo changed > b
103 $ echo changed > b
102 $ chmod +x b
104 $ chmod +x b
103
105
104 Diff in working directory, before:
106 Diff in working directory, before:
105
107
106 $ hg diff --git
108 $ hg diff --git
107 diff --git a/a b/a
109 diff --git a/a b/a
108 --- a/a
110 --- a/a
109 +++ b/a
111 +++ b/a
110 @@ -1,1 +1,1 @@
112 @@ -1,1 +1,1 @@
111 -a
113 -a
112 +changed
114 +changed
113 diff --git a/b b/b
115 diff --git a/b b/b
114 old mode 100644
116 old mode 100644
115 new mode 100755
117 new mode 100755
116 --- a/b
118 --- a/b
117 +++ b/b
119 +++ b/b
118 @@ -1,1 +1,1 @@
120 @@ -1,1 +1,1 @@
119 -b
121 -b
120 +changed
122 +changed
121
123
122
124
123 Edit with extdiff -p:
125 Edit with extdiff -p:
124
126
125 Prepare custom diff/edit tool:
127 Prepare custom diff/edit tool:
126
128
127 $ cat > 'diff tool.py' << EOT
129 $ cat > 'diff tool.py' << EOT
128 > #!/usr/bin/env python
130 > #!/usr/bin/env python
129 > import time
131 > import time
130 > time.sleep(1) # avoid unchanged-timestamp problems
132 > time.sleep(1) # avoid unchanged-timestamp problems
131 > file('a/a', 'ab').write('edited\n')
133 > file('a/a', 'ab').write('edited\n')
132 > file('a/b', 'ab').write('edited\n')
134 > file('a/b', 'ab').write('edited\n')
133 > EOT
135 > EOT
134
136
135 $ chmod +x 'diff tool.py'
137 $ chmod +x 'diff tool.py'
136
138
137 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
139 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
138 and start tool
140 and start tool
139
141
140 $ hg extdiff -p "`pwd`/diff tool.py"
142 $ hg extdiff -p "`pwd`/diff tool.py"
141 [1]
143 [1]
142
144
143 Diff in working directory, after:
145 Diff in working directory, after:
144
146
145 $ hg diff --git
147 $ hg diff --git
146 diff --git a/a b/a
148 diff --git a/a b/a
147 --- a/a
149 --- a/a
148 +++ b/a
150 +++ b/a
149 @@ -1,1 +1,2 @@
151 @@ -1,1 +1,2 @@
150 -a
152 -a
151 +changed
153 +changed
152 +edited
154 +edited
153 diff --git a/b b/b
155 diff --git a/b b/b
154 old mode 100644
156 old mode 100644
155 new mode 100755
157 new mode 100755
156 --- a/b
158 --- a/b
157 +++ b/b
159 +++ b/b
158 @@ -1,1 +1,2 @@
160 @@ -1,1 +1,2 @@
159 -b
161 -b
160 +changed
162 +changed
161 +edited
163 +edited
162
164
163 Test extdiff with --option:
165 Test extdiff with --option:
164
166
165 $ hg extdiff -p echo -o this -c 1
167 $ hg extdiff -p echo -o this -c 1
166 this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
168 this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
167 [1]
169 [1]
168
170
169 $ hg falabala -o this -c 1
171 $ hg falabala -o this -c 1
170 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
172 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
171 [1]
173 [1]
172
174
173 Test extdiff's handling of options with spaces in them:
175 Test extdiff's handling of options with spaces in them:
174
176
175 $ hg edspace -c 1
177 $ hg edspace -c 1
176 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
178 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
177 [1]
179 [1]
178
180
179 $ hg extdiff -p echo -o "name <user@example.com>" -c 1
181 $ hg extdiff -p echo -o "name <user@example.com>" -c 1
180 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
182 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
181 [1]
183 [1]
182
184
183 Test with revsets:
185 Test with revsets:
184
186
185 $ hg extdif -p echo -c "rev(1)"
187 $ hg extdif -p echo -c "rev(1)"
186 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
188 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
187 [1]
189 [1]
188
190
189 $ hg extdif -p echo -r "0::1"
191 $ hg extdif -p echo -r "0::1"
190 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
192 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
191 [1]
193 [1]
192
194
193 Fallback to merge-tools.tool.executable|regkey
195 Fallback to merge-tools.tool.executable|regkey
194 $ mkdir dir
196 $ mkdir dir
195 $ cat > 'dir/tool.sh' << EOF
197 $ cat > 'dir/tool.sh' << EOF
196 > #!/bin/sh
198 > #!/bin/sh
197 > echo "** custom diff **"
199 > echo "** custom diff **"
198 > EOF
200 > EOF
199 $ chmod +x dir/tool.sh
201 $ chmod +x dir/tool.sh
200 $ tool=`pwd`/dir/tool.sh
202 $ tool=`pwd`/dir/tool.sh
201 $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool
203 $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool
202 making snapshot of 2 files from rev * (glob)
204 making snapshot of 2 files from rev * (glob)
203 a
205 a
204 b
206 b
205 making snapshot of 2 files from working directory
207 making snapshot of 2 files from working directory
206 a
208 a
207 b
209 b
208 running "'$TESTTMP/a/dir/tool.sh' 'a.*' 'a'" in */extdiff.* (glob)
210 running "'$TESTTMP/a/dir/tool.sh' 'a.*' 'a'" in */extdiff.* (glob)
209 ** custom diff **
211 ** custom diff **
210 cleaning up temp directory
212 cleaning up temp directory
211 [1]
213 [1]
212
214
213 $ cd ..
215 $ cd ..
214
216
215 #endif
217 #endif
216
218
217 #if symlink
219 #if symlink
218
220
219 Test symlinks handling (issue1909)
221 Test symlinks handling (issue1909)
220
222
221 $ hg init testsymlinks
223 $ hg init testsymlinks
222 $ cd testsymlinks
224 $ cd testsymlinks
223 $ echo a > a
225 $ echo a > a
224 $ hg ci -Am adda
226 $ hg ci -Am adda
225 adding a
227 adding a
226 $ echo a >> a
228 $ echo a >> a
227 $ ln -s missing linka
229 $ ln -s missing linka
228 $ hg add linka
230 $ hg add linka
229 $ hg falabala -r 0 --traceback
231 $ hg falabala -r 0 --traceback
230 diffing testsymlinks.07f494440405 testsymlinks
232 diffing testsymlinks.07f494440405 testsymlinks
231 [1]
233 [1]
232 $ cd ..
234 $ cd ..
233
235
234 #endif
236 #endif
@@ -1,909 +1,917 b''
1 Test basic extension support
1 Test basic extension support
2
2
3 $ cat > foobar.py <<EOF
3 $ cat > foobar.py <<EOF
4 > import os
4 > import os
5 > from mercurial import cmdutil, commands
5 > from mercurial import cmdutil, commands
6 > cmdtable = {}
6 > cmdtable = {}
7 > command = cmdutil.command(cmdtable)
7 > command = cmdutil.command(cmdtable)
8 > def uisetup(ui):
8 > def uisetup(ui):
9 > ui.write("uisetup called\\n")
9 > ui.write("uisetup called\\n")
10 > def reposetup(ui, repo):
10 > def reposetup(ui, repo):
11 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
11 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
12 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
12 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
13 > @command('foo', [], 'hg foo')
13 > @command('foo', [], 'hg foo')
14 > def foo(ui, *args, **kwargs):
14 > def foo(ui, *args, **kwargs):
15 > ui.write("Foo\\n")
15 > ui.write("Foo\\n")
16 > @command('bar', [], 'hg bar', norepo=True)
16 > @command('bar', [], 'hg bar', norepo=True)
17 > def bar(ui, *args, **kwargs):
17 > def bar(ui, *args, **kwargs):
18 > ui.write("Bar\\n")
18 > ui.write("Bar\\n")
19 > EOF
19 > EOF
20 $ abspath=`pwd`/foobar.py
20 $ abspath=`pwd`/foobar.py
21
21
22 $ mkdir barfoo
22 $ mkdir barfoo
23 $ cp foobar.py barfoo/__init__.py
23 $ cp foobar.py barfoo/__init__.py
24 $ barfoopath=`pwd`/barfoo
24 $ barfoopath=`pwd`/barfoo
25
25
26 $ hg init a
26 $ hg init a
27 $ cd a
27 $ cd a
28 $ echo foo > file
28 $ echo foo > file
29 $ hg add file
29 $ hg add file
30 $ hg commit -m 'add file'
30 $ hg commit -m 'add file'
31
31
32 $ echo '[extensions]' >> $HGRCPATH
32 $ echo '[extensions]' >> $HGRCPATH
33 $ echo "foobar = $abspath" >> $HGRCPATH
33 $ echo "foobar = $abspath" >> $HGRCPATH
34 $ hg foo
34 $ hg foo
35 uisetup called
35 uisetup called
36 reposetup called for a
36 reposetup called for a
37 ui == repo.ui
37 ui == repo.ui
38 Foo
38 Foo
39
39
40 $ cd ..
40 $ cd ..
41 $ hg clone a b
41 $ hg clone a b
42 uisetup called
42 uisetup called
43 reposetup called for a
43 reposetup called for a
44 ui == repo.ui
44 ui == repo.ui
45 reposetup called for b
45 reposetup called for b
46 ui == repo.ui
46 ui == repo.ui
47 updating to branch default
47 updating to branch default
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49
49
50 $ hg bar
50 $ hg bar
51 uisetup called
51 uisetup called
52 Bar
52 Bar
53 $ echo 'foobar = !' >> $HGRCPATH
53 $ echo 'foobar = !' >> $HGRCPATH
54
54
55 module/__init__.py-style
55 module/__init__.py-style
56
56
57 $ echo "barfoo = $barfoopath" >> $HGRCPATH
57 $ echo "barfoo = $barfoopath" >> $HGRCPATH
58 $ cd a
58 $ cd a
59 $ hg foo
59 $ hg foo
60 uisetup called
60 uisetup called
61 reposetup called for a
61 reposetup called for a
62 ui == repo.ui
62 ui == repo.ui
63 Foo
63 Foo
64 $ echo 'barfoo = !' >> $HGRCPATH
64 $ echo 'barfoo = !' >> $HGRCPATH
65
65
66 Check that extensions are loaded in phases:
66 Check that extensions are loaded in phases:
67
67
68 $ cat > foo.py <<EOF
68 $ cat > foo.py <<EOF
69 > import os
69 > import os
70 > name = os.path.basename(__file__).rsplit('.', 1)[0]
70 > name = os.path.basename(__file__).rsplit('.', 1)[0]
71 > print "1) %s imported" % name
71 > print "1) %s imported" % name
72 > def uisetup(ui):
72 > def uisetup(ui):
73 > print "2) %s uisetup" % name
73 > print "2) %s uisetup" % name
74 > def extsetup():
74 > def extsetup():
75 > print "3) %s extsetup" % name
75 > print "3) %s extsetup" % name
76 > def reposetup(ui, repo):
76 > def reposetup(ui, repo):
77 > print "4) %s reposetup" % name
77 > print "4) %s reposetup" % name
78 > EOF
78 > EOF
79
79
80 $ cp foo.py bar.py
80 $ cp foo.py bar.py
81 $ echo 'foo = foo.py' >> $HGRCPATH
81 $ echo 'foo = foo.py' >> $HGRCPATH
82 $ echo 'bar = bar.py' >> $HGRCPATH
82 $ echo 'bar = bar.py' >> $HGRCPATH
83
83
84 Command with no output, we just want to see the extensions loaded:
84 Command with no output, we just want to see the extensions loaded:
85
85
86 $ hg paths
86 $ hg paths
87 1) foo imported
87 1) foo imported
88 1) bar imported
88 1) bar imported
89 2) foo uisetup
89 2) foo uisetup
90 2) bar uisetup
90 2) bar uisetup
91 3) foo extsetup
91 3) foo extsetup
92 3) bar extsetup
92 3) bar extsetup
93 4) foo reposetup
93 4) foo reposetup
94 4) bar reposetup
94 4) bar reposetup
95
95
96 Check hgweb's load order:
96 Check hgweb's load order:
97
97
98 $ cat > hgweb.cgi <<EOF
98 $ cat > hgweb.cgi <<EOF
99 > #!/usr/bin/env python
99 > #!/usr/bin/env python
100 > from mercurial import demandimport; demandimport.enable()
100 > from mercurial import demandimport; demandimport.enable()
101 > from mercurial.hgweb import hgweb
101 > from mercurial.hgweb import hgweb
102 > from mercurial.hgweb import wsgicgi
102 > from mercurial.hgweb import wsgicgi
103 > application = hgweb('.', 'test repo')
103 > application = hgweb('.', 'test repo')
104 > wsgicgi.launch(application)
104 > wsgicgi.launch(application)
105 > EOF
105 > EOF
106
106
107 $ REQUEST_METHOD='GET' PATH_INFO='/' SCRIPT_NAME='' QUERY_STRING='' \
107 $ REQUEST_METHOD='GET' PATH_INFO='/' SCRIPT_NAME='' QUERY_STRING='' \
108 > SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
108 > SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
109 > | grep '^[0-9]) ' # ignores HTML output
109 > | grep '^[0-9]) ' # ignores HTML output
110 1) foo imported
110 1) foo imported
111 1) bar imported
111 1) bar imported
112 2) foo uisetup
112 2) foo uisetup
113 2) bar uisetup
113 2) bar uisetup
114 3) foo extsetup
114 3) foo extsetup
115 3) bar extsetup
115 3) bar extsetup
116 4) foo reposetup
116 4) foo reposetup
117 4) bar reposetup
117 4) bar reposetup
118 4) foo reposetup
118 4) foo reposetup
119 4) bar reposetup
119 4) bar reposetup
120
120
121 $ echo 'foo = !' >> $HGRCPATH
121 $ echo 'foo = !' >> $HGRCPATH
122 $ echo 'bar = !' >> $HGRCPATH
122 $ echo 'bar = !' >> $HGRCPATH
123
123
124 Check "from __future__ import absolute_import" support for external libraries
124 Check "from __future__ import absolute_import" support for external libraries
125
125
126 #if windows
126 #if windows
127 $ PATHSEP=";"
127 $ PATHSEP=";"
128 #else
128 #else
129 $ PATHSEP=":"
129 $ PATHSEP=":"
130 #endif
130 #endif
131 $ export PATHSEP
131 $ export PATHSEP
132
132
133 $ mkdir $TESTTMP/libroot
133 $ mkdir $TESTTMP/libroot
134 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
134 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
135 $ mkdir $TESTTMP/libroot/mod
135 $ mkdir $TESTTMP/libroot/mod
136 $ touch $TESTTMP/libroot/mod/__init__.py
136 $ touch $TESTTMP/libroot/mod/__init__.py
137 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
137 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
138
138
139 #if absimport
139 #if absimport
140 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF
140 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF
141 > from __future__ import absolute_import
141 > from __future__ import absolute_import
142 > import ambig # should load "libroot/ambig.py"
142 > import ambig # should load "libroot/ambig.py"
143 > s = ambig.s
143 > s = ambig.s
144 > EOF
144 > EOF
145 $ cat > loadabs.py <<EOF
145 $ cat > loadabs.py <<EOF
146 > import mod.ambigabs as ambigabs
146 > import mod.ambigabs as ambigabs
147 > def extsetup():
147 > def extsetup():
148 > print 'ambigabs.s=%s' % ambigabs.s
148 > print 'ambigabs.s=%s' % ambigabs.s
149 > EOF
149 > EOF
150 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
150 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
151 ambigabs.s=libroot/ambig.py
151 ambigabs.s=libroot/ambig.py
152 $TESTTMP/a (glob)
152 $TESTTMP/a (glob)
153 #endif
153 #endif
154
154
155 #if no-py3k
155 #if no-py3k
156 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
156 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
157 > import ambig # should load "libroot/mod/ambig.py"
157 > import ambig # should load "libroot/mod/ambig.py"
158 > s = ambig.s
158 > s = ambig.s
159 > EOF
159 > EOF
160 $ cat > loadrel.py <<EOF
160 $ cat > loadrel.py <<EOF
161 > import mod.ambigrel as ambigrel
161 > import mod.ambigrel as ambigrel
162 > def extsetup():
162 > def extsetup():
163 > print 'ambigrel.s=%s' % ambigrel.s
163 > print 'ambigrel.s=%s' % ambigrel.s
164 > EOF
164 > EOF
165 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
165 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
166 ambigrel.s=libroot/mod/ambig.py
166 ambigrel.s=libroot/mod/ambig.py
167 $TESTTMP/a (glob)
167 $TESTTMP/a (glob)
168 #endif
168 #endif
169
169
170 Check absolute/relative import of extension specific modules
170 Check absolute/relative import of extension specific modules
171
171
172 $ mkdir $TESTTMP/extroot
172 $ mkdir $TESTTMP/extroot
173 $ cat > $TESTTMP/extroot/bar.py <<EOF
173 $ cat > $TESTTMP/extroot/bar.py <<EOF
174 > s = 'this is extroot.bar'
174 > s = 'this is extroot.bar'
175 > EOF
175 > EOF
176 $ mkdir $TESTTMP/extroot/sub1
176 $ mkdir $TESTTMP/extroot/sub1
177 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF
177 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF
178 > s = 'this is extroot.sub1.__init__'
178 > s = 'this is extroot.sub1.__init__'
179 > EOF
179 > EOF
180 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF
180 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF
181 > s = 'this is extroot.sub1.baz'
181 > s = 'this is extroot.sub1.baz'
182 > EOF
182 > EOF
183 $ cat > $TESTTMP/extroot/__init__.py <<EOF
183 $ cat > $TESTTMP/extroot/__init__.py <<EOF
184 > s = 'this is extroot.__init__'
184 > s = 'this is extroot.__init__'
185 > import foo
185 > import foo
186 > def extsetup(ui):
186 > def extsetup(ui):
187 > ui.write('(extroot) ', foo.func(), '\n')
187 > ui.write('(extroot) ', foo.func(), '\n')
188 > EOF
188 > EOF
189
189
190 $ cat > $TESTTMP/extroot/foo.py <<EOF
190 $ cat > $TESTTMP/extroot/foo.py <<EOF
191 > # test absolute import
191 > # test absolute import
192 > buf = []
192 > buf = []
193 > def func():
193 > def func():
194 > # "not locals" case
194 > # "not locals" case
195 > import extroot.bar
195 > import extroot.bar
196 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s)
196 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s)
197 > return '\n(extroot) '.join(buf)
197 > return '\n(extroot) '.join(buf)
198 > # "fromlist == ('*',)" case
198 > # "fromlist == ('*',)" case
199 > from extroot.bar import *
199 > from extroot.bar import *
200 > buf.append('from extroot.bar import *: %s' % s)
200 > buf.append('from extroot.bar import *: %s' % s)
201 > # "not fromlist" and "if '.' in name" case
201 > # "not fromlist" and "if '.' in name" case
202 > import extroot.sub1.baz
202 > import extroot.sub1.baz
203 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
203 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
204 > # "not fromlist" and NOT "if '.' in name" case
204 > # "not fromlist" and NOT "if '.' in name" case
205 > import extroot
205 > import extroot
206 > buf.append('import extroot: %s' % extroot.s)
206 > buf.append('import extroot: %s' % extroot.s)
207 > # NOT "not fromlist" and NOT "level != -1" case
207 > # NOT "not fromlist" and NOT "level != -1" case
208 > from extroot.bar import s
208 > from extroot.bar import s
209 > buf.append('from extroot.bar import s: %s' % s)
209 > buf.append('from extroot.bar import s: %s' % s)
210 > EOF
210 > EOF
211 $ hg --config extensions.extroot=$TESTTMP/extroot root
211 $ hg --config extensions.extroot=$TESTTMP/extroot root
212 (extroot) from extroot.bar import *: this is extroot.bar
212 (extroot) from extroot.bar import *: this is extroot.bar
213 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
213 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
214 (extroot) import extroot: this is extroot.__init__
214 (extroot) import extroot: this is extroot.__init__
215 (extroot) from extroot.bar import s: this is extroot.bar
215 (extroot) from extroot.bar import s: this is extroot.bar
216 (extroot) import extroot.bar in func(): this is extroot.bar
216 (extroot) import extroot.bar in func(): this is extroot.bar
217 $TESTTMP/a (glob)
217 $TESTTMP/a (glob)
218
218
219 #if no-py3k
219 #if no-py3k
220 $ rm "$TESTTMP"/extroot/foo.*
220 $ rm "$TESTTMP"/extroot/foo.*
221 $ cat > $TESTTMP/extroot/foo.py <<EOF
221 $ cat > $TESTTMP/extroot/foo.py <<EOF
222 > # test relative import
222 > # test relative import
223 > buf = []
223 > buf = []
224 > def func():
224 > def func():
225 > # "not locals" case
225 > # "not locals" case
226 > import bar
226 > import bar
227 > buf.append('import bar in func(): %s' % bar.s)
227 > buf.append('import bar in func(): %s' % bar.s)
228 > return '\n(extroot) '.join(buf)
228 > return '\n(extroot) '.join(buf)
229 > # "fromlist == ('*',)" case
229 > # "fromlist == ('*',)" case
230 > from bar import *
230 > from bar import *
231 > buf.append('from bar import *: %s' % s)
231 > buf.append('from bar import *: %s' % s)
232 > # "not fromlist" and "if '.' in name" case
232 > # "not fromlist" and "if '.' in name" case
233 > import sub1.baz
233 > import sub1.baz
234 > buf.append('import sub1.baz: %s' % sub1.baz.s)
234 > buf.append('import sub1.baz: %s' % sub1.baz.s)
235 > # "not fromlist" and NOT "if '.' in name" case
235 > # "not fromlist" and NOT "if '.' in name" case
236 > import sub1
236 > import sub1
237 > buf.append('import sub1: %s' % sub1.s)
237 > buf.append('import sub1: %s' % sub1.s)
238 > # NOT "not fromlist" and NOT "level != -1" case
238 > # NOT "not fromlist" and NOT "level != -1" case
239 > from bar import s
239 > from bar import s
240 > buf.append('from bar import s: %s' % s)
240 > buf.append('from bar import s: %s' % s)
241 > EOF
241 > EOF
242 $ hg --config extensions.extroot=$TESTTMP/extroot root
242 $ hg --config extensions.extroot=$TESTTMP/extroot root
243 (extroot) from bar import *: this is extroot.bar
243 (extroot) from bar import *: this is extroot.bar
244 (extroot) import sub1.baz: this is extroot.sub1.baz
244 (extroot) import sub1.baz: this is extroot.sub1.baz
245 (extroot) import sub1: this is extroot.sub1.__init__
245 (extroot) import sub1: this is extroot.sub1.__init__
246 (extroot) from bar import s: this is extroot.bar
246 (extroot) from bar import s: this is extroot.bar
247 (extroot) import bar in func(): this is extroot.bar
247 (extroot) import bar in func(): this is extroot.bar
248 $TESTTMP/a (glob)
248 $TESTTMP/a (glob)
249 #endif
249 #endif
250
250
251 $ cd ..
251 $ cd ..
252
252
253 hide outer repo
253 hide outer repo
254 $ hg init
254 $ hg init
255
255
256 $ cat > empty.py <<EOF
256 $ cat > empty.py <<EOF
257 > '''empty cmdtable
257 > '''empty cmdtable
258 > '''
258 > '''
259 > cmdtable = {}
259 > cmdtable = {}
260 > EOF
260 > EOF
261 $ emptypath=`pwd`/empty.py
261 $ emptypath=`pwd`/empty.py
262 $ echo "empty = $emptypath" >> $HGRCPATH
262 $ echo "empty = $emptypath" >> $HGRCPATH
263 $ hg help empty
263 $ hg help empty
264 empty extension - empty cmdtable
264 empty extension - empty cmdtable
265
265
266 no commands defined
266 no commands defined
267
267
268
268
269 $ echo 'empty = !' >> $HGRCPATH
269 $ echo 'empty = !' >> $HGRCPATH
270
270
271 $ cat > debugextension.py <<EOF
271 $ cat > debugextension.py <<EOF
272 > '''only debugcommands
272 > '''only debugcommands
273 > '''
273 > '''
274 > from mercurial import cmdutil
274 > from mercurial import cmdutil
275 > cmdtable = {}
275 > cmdtable = {}
276 > command = cmdutil.command(cmdtable)
276 > command = cmdutil.command(cmdtable)
277 > @command('debugfoobar', [], 'hg debugfoobar')
277 > @command('debugfoobar', [], 'hg debugfoobar')
278 > def debugfoobar(ui, repo, *args, **opts):
278 > def debugfoobar(ui, repo, *args, **opts):
279 > "yet another debug command"
279 > "yet another debug command"
280 > pass
280 > pass
281 > @command('foo', [], 'hg foo')
281 > @command('foo', [], 'hg foo')
282 > def foo(ui, repo, *args, **opts):
282 > def foo(ui, repo, *args, **opts):
283 > """yet another foo command
283 > """yet another foo command
284 > This command has been DEPRECATED since forever.
284 > This command has been DEPRECATED since forever.
285 > """
285 > """
286 > pass
286 > pass
287 > EOF
287 > EOF
288 $ debugpath=`pwd`/debugextension.py
288 $ debugpath=`pwd`/debugextension.py
289 $ echo "debugextension = $debugpath" >> $HGRCPATH
289 $ echo "debugextension = $debugpath" >> $HGRCPATH
290
290
291 $ hg help debugextension
291 $ hg help debugextension
292 debugextension extension - only debugcommands
292 debugextension extension - only debugcommands
293
293
294 no commands defined
294 no commands defined
295
295
296
296
297 $ hg --verbose help debugextension
297 $ hg --verbose help debugextension
298 debugextension extension - only debugcommands
298 debugextension extension - only debugcommands
299
299
300 list of commands:
300 list of commands:
301
301
302 foo yet another foo command
302 foo yet another foo command
303
303
304 global options ([+] can be repeated):
304 global options ([+] can be repeated):
305
305
306 -R --repository REPO repository root directory or name of overlay bundle
306 -R --repository REPO repository root directory or name of overlay bundle
307 file
307 file
308 --cwd DIR change working directory
308 --cwd DIR change working directory
309 -y --noninteractive do not prompt, automatically pick the first choice for
309 -y --noninteractive do not prompt, automatically pick the first choice for
310 all prompts
310 all prompts
311 -q --quiet suppress output
311 -q --quiet suppress output
312 -v --verbose enable additional output
312 -v --verbose enable additional output
313 --config CONFIG [+] set/override config option (use 'section.name=value')
313 --config CONFIG [+] set/override config option (use 'section.name=value')
314 --debug enable debugging output
314 --debug enable debugging output
315 --debugger start debugger
315 --debugger start debugger
316 --encoding ENCODE set the charset encoding (default: ascii)
316 --encoding ENCODE set the charset encoding (default: ascii)
317 --encodingmode MODE set the charset encoding mode (default: strict)
317 --encodingmode MODE set the charset encoding mode (default: strict)
318 --traceback always print a traceback on exception
318 --traceback always print a traceback on exception
319 --time time how long the command takes
319 --time time how long the command takes
320 --profile print command execution profile
320 --profile print command execution profile
321 --version output version information and exit
321 --version output version information and exit
322 -h --help display help and exit
322 -h --help display help and exit
323 --hidden consider hidden changesets
323 --hidden consider hidden changesets
324
324
325
325
326
326
327
327
328
328
329
329
330 $ hg --debug help debugextension
330 $ hg --debug help debugextension
331 debugextension extension - only debugcommands
331 debugextension extension - only debugcommands
332
332
333 list of commands:
333 list of commands:
334
334
335 debugfoobar yet another debug command
335 debugfoobar yet another debug command
336 foo yet another foo command
336 foo yet another foo command
337
337
338 global options ([+] can be repeated):
338 global options ([+] can be repeated):
339
339
340 -R --repository REPO repository root directory or name of overlay bundle
340 -R --repository REPO repository root directory or name of overlay bundle
341 file
341 file
342 --cwd DIR change working directory
342 --cwd DIR change working directory
343 -y --noninteractive do not prompt, automatically pick the first choice for
343 -y --noninteractive do not prompt, automatically pick the first choice for
344 all prompts
344 all prompts
345 -q --quiet suppress output
345 -q --quiet suppress output
346 -v --verbose enable additional output
346 -v --verbose enable additional output
347 --config CONFIG [+] set/override config option (use 'section.name=value')
347 --config CONFIG [+] set/override config option (use 'section.name=value')
348 --debug enable debugging output
348 --debug enable debugging output
349 --debugger start debugger
349 --debugger start debugger
350 --encoding ENCODE set the charset encoding (default: ascii)
350 --encoding ENCODE set the charset encoding (default: ascii)
351 --encodingmode MODE set the charset encoding mode (default: strict)
351 --encodingmode MODE set the charset encoding mode (default: strict)
352 --traceback always print a traceback on exception
352 --traceback always print a traceback on exception
353 --time time how long the command takes
353 --time time how long the command takes
354 --profile print command execution profile
354 --profile print command execution profile
355 --version output version information and exit
355 --version output version information and exit
356 -h --help display help and exit
356 -h --help display help and exit
357 --hidden consider hidden changesets
357 --hidden consider hidden changesets
358
358
359
359
360
360
361
361
362
362
363 $ echo 'debugextension = !' >> $HGRCPATH
363 $ echo 'debugextension = !' >> $HGRCPATH
364
364
365 Extension module help vs command help:
365 Extension module help vs command help:
366
366
367 $ echo 'extdiff =' >> $HGRCPATH
367 $ echo 'extdiff =' >> $HGRCPATH
368 $ hg help extdiff
368 $ hg help extdiff
369 hg extdiff [OPT]... [FILE]...
369 hg extdiff [OPT]... [FILE]...
370
370
371 use external program to diff repository (or selected files)
371 use external program to diff repository (or selected files)
372
372
373 Show differences between revisions for the specified files, using an
373 Show differences between revisions for the specified files, using an
374 external program. The default program used is diff, with default options
374 external program. The default program used is diff, with default options
375 "-Npru".
375 "-Npru".
376
376
377 To select a different program, use the -p/--program option. The program
377 To select a different program, use the -p/--program option. The program
378 will be passed the names of two directories to compare. To pass additional
378 will be passed the names of two directories to compare. To pass additional
379 options to the program, use -o/--option. These will be passed before the
379 options to the program, use -o/--option. These will be passed before the
380 names of the directories to compare.
380 names of the directories to compare.
381
381
382 When two revision arguments are given, then changes are shown between
382 When two revision arguments are given, then changes are shown between
383 those revisions. If only one revision is specified then that revision is
383 those revisions. If only one revision is specified then that revision is
384 compared to the working directory, and, when no revisions are specified,
384 compared to the working directory, and, when no revisions are specified,
385 the working directory files are compared to its parent.
385 the working directory files are compared to its parent.
386
386
387 (use "hg help -e extdiff" to show help for the extdiff extension)
387 (use "hg help -e extdiff" to show help for the extdiff extension)
388
388
389 options ([+] can be repeated):
389 options ([+] can be repeated):
390
390
391 -p --program CMD comparison program to run
391 -p --program CMD comparison program to run
392 -o --option OPT [+] pass option to comparison program
392 -o --option OPT [+] pass option to comparison program
393 -r --rev REV [+] revision
393 -r --rev REV [+] revision
394 -c --change REV change made by revision
394 -c --change REV change made by revision
395 -I --include PATTERN [+] include names matching the given patterns
395 -I --include PATTERN [+] include names matching the given patterns
396 -X --exclude PATTERN [+] exclude names matching the given patterns
396 -X --exclude PATTERN [+] exclude names matching the given patterns
397
397
398 (some details hidden, use --verbose to show complete help)
398 (some details hidden, use --verbose to show complete help)
399
399
400
400
401
401
402
402
403
403
404
404
405
405
406
406
407
407
408
408
409 $ hg help --extension extdiff
409 $ hg help --extension extdiff
410 extdiff extension - command to allow external programs to compare revisions
410 extdiff extension - command to allow external programs to compare revisions
411
411
412 The extdiff Mercurial extension allows you to use external programs to compare
412 The extdiff Mercurial extension allows you to use external programs to compare
413 revisions, or revision with working directory. The external diff programs are
413 revisions, or revision with working directory. The external diff programs are
414 called with a configurable set of options and two non-option arguments: paths
414 called with a configurable set of options and two non-option arguments: paths
415 to directories containing snapshots of files to compare.
415 to directories containing snapshots of files to compare.
416
416
417 The extdiff extension also allows you to configure new diff commands, so you
417 The extdiff extension also allows you to configure new diff commands, so you
418 do not need to type "hg extdiff -p kdiff3" always.
418 do not need to type "hg extdiff -p kdiff3" always.
419
419
420 [extdiff]
420 [extdiff]
421 # add new command that runs GNU diff(1) in 'context diff' mode
421 # add new command that runs GNU diff(1) in 'context diff' mode
422 cdiff = gdiff -Nprc5
422 cdiff = gdiff -Nprc5
423 ## or the old way:
423 ## or the old way:
424 #cmd.cdiff = gdiff
424 #cmd.cdiff = gdiff
425 #opts.cdiff = -Nprc5
425 #opts.cdiff = -Nprc5
426
426
427 # add new command called meld, runs meld (no need to name twice). If
427 # add new command called meld, runs meld (no need to name twice). If
428 # the meld executable is not available, the meld tool in [merge-tools]
428 # the meld executable is not available, the meld tool in [merge-tools]
429 # will be used, if available
429 # will be used, if available
430 meld =
430 meld =
431
431
432 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
432 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
433 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
433 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
434 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
434 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
435 # your .vimrc
435 # your .vimrc
436 vimdiff = gvim -f "+next" \
436 vimdiff = gvim -f "+next" \
437 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
437 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
438
438
439 Tool arguments can include variables that are expanded at runtime:
439 Tool arguments can include variables that are expanded at runtime:
440
440
441 $parent1, $plabel1 - filename, descriptive label of first parent
441 $parent1, $plabel1 - filename, descriptive label of first parent
442 $child, $clabel - filename, descriptive label of child revision
442 $child, $clabel - filename, descriptive label of child revision
443 $parent2, $plabel2 - filename, descriptive label of second parent
443 $parent2, $plabel2 - filename, descriptive label of second parent
444 $root - repository root
444 $root - repository root
445 $parent is an alias for $parent1.
445 $parent is an alias for $parent1.
446
446
447 The extdiff extension will look in your [diff-tools] and [merge-tools]
447 The extdiff extension will look in your [diff-tools] and [merge-tools]
448 sections for diff tool arguments, when none are specified in [extdiff].
448 sections for diff tool arguments, when none are specified in [extdiff].
449
449
450 [extdiff]
450 [extdiff]
451 kdiff3 =
451 kdiff3 =
452
452
453 [diff-tools]
453 [diff-tools]
454 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
454 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
455
455
456 You can use -I/-X and list of file or directory names like normal "hg diff"
456 You can use -I/-X and list of file or directory names like normal "hg diff"
457 command. The extdiff extension makes snapshots of only needed files, so
457 command. The extdiff extension makes snapshots of only needed files, so
458 running the external diff program will actually be pretty fast (at least
458 running the external diff program will actually be pretty fast (at least
459 faster than having to compare the entire tree).
459 faster than having to compare the entire tree).
460
460
461 list of commands:
461 list of commands:
462
462
463 extdiff use external program to diff repository (or selected files)
463 extdiff use external program to diff repository (or selected files)
464
464
465 (use "hg help -v extdiff" to show built-in aliases and global options)
465 (use "hg help -v extdiff" to show built-in aliases and global options)
466
466
467
467
468
468
469
469
470
470
471
471
472
472
473
473
474
474
475
475
476
476
477
477
478
478
479
479
480
480
481
481
482 $ echo 'extdiff = !' >> $HGRCPATH
482 $ echo 'extdiff = !' >> $HGRCPATH
483
483
484 Test help topic with same name as extension
484 Test help topic with same name as extension
485
485
486 $ cat > multirevs.py <<EOF
486 $ cat > multirevs.py <<EOF
487 > from mercurial import cmdutil, commands
487 > from mercurial import cmdutil, commands
488 > cmdtable = {}
488 > cmdtable = {}
489 > command = cmdutil.command(cmdtable)
489 > command = cmdutil.command(cmdtable)
490 > """multirevs extension
490 > """multirevs extension
491 > Big multi-line module docstring."""
491 > Big multi-line module docstring."""
492 > @command('multirevs', [], 'ARG', norepo=True)
492 > @command('multirevs', [], 'ARG', norepo=True)
493 > def multirevs(ui, repo, arg, *args, **opts):
493 > def multirevs(ui, repo, arg, *args, **opts):
494 > """multirevs command"""
494 > """multirevs command"""
495 > pass
495 > pass
496 > EOF
496 > EOF
497 $ echo "multirevs = multirevs.py" >> $HGRCPATH
497 $ echo "multirevs = multirevs.py" >> $HGRCPATH
498
498
499 $ hg help multirevs
499 $ hg help multirevs
500 Specifying Multiple Revisions
500 Specifying Multiple Revisions
501 """""""""""""""""""""""""""""
501 """""""""""""""""""""""""""""
502
502
503 When Mercurial accepts more than one revision, they may be specified
503 When Mercurial accepts more than one revision, they may be specified
504 individually, or provided as a topologically continuous range, separated
504 individually, or provided as a topologically continuous range, separated
505 by the ":" character.
505 by the ":" character.
506
506
507 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
507 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
508 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
508 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
509 specified, it defaults to revision number 0. If END is not specified, it
509 specified, it defaults to revision number 0. If END is not specified, it
510 defaults to the tip. The range ":" thus means "all revisions".
510 defaults to the tip. The range ":" thus means "all revisions".
511
511
512 If BEGIN is greater than END, revisions are treated in reverse order.
512 If BEGIN is greater than END, revisions are treated in reverse order.
513
513
514 A range acts as a closed interval. This means that a range of 3:5 gives 3,
514 A range acts as a closed interval. This means that a range of 3:5 gives 3,
515 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
515 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
516
516
517 use "hg help -c multirevs" to see help for the multirevs command
517 use "hg help -c multirevs" to see help for the multirevs command
518
518
519
519
520
520
521
521
522
522
523
523
524 $ hg help -c multirevs
524 $ hg help -c multirevs
525 hg multirevs ARG
525 hg multirevs ARG
526
526
527 multirevs command
527 multirevs command
528
528
529 (some details hidden, use --verbose to show complete help)
529 (some details hidden, use --verbose to show complete help)
530
530
531
531
532
532
533 $ hg multirevs
533 $ hg multirevs
534 hg multirevs: invalid arguments
534 hg multirevs: invalid arguments
535 hg multirevs ARG
535 hg multirevs ARG
536
536
537 multirevs command
537 multirevs command
538
538
539 (use "hg multirevs -h" to show more help)
539 (use "hg multirevs -h" to show more help)
540 [255]
540 [255]
541
541
542
542
543
543
544 $ echo "multirevs = !" >> $HGRCPATH
544 $ echo "multirevs = !" >> $HGRCPATH
545
545
546 Issue811: Problem loading extensions twice (by site and by user)
546 Issue811: Problem loading extensions twice (by site and by user)
547
547
548 $ debugpath=`pwd`/debugissue811.py
548 $ debugpath=`pwd`/debugissue811.py
549 $ cat > debugissue811.py <<EOF
549 $ cat > debugissue811.py <<EOF
550 > '''show all loaded extensions
550 > '''show all loaded extensions
551 > '''
551 > '''
552 > from mercurial import cmdutil, commands, extensions
552 > from mercurial import cmdutil, commands, extensions
553 > cmdtable = {}
553 > cmdtable = {}
554 > command = cmdutil.command(cmdtable)
554 > command = cmdutil.command(cmdtable)
555 > @command('debugextensions', [], 'hg debugextensions', norepo=True)
555 > @command('debugextensions', [], 'hg debugextensions', norepo=True)
556 > def debugextensions(ui):
556 > def debugextensions(ui):
557 > "yet another debug command"
557 > "yet another debug command"
558 > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
558 > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
559 > EOF
559 > EOF
560 $ echo "debugissue811 = $debugpath" >> $HGRCPATH
560 $ cat <<EOF >> $HGRCPATH
561 $ echo "mq=" >> $HGRCPATH
561 > debugissue811 = $debugpath
562 $ echo "strip=" >> $HGRCPATH
562 > mq =
563 $ echo "hgext.mq=" >> $HGRCPATH
563 > strip =
564 $ echo "hgext/mq=" >> $HGRCPATH
564 > hgext.mq =
565 > hgext/mq =
566 > EOF
565
567
566 Show extensions:
568 Show extensions:
567 (note that mq force load strip, also checking it's not loaded twice)
569 (note that mq force load strip, also checking it's not loaded twice)
568
570
569 $ hg debugextensions
571 $ hg debugextensions
570 debugissue811
572 debugissue811
571 strip
573 strip
572 mq
574 mq
573
575
574 Disabled extension commands:
576 Disabled extension commands:
575
577
576 $ ORGHGRCPATH=$HGRCPATH
578 $ ORGHGRCPATH=$HGRCPATH
577 $ HGRCPATH=
579 $ HGRCPATH=
578 $ export HGRCPATH
580 $ export HGRCPATH
579 $ hg help email
581 $ hg help email
580 'email' is provided by the following extension:
582 'email' is provided by the following extension:
581
583
582 patchbomb command to send changesets as (a series of) patch emails
584 patchbomb command to send changesets as (a series of) patch emails
583
585
584 (use "hg help extensions" for information on enabling extensions)
586 (use "hg help extensions" for information on enabling extensions)
585
587
586
588
587 $ hg qdel
589 $ hg qdel
588 hg: unknown command 'qdel'
590 hg: unknown command 'qdel'
589 'qdelete' is provided by the following extension:
591 'qdelete' is provided by the following extension:
590
592
591 mq manage a stack of patches
593 mq manage a stack of patches
592
594
593 (use "hg help extensions" for information on enabling extensions)
595 (use "hg help extensions" for information on enabling extensions)
594 [255]
596 [255]
595
597
596
598
597 $ hg churn
599 $ hg churn
598 hg: unknown command 'churn'
600 hg: unknown command 'churn'
599 'churn' is provided by the following extension:
601 'churn' is provided by the following extension:
600
602
601 churn command to display statistics about repository history
603 churn command to display statistics about repository history
602
604
603 (use "hg help extensions" for information on enabling extensions)
605 (use "hg help extensions" for information on enabling extensions)
604 [255]
606 [255]
605
607
606
608
607
609
608 Disabled extensions:
610 Disabled extensions:
609
611
610 $ hg help churn
612 $ hg help churn
611 churn extension - command to display statistics about repository history
613 churn extension - command to display statistics about repository history
612
614
613 (use "hg help extensions" for information on enabling extensions)
615 (use "hg help extensions" for information on enabling extensions)
614
616
615 $ hg help patchbomb
617 $ hg help patchbomb
616 patchbomb extension - command to send changesets as (a series of) patch emails
618 patchbomb extension - command to send changesets as (a series of) patch emails
617
619
618 (use "hg help extensions" for information on enabling extensions)
620 (use "hg help extensions" for information on enabling extensions)
619
621
620
622
621 Broken disabled extension and command:
623 Broken disabled extension and command:
622
624
623 $ mkdir hgext
625 $ mkdir hgext
624 $ echo > hgext/__init__.py
626 $ echo > hgext/__init__.py
625 $ cat > hgext/broken.py <<EOF
627 $ cat > hgext/broken.py <<EOF
626 > "broken extension'
628 > "broken extension'
627 > EOF
629 > EOF
628 $ cat > path.py <<EOF
630 $ cat > path.py <<EOF
629 > import os, sys
631 > import os, sys
630 > sys.path.insert(0, os.environ['HGEXTPATH'])
632 > sys.path.insert(0, os.environ['HGEXTPATH'])
631 > EOF
633 > EOF
632 $ HGEXTPATH=`pwd`
634 $ HGEXTPATH=`pwd`
633 $ export HGEXTPATH
635 $ export HGEXTPATH
634
636
635 $ hg --config extensions.path=./path.py help broken
637 $ hg --config extensions.path=./path.py help broken
636 broken extension - (no help text available)
638 broken extension - (no help text available)
637
639
638 (use "hg help extensions" for information on enabling extensions)
640 (use "hg help extensions" for information on enabling extensions)
639
641
640
642
641 $ cat > hgext/forest.py <<EOF
643 $ cat > hgext/forest.py <<EOF
642 > cmdtable = None
644 > cmdtable = None
643 > EOF
645 > EOF
644 $ hg --config extensions.path=./path.py help foo > /dev/null
646 $ hg --config extensions.path=./path.py help foo > /dev/null
645 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
647 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
646 abort: no such help topic: foo
648 abort: no such help topic: foo
647 (try "hg help --keyword foo")
649 (try "hg help --keyword foo")
648 [255]
650 [255]
649
651
650 $ cat > throw.py <<EOF
652 $ cat > throw.py <<EOF
651 > from mercurial import cmdutil, commands
653 > from mercurial import cmdutil, commands
652 > cmdtable = {}
654 > cmdtable = {}
653 > command = cmdutil.command(cmdtable)
655 > command = cmdutil.command(cmdtable)
654 > class Bogon(Exception): pass
656 > class Bogon(Exception): pass
655 > @command('throw', [], 'hg throw', norepo=True)
657 > @command('throw', [], 'hg throw', norepo=True)
656 > def throw(ui, **opts):
658 > def throw(ui, **opts):
657 > """throws an exception"""
659 > """throws an exception"""
658 > raise Bogon()
660 > raise Bogon()
659 > EOF
661 > EOF
660 No declared supported version, extension complains:
662 No declared supported version, extension complains:
661 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
663 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
662 ** Unknown exception encountered with possibly-broken third-party extension throw
664 ** Unknown exception encountered with possibly-broken third-party extension throw
663 ** which supports versions unknown of Mercurial.
665 ** which supports versions unknown of Mercurial.
664 ** Please disable throw and try your action again.
666 ** Please disable throw and try your action again.
665 ** If that fixes the bug please report it to the extension author.
667 ** If that fixes the bug please report it to the extension author.
666 ** Python * (glob)
668 ** Python * (glob)
667 ** Mercurial Distributed SCM * (glob)
669 ** Mercurial Distributed SCM * (glob)
668 ** Extensions loaded: throw
670 ** Extensions loaded: throw
669 empty declaration of supported version, extension complains:
671 empty declaration of supported version, extension complains:
670 $ echo "testedwith = ''" >> throw.py
672 $ echo "testedwith = ''" >> throw.py
671 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
673 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
672 ** Unknown exception encountered with possibly-broken third-party extension throw
674 ** Unknown exception encountered with possibly-broken third-party extension throw
673 ** which supports versions unknown of Mercurial.
675 ** which supports versions unknown of Mercurial.
674 ** Please disable throw and try your action again.
676 ** Please disable throw and try your action again.
675 ** If that fixes the bug please report it to the extension author.
677 ** If that fixes the bug please report it to the extension author.
676 ** Python * (glob)
678 ** Python * (glob)
677 ** Mercurial Distributed SCM (*) (glob)
679 ** Mercurial Distributed SCM (*) (glob)
678 ** Extensions loaded: throw
680 ** Extensions loaded: throw
679 If the extension specifies a buglink, show that:
681 If the extension specifies a buglink, show that:
680 $ echo 'buglink = "http://example.com/bts"' >> throw.py
682 $ echo 'buglink = "http://example.com/bts"' >> throw.py
681 $ rm -f throw.pyc throw.pyo
683 $ rm -f throw.pyc throw.pyo
682 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
684 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
683 ** Unknown exception encountered with possibly-broken third-party extension throw
685 ** Unknown exception encountered with possibly-broken third-party extension throw
684 ** which supports versions unknown of Mercurial.
686 ** which supports versions unknown of Mercurial.
685 ** Please disable throw and try your action again.
687 ** Please disable throw and try your action again.
686 ** If that fixes the bug please report it to http://example.com/bts
688 ** If that fixes the bug please report it to http://example.com/bts
687 ** Python * (glob)
689 ** Python * (glob)
688 ** Mercurial Distributed SCM (*) (glob)
690 ** Mercurial Distributed SCM (*) (glob)
689 ** Extensions loaded: throw
691 ** Extensions loaded: throw
690 If the extensions declare outdated versions, accuse the older extension first:
692 If the extensions declare outdated versions, accuse the older extension first:
691 $ echo "from mercurial import util" >> older.py
693 $ echo "from mercurial import util" >> older.py
692 $ echo "util.version = lambda:'2.2'" >> older.py
694 $ echo "util.version = lambda:'2.2'" >> older.py
693 $ echo "testedwith = '1.9.3'" >> older.py
695 $ echo "testedwith = '1.9.3'" >> older.py
694 $ echo "testedwith = '2.1.1'" >> throw.py
696 $ echo "testedwith = '2.1.1'" >> throw.py
695 $ rm -f throw.pyc throw.pyo
697 $ rm -f throw.pyc throw.pyo
696 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
698 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
697 > throw 2>&1 | egrep '^\*\*'
699 > throw 2>&1 | egrep '^\*\*'
698 ** Unknown exception encountered with possibly-broken third-party extension older
700 ** Unknown exception encountered with possibly-broken third-party extension older
699 ** which supports versions 1.9.3 of Mercurial.
701 ** which supports versions 1.9.3 of Mercurial.
700 ** Please disable older and try your action again.
702 ** Please disable older and try your action again.
701 ** If that fixes the bug please report it to the extension author.
703 ** If that fixes the bug please report it to the extension author.
702 ** Python * (glob)
704 ** Python * (glob)
703 ** Mercurial Distributed SCM (version 2.2)
705 ** Mercurial Distributed SCM (version 2.2)
704 ** Extensions loaded: throw, older
706 ** Extensions loaded: throw, older
705 One extension only tested with older, one only with newer versions:
707 One extension only tested with older, one only with newer versions:
706 $ echo "util.version = lambda:'2.1.0'" >> older.py
708 $ echo "util.version = lambda:'2.1.0'" >> older.py
707 $ rm -f older.pyc older.pyo
709 $ rm -f older.pyc older.pyo
708 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
710 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
709 > throw 2>&1 | egrep '^\*\*'
711 > throw 2>&1 | egrep '^\*\*'
710 ** Unknown exception encountered with possibly-broken third-party extension older
712 ** Unknown exception encountered with possibly-broken third-party extension older
711 ** which supports versions 1.9.3 of Mercurial.
713 ** which supports versions 1.9.3 of Mercurial.
712 ** Please disable older and try your action again.
714 ** Please disable older and try your action again.
713 ** If that fixes the bug please report it to the extension author.
715 ** If that fixes the bug please report it to the extension author.
714 ** Python * (glob)
716 ** Python * (glob)
715 ** Mercurial Distributed SCM (version 2.1.0)
717 ** Mercurial Distributed SCM (version 2.1.0)
716 ** Extensions loaded: throw, older
718 ** Extensions loaded: throw, older
717 Older extension is tested with current version, the other only with newer:
719 Older extension is tested with current version, the other only with newer:
718 $ echo "util.version = lambda:'1.9.3'" >> older.py
720 $ echo "util.version = lambda:'1.9.3'" >> older.py
719 $ rm -f older.pyc older.pyo
721 $ rm -f older.pyc older.pyo
720 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
722 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
721 > throw 2>&1 | egrep '^\*\*'
723 > throw 2>&1 | egrep '^\*\*'
722 ** Unknown exception encountered with possibly-broken third-party extension throw
724 ** Unknown exception encountered with possibly-broken third-party extension throw
723 ** which supports versions 2.1.1 of Mercurial.
725 ** which supports versions 2.1.1 of Mercurial.
724 ** Please disable throw and try your action again.
726 ** Please disable throw and try your action again.
725 ** If that fixes the bug please report it to http://example.com/bts
727 ** If that fixes the bug please report it to http://example.com/bts
726 ** Python * (glob)
728 ** Python * (glob)
727 ** Mercurial Distributed SCM (version 1.9.3)
729 ** Mercurial Distributed SCM (version 1.9.3)
728 ** Extensions loaded: throw, older
730 ** Extensions loaded: throw, older
729
731
730 Declare the version as supporting this hg version, show regular bts link:
732 Declare the version as supporting this hg version, show regular bts link:
731 $ hgver=`$PYTHON -c 'from mercurial import util; print util.version().split("+")[0]'`
733 $ hgver=`$PYTHON -c 'from mercurial import util; print util.version().split("+")[0]'`
732 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
734 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
733 $ rm -f throw.pyc throw.pyo
735 $ rm -f throw.pyc throw.pyo
734 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
736 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
735 ** unknown exception encountered, please report by visiting
737 ** unknown exception encountered, please report by visiting
736 ** http://mercurial.selenic.com/wiki/BugTracker
738 ** http://mercurial.selenic.com/wiki/BugTracker
737 ** Python * (glob)
739 ** Python * (glob)
738 ** Mercurial Distributed SCM (*) (glob)
740 ** Mercurial Distributed SCM (*) (glob)
739 ** Extensions loaded: throw
741 ** Extensions loaded: throw
740
742
741 Test version number support in 'hg version':
743 Test version number support in 'hg version':
742 $ echo '__version__ = (1, 2, 3)' >> throw.py
744 $ echo '__version__ = (1, 2, 3)' >> throw.py
743 $ rm -f throw.pyc throw.pyo
745 $ rm -f throw.pyc throw.pyo
744 $ hg version -v
746 $ hg version -v
745 Mercurial Distributed SCM (version *) (glob)
747 Mercurial Distributed SCM (version *) (glob)
746 (see http://mercurial.selenic.com for more information)
748 (see http://mercurial.selenic.com for more information)
747
749
748 Copyright (C) 2005-* Matt Mackall and others (glob)
750 Copyright (C) 2005-* Matt Mackall and others (glob)
749 This is free software; see the source for copying conditions. There is NO
751 This is free software; see the source for copying conditions. There is NO
750 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
752 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
751
753
752 Enabled extensions:
754 Enabled extensions:
753
755
754
756
755 $ hg version -v --config extensions.throw=throw.py
757 $ hg version -v --config extensions.throw=throw.py
756 Mercurial Distributed SCM (version *) (glob)
758 Mercurial Distributed SCM (version *) (glob)
757 (see http://mercurial.selenic.com for more information)
759 (see http://mercurial.selenic.com for more information)
758
760
759 Copyright (C) 2005-* Matt Mackall and others (glob)
761 Copyright (C) 2005-* Matt Mackall and others (glob)
760 This is free software; see the source for copying conditions. There is NO
762 This is free software; see the source for copying conditions. There is NO
761 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
763 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
762
764
763 Enabled extensions:
765 Enabled extensions:
764
766
765 throw 1.2.3
767 throw 1.2.3
766 $ echo 'getversion = lambda: "1.twentythree"' >> throw.py
768 $ echo 'getversion = lambda: "1.twentythree"' >> throw.py
767 $ rm -f throw.pyc throw.pyo
769 $ rm -f throw.pyc throw.pyo
768 $ hg version -v --config extensions.throw=throw.py
770 $ hg version -v --config extensions.throw=throw.py
769 Mercurial Distributed SCM (version *) (glob)
771 Mercurial Distributed SCM (version *) (glob)
770 (see http://mercurial.selenic.com for more information)
772 (see http://mercurial.selenic.com for more information)
771
773
772 Copyright (C) 2005-* Matt Mackall and others (glob)
774 Copyright (C) 2005-* Matt Mackall and others (glob)
773 This is free software; see the source for copying conditions. There is NO
775 This is free software; see the source for copying conditions. There is NO
774 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
776 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
775
777
776 Enabled extensions:
778 Enabled extensions:
777
779
778 throw 1.twentythree
780 throw 1.twentythree
779
781
780 Restore HGRCPATH
782 Restore HGRCPATH
781
783
782 $ HGRCPATH=$ORGHGRCPATH
784 $ HGRCPATH=$ORGHGRCPATH
783 $ export HGRCPATH
785 $ export HGRCPATH
784
786
785 Commands handling multiple repositories at a time should invoke only
787 Commands handling multiple repositories at a time should invoke only
786 "reposetup()" of extensions enabling in the target repository.
788 "reposetup()" of extensions enabling in the target repository.
787
789
788 $ mkdir reposetup-test
790 $ mkdir reposetup-test
789 $ cd reposetup-test
791 $ cd reposetup-test
790
792
791 $ cat > $TESTTMP/reposetuptest.py <<EOF
793 $ cat > $TESTTMP/reposetuptest.py <<EOF
792 > from mercurial import extensions
794 > from mercurial import extensions
793 > def reposetup(ui, repo):
795 > def reposetup(ui, repo):
794 > ui.write('reposetup() for %s\n' % (repo.root))
796 > ui.write('reposetup() for %s\n' % (repo.root))
795 > EOF
797 > EOF
796 $ hg init src
798 $ hg init src
797 $ echo a > src/a
799 $ echo a > src/a
798 $ hg -R src commit -Am '#0 at src/a'
800 $ hg -R src commit -Am '#0 at src/a'
799 adding a
801 adding a
800 $ echo '[extensions]' >> src/.hg/hgrc
802 $ echo '[extensions]' >> src/.hg/hgrc
801 $ echo '# enable extension locally' >> src/.hg/hgrc
803 $ echo '# enable extension locally' >> src/.hg/hgrc
802 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
804 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
803 $ hg -R src status
805 $ hg -R src status
804 reposetup() for $TESTTMP/reposetup-test/src (glob)
806 reposetup() for $TESTTMP/reposetup-test/src (glob)
805
807
806 $ hg clone -U src clone-dst1
808 $ hg clone -U src clone-dst1
807 reposetup() for $TESTTMP/reposetup-test/src (glob)
809 reposetup() for $TESTTMP/reposetup-test/src (glob)
808 $ hg init push-dst1
810 $ hg init push-dst1
809 $ hg -q -R src push push-dst1
811 $ hg -q -R src push push-dst1
810 reposetup() for $TESTTMP/reposetup-test/src (glob)
812 reposetup() for $TESTTMP/reposetup-test/src (glob)
811 $ hg init pull-src1
813 $ hg init pull-src1
812 $ hg -q -R pull-src1 pull src
814 $ hg -q -R pull-src1 pull src
813 reposetup() for $TESTTMP/reposetup-test/src (glob)
815 reposetup() for $TESTTMP/reposetup-test/src (glob)
814
816
815 $ echo '[extensions]' >> $HGRCPATH
817 $ cat <<EOF >> $HGRCPATH
816 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
818 > [extensions]
817 $ echo 'reposetuptest = !' >> $HGRCPATH
819 > # disable extension globally and explicitly
820 > reposetuptest = !
821 > EOF
818 $ hg clone -U src clone-dst2
822 $ hg clone -U src clone-dst2
819 reposetup() for $TESTTMP/reposetup-test/src (glob)
823 reposetup() for $TESTTMP/reposetup-test/src (glob)
820 $ hg init push-dst2
824 $ hg init push-dst2
821 $ hg -q -R src push push-dst2
825 $ hg -q -R src push push-dst2
822 reposetup() for $TESTTMP/reposetup-test/src (glob)
826 reposetup() for $TESTTMP/reposetup-test/src (glob)
823 $ hg init pull-src2
827 $ hg init pull-src2
824 $ hg -q -R pull-src2 pull src
828 $ hg -q -R pull-src2 pull src
825 reposetup() for $TESTTMP/reposetup-test/src (glob)
829 reposetup() for $TESTTMP/reposetup-test/src (glob)
826
830
827 $ echo '[extensions]' >> $HGRCPATH
831 $ cat <<EOF >> $HGRCPATH
828 $ echo '# enable extension globally' >> $HGRCPATH
832 > [extensions]
829 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH
833 > # enable extension globally
834 > reposetuptest = $TESTTMP/reposetuptest.py
835 > EOF
830 $ hg clone -U src clone-dst3
836 $ hg clone -U src clone-dst3
831 reposetup() for $TESTTMP/reposetup-test/src (glob)
837 reposetup() for $TESTTMP/reposetup-test/src (glob)
832 reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
838 reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
833 $ hg init push-dst3
839 $ hg init push-dst3
834 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
840 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
835 $ hg -q -R src push push-dst3
841 $ hg -q -R src push push-dst3
836 reposetup() for $TESTTMP/reposetup-test/src (glob)
842 reposetup() for $TESTTMP/reposetup-test/src (glob)
837 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
843 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
838 $ hg init pull-src3
844 $ hg init pull-src3
839 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
845 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
840 $ hg -q -R pull-src3 pull src
846 $ hg -q -R pull-src3 pull src
841 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
847 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
842 reposetup() for $TESTTMP/reposetup-test/src (glob)
848 reposetup() for $TESTTMP/reposetup-test/src (glob)
843
849
844 $ echo '[extensions]' >> src/.hg/hgrc
850 $ echo '[extensions]' >> src/.hg/hgrc
845 $ echo '# disable extension locally' >> src/.hg/hgrc
851 $ echo '# disable extension locally' >> src/.hg/hgrc
846 $ echo 'reposetuptest = !' >> src/.hg/hgrc
852 $ echo 'reposetuptest = !' >> src/.hg/hgrc
847 $ hg clone -U src clone-dst4
853 $ hg clone -U src clone-dst4
848 reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob)
854 reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob)
849 $ hg init push-dst4
855 $ hg init push-dst4
850 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
856 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
851 $ hg -q -R src push push-dst4
857 $ hg -q -R src push push-dst4
852 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
858 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
853 $ hg init pull-src4
859 $ hg init pull-src4
854 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
860 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
855 $ hg -q -R pull-src4 pull src
861 $ hg -q -R pull-src4 pull src
856 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
862 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
857
863
858 disabling in command line overlays with all configuration
864 disabling in command line overlays with all configuration
859 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
865 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
860 $ hg --config extensions.reposetuptest=! init push-dst5
866 $ hg --config extensions.reposetuptest=! init push-dst5
861 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
867 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
862 $ hg --config extensions.reposetuptest=! init pull-src5
868 $ hg --config extensions.reposetuptest=! init pull-src5
863 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
869 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
864
870
865 $ echo '[extensions]' >> $HGRCPATH
871 $ cat <<EOF >> $HGRCPATH
866 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
872 > [extensions]
867 $ echo 'reposetuptest = !' >> $HGRCPATH
873 > # disable extension globally and explicitly
874 > reposetuptest = !
875 > EOF
868 $ hg init parent
876 $ hg init parent
869 $ hg init parent/sub1
877 $ hg init parent/sub1
870 $ echo 1 > parent/sub1/1
878 $ echo 1 > parent/sub1/1
871 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
879 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
872 adding 1
880 adding 1
873 $ hg init parent/sub2
881 $ hg init parent/sub2
874 $ hg init parent/sub2/sub21
882 $ hg init parent/sub2/sub21
875 $ echo 21 > parent/sub2/sub21/21
883 $ echo 21 > parent/sub2/sub21/21
876 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
884 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
877 adding 21
885 adding 21
878 $ cat > parent/sub2/.hgsub <<EOF
886 $ cat > parent/sub2/.hgsub <<EOF
879 > sub21 = sub21
887 > sub21 = sub21
880 > EOF
888 > EOF
881 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
889 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
882 adding .hgsub
890 adding .hgsub
883 $ hg init parent/sub3
891 $ hg init parent/sub3
884 $ echo 3 > parent/sub3/3
892 $ echo 3 > parent/sub3/3
885 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
893 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
886 adding 3
894 adding 3
887 $ cat > parent/.hgsub <<EOF
895 $ cat > parent/.hgsub <<EOF
888 > sub1 = sub1
896 > sub1 = sub1
889 > sub2 = sub2
897 > sub2 = sub2
890 > sub3 = sub3
898 > sub3 = sub3
891 > EOF
899 > EOF
892 $ hg -R parent commit -Am '#0 at parent'
900 $ hg -R parent commit -Am '#0 at parent'
893 adding .hgsub
901 adding .hgsub
894 $ echo '[extensions]' >> parent/.hg/hgrc
902 $ echo '[extensions]' >> parent/.hg/hgrc
895 $ echo '# enable extension locally' >> parent/.hg/hgrc
903 $ echo '# enable extension locally' >> parent/.hg/hgrc
896 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
904 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
897 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
905 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
898 $ hg -R parent status -S -A
906 $ hg -R parent status -S -A
899 reposetup() for $TESTTMP/reposetup-test/parent (glob)
907 reposetup() for $TESTTMP/reposetup-test/parent (glob)
900 reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob)
908 reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob)
901 C .hgsub
909 C .hgsub
902 C .hgsubstate
910 C .hgsubstate
903 C sub1/1
911 C sub1/1
904 C sub2/.hgsub
912 C sub2/.hgsub
905 C sub2/.hgsubstate
913 C sub2/.hgsubstate
906 C sub2/sub21/21
914 C sub2/sub21/21
907 C sub3/3
915 C sub3/3
908
916
909 $ cd ..
917 $ cd ..
@@ -1,209 +1,211 b''
1
1
2 Test interactions between mq and patch.eol
2 Test interactions between mq and patch.eol
3
3
4
4
5 $ echo "[extensions]" >> $HGRCPATH
5 $ cat <<EOF >> $HGRCPATH
6 $ echo "mq=" >> $HGRCPATH
6 > [extensions]
7 $ echo "[diff]" >> $HGRCPATH
7 > mq =
8 $ echo "nodates=1" >> $HGRCPATH
8 > [diff]
9 > nodates = 1
10 > EOF
9
11
10 $ cat > makepatch.py <<EOF
12 $ cat > makepatch.py <<EOF
11 > f = file('eol.diff', 'wb')
13 > f = file('eol.diff', 'wb')
12 > w = f.write
14 > w = f.write
13 > w('test message\n')
15 > w('test message\n')
14 > w('diff --git a/a b/a\n')
16 > w('diff --git a/a b/a\n')
15 > w('--- a/a\n')
17 > w('--- a/a\n')
16 > w('+++ b/a\n')
18 > w('+++ b/a\n')
17 > w('@@ -1,5 +1,5 @@\n')
19 > w('@@ -1,5 +1,5 @@\n')
18 > w(' a\n')
20 > w(' a\n')
19 > w('-b\r\n')
21 > w('-b\r\n')
20 > w('+y\r\n')
22 > w('+y\r\n')
21 > w(' c\r\n')
23 > w(' c\r\n')
22 > w(' d\n')
24 > w(' d\n')
23 > w('-e\n')
25 > w('-e\n')
24 > w('\ No newline at end of file\n')
26 > w('\ No newline at end of file\n')
25 > w('+z\r\n')
27 > w('+z\r\n')
26 > w('\ No newline at end of file\r\n')
28 > w('\ No newline at end of file\r\n')
27 > EOF
29 > EOF
28
30
29 $ cat > cateol.py <<EOF
31 $ cat > cateol.py <<EOF
30 > import sys
32 > import sys
31 > for line in file(sys.argv[1], 'rb'):
33 > for line in file(sys.argv[1], 'rb'):
32 > line = line.replace('\r', '<CR>')
34 > line = line.replace('\r', '<CR>')
33 > line = line.replace('\n', '<LF>')
35 > line = line.replace('\n', '<LF>')
34 > print line
36 > print line
35 > EOF
37 > EOF
36
38
37 $ hg init repo
39 $ hg init repo
38 $ cd repo
40 $ cd repo
39 $ echo '\.diff' > .hgignore
41 $ echo '\.diff' > .hgignore
40 $ echo '\.rej' >> .hgignore
42 $ echo '\.rej' >> .hgignore
41
43
42
44
43 Test different --eol values
45 Test different --eol values
44
46
45 $ $PYTHON -c 'file("a", "wb").write("a\nb\nc\nd\ne")'
47 $ $PYTHON -c 'file("a", "wb").write("a\nb\nc\nd\ne")'
46 $ hg ci -Am adda
48 $ hg ci -Am adda
47 adding .hgignore
49 adding .hgignore
48 adding a
50 adding a
49 $ python ../makepatch.py
51 $ python ../makepatch.py
50 $ hg qimport eol.diff
52 $ hg qimport eol.diff
51 adding eol.diff to series file
53 adding eol.diff to series file
52
54
53 should fail in strict mode
55 should fail in strict mode
54
56
55 $ hg qpush
57 $ hg qpush
56 applying eol.diff
58 applying eol.diff
57 patching file a
59 patching file a
58 Hunk #1 FAILED at 0
60 Hunk #1 FAILED at 0
59 1 out of 1 hunks FAILED -- saving rejects to file a.rej
61 1 out of 1 hunks FAILED -- saving rejects to file a.rej
60 patch failed, unable to continue (try -v)
62 patch failed, unable to continue (try -v)
61 patch failed, rejects left in working dir
63 patch failed, rejects left in working dir
62 errors during apply, please fix and refresh eol.diff
64 errors during apply, please fix and refresh eol.diff
63 [2]
65 [2]
64 $ hg qpop
66 $ hg qpop
65 popping eol.diff
67 popping eol.diff
66 patch queue now empty
68 patch queue now empty
67
69
68 invalid eol
70 invalid eol
69
71
70 $ hg --config patch.eol='LFCR' qpush
72 $ hg --config patch.eol='LFCR' qpush
71 applying eol.diff
73 applying eol.diff
72 patch failed, unable to continue (try -v)
74 patch failed, unable to continue (try -v)
73 patch failed, rejects left in working dir
75 patch failed, rejects left in working dir
74 errors during apply, please fix and refresh eol.diff
76 errors during apply, please fix and refresh eol.diff
75 [2]
77 [2]
76 $ hg qpop
78 $ hg qpop
77 popping eol.diff
79 popping eol.diff
78 patch queue now empty
80 patch queue now empty
79
81
80 force LF
82 force LF
81
83
82 $ hg --config patch.eol='CRLF' qpush
84 $ hg --config patch.eol='CRLF' qpush
83 applying eol.diff
85 applying eol.diff
84 now at: eol.diff
86 now at: eol.diff
85 $ hg qrefresh
87 $ hg qrefresh
86 $ python ../cateol.py .hg/patches/eol.diff
88 $ python ../cateol.py .hg/patches/eol.diff
87 # HG changeset patch<LF>
89 # HG changeset patch<LF>
88 # Parent 0d0bf99a8b7a3842c6f8ef09e34f69156c4bd9d0<LF>
90 # Parent 0d0bf99a8b7a3842c6f8ef09e34f69156c4bd9d0<LF>
89 test message<LF>
91 test message<LF>
90 <LF>
92 <LF>
91 diff -r 0d0bf99a8b7a a<LF>
93 diff -r 0d0bf99a8b7a a<LF>
92 --- a/a<LF>
94 --- a/a<LF>
93 +++ b/a<LF>
95 +++ b/a<LF>
94 @@ -1,5 +1,5 @@<LF>
96 @@ -1,5 +1,5 @@<LF>
95 -a<LF>
97 -a<LF>
96 -b<LF>
98 -b<LF>
97 -c<LF>
99 -c<LF>
98 -d<LF>
100 -d<LF>
99 -e<LF>
101 -e<LF>
100 \ No newline at end of file<LF>
102 \ No newline at end of file<LF>
101 +a<CR><LF>
103 +a<CR><LF>
102 +y<CR><LF>
104 +y<CR><LF>
103 +c<CR><LF>
105 +c<CR><LF>
104 +d<CR><LF>
106 +d<CR><LF>
105 +z<LF>
107 +z<LF>
106 \ No newline at end of file<LF>
108 \ No newline at end of file<LF>
107 $ python ../cateol.py a
109 $ python ../cateol.py a
108 a<CR><LF>
110 a<CR><LF>
109 y<CR><LF>
111 y<CR><LF>
110 c<CR><LF>
112 c<CR><LF>
111 d<CR><LF>
113 d<CR><LF>
112 z
114 z
113 $ hg qpop
115 $ hg qpop
114 popping eol.diff
116 popping eol.diff
115 patch queue now empty
117 patch queue now empty
116
118
117 push again forcing LF and compare revisions
119 push again forcing LF and compare revisions
118
120
119 $ hg --config patch.eol='CRLF' qpush
121 $ hg --config patch.eol='CRLF' qpush
120 applying eol.diff
122 applying eol.diff
121 now at: eol.diff
123 now at: eol.diff
122 $ python ../cateol.py a
124 $ python ../cateol.py a
123 a<CR><LF>
125 a<CR><LF>
124 y<CR><LF>
126 y<CR><LF>
125 c<CR><LF>
127 c<CR><LF>
126 d<CR><LF>
128 d<CR><LF>
127 z
129 z
128 $ hg qpop
130 $ hg qpop
129 popping eol.diff
131 popping eol.diff
130 patch queue now empty
132 patch queue now empty
131
133
132 push again without LF and compare revisions
134 push again without LF and compare revisions
133
135
134 $ hg qpush
136 $ hg qpush
135 applying eol.diff
137 applying eol.diff
136 now at: eol.diff
138 now at: eol.diff
137 $ python ../cateol.py a
139 $ python ../cateol.py a
138 a<CR><LF>
140 a<CR><LF>
139 y<CR><LF>
141 y<CR><LF>
140 c<CR><LF>
142 c<CR><LF>
141 d<CR><LF>
143 d<CR><LF>
142 z
144 z
143 $ hg qpop
145 $ hg qpop
144 popping eol.diff
146 popping eol.diff
145 patch queue now empty
147 patch queue now empty
146 $ cd ..
148 $ cd ..
147
149
148
150
149 Test .rej file EOL are left unchanged
151 Test .rej file EOL are left unchanged
150
152
151 $ hg init testeol
153 $ hg init testeol
152 $ cd testeol
154 $ cd testeol
153 $ $PYTHON -c "file('a', 'wb').write('1\r\n2\r\n3\r\n4')"
155 $ $PYTHON -c "file('a', 'wb').write('1\r\n2\r\n3\r\n4')"
154 $ hg ci -Am adda
156 $ hg ci -Am adda
155 adding a
157 adding a
156 $ $PYTHON -c "file('a', 'wb').write('1\r\n2\r\n33\r\n4')"
158 $ $PYTHON -c "file('a', 'wb').write('1\r\n2\r\n33\r\n4')"
157 $ hg qnew patch1
159 $ hg qnew patch1
158 $ hg qpop
160 $ hg qpop
159 popping patch1
161 popping patch1
160 patch queue now empty
162 patch queue now empty
161 $ $PYTHON -c "file('a', 'wb').write('1\r\n22\r\n33\r\n4')"
163 $ $PYTHON -c "file('a', 'wb').write('1\r\n22\r\n33\r\n4')"
162 $ hg ci -m changea
164 $ hg ci -m changea
163
165
164 $ hg --config 'patch.eol=LF' qpush
166 $ hg --config 'patch.eol=LF' qpush
165 applying patch1
167 applying patch1
166 patching file a
168 patching file a
167 Hunk #1 FAILED at 0
169 Hunk #1 FAILED at 0
168 1 out of 1 hunks FAILED -- saving rejects to file a.rej
170 1 out of 1 hunks FAILED -- saving rejects to file a.rej
169 patch failed, unable to continue (try -v)
171 patch failed, unable to continue (try -v)
170 patch failed, rejects left in working dir
172 patch failed, rejects left in working dir
171 errors during apply, please fix and refresh patch1
173 errors during apply, please fix and refresh patch1
172 [2]
174 [2]
173 $ hg qpop
175 $ hg qpop
174 popping patch1
176 popping patch1
175 patch queue now empty
177 patch queue now empty
176 $ cat a.rej
178 $ cat a.rej
177 --- a
179 --- a
178 +++ a
180 +++ a
179 @@ -1,4 +1,4 @@
181 @@ -1,4 +1,4 @@
180 1\r (esc)
182 1\r (esc)
181 2\r (esc)
183 2\r (esc)
182 -3\r (esc)
184 -3\r (esc)
183 +33\r (esc)
185 +33\r (esc)
184 4
186 4
185 \ No newline at end of file
187 \ No newline at end of file
186
188
187 $ hg --config 'patch.eol=auto' qpush
189 $ hg --config 'patch.eol=auto' qpush
188 applying patch1
190 applying patch1
189 patching file a
191 patching file a
190 Hunk #1 FAILED at 0
192 Hunk #1 FAILED at 0
191 1 out of 1 hunks FAILED -- saving rejects to file a.rej
193 1 out of 1 hunks FAILED -- saving rejects to file a.rej
192 patch failed, unable to continue (try -v)
194 patch failed, unable to continue (try -v)
193 patch failed, rejects left in working dir
195 patch failed, rejects left in working dir
194 errors during apply, please fix and refresh patch1
196 errors during apply, please fix and refresh patch1
195 [2]
197 [2]
196 $ hg qpop
198 $ hg qpop
197 popping patch1
199 popping patch1
198 patch queue now empty
200 patch queue now empty
199 $ cat a.rej
201 $ cat a.rej
200 --- a
202 --- a
201 +++ a
203 +++ a
202 @@ -1,4 +1,4 @@
204 @@ -1,4 +1,4 @@
203 1\r (esc)
205 1\r (esc)
204 2\r (esc)
206 2\r (esc)
205 -3\r (esc)
207 -3\r (esc)
206 +33\r (esc)
208 +33\r (esc)
207 4
209 4
208 \ No newline at end of file
210 \ No newline at end of file
209 $ cd ..
211 $ cd ..
@@ -1,210 +1,212 b''
1 # Test the plumbing of mq.git option
1 # Test the plumbing of mq.git option
2 # Automatic upgrade itself is tested elsewhere.
2 # Automatic upgrade itself is tested elsewhere.
3
3
4 $ echo "[extensions]" >> $HGRCPATH
4 $ cat <<EOF >> $HGRCPATH
5 $ echo "mq=" >> $HGRCPATH
5 > [extensions]
6 $ echo "[diff]" >> $HGRCPATH
6 > mq =
7 $ echo "nodates=1" >> $HGRCPATH
7 > [diff]
8 > nodates = 1
9 > EOF
8
10
9 $ hg init repo-auto
11 $ hg init repo-auto
10 $ cd repo-auto
12 $ cd repo-auto
11
13
12 git=auto: regular patch creation:
14 git=auto: regular patch creation:
13
15
14 $ echo a > a
16 $ echo a > a
15 $ hg add a
17 $ hg add a
16 $ hg qnew -d '0 0' -f adda
18 $ hg qnew -d '0 0' -f adda
17
19
18 $ cat .hg/patches/adda
20 $ cat .hg/patches/adda
19 # HG changeset patch
21 # HG changeset patch
20 # Date 0 0
22 # Date 0 0
21 # Parent 0000000000000000000000000000000000000000
23 # Parent 0000000000000000000000000000000000000000
22
24
23 diff -r 000000000000 -r ef8dafc9fa4c a
25 diff -r 000000000000 -r ef8dafc9fa4c a
24 --- /dev/null
26 --- /dev/null
25 +++ b/a
27 +++ b/a
26 @@ -0,0 +1,1 @@
28 @@ -0,0 +1,1 @@
27 +a
29 +a
28
30
29 git=auto: git patch creation with copy:
31 git=auto: git patch creation with copy:
30
32
31 $ hg cp a b
33 $ hg cp a b
32 $ hg qnew -d '0 0' -f copy
34 $ hg qnew -d '0 0' -f copy
33
35
34 $ cat .hg/patches/copy
36 $ cat .hg/patches/copy
35 # HG changeset patch
37 # HG changeset patch
36 # Date 0 0
38 # Date 0 0
37 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
39 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
38
40
39 diff --git a/a b/b
41 diff --git a/a b/b
40 copy from a
42 copy from a
41 copy to b
43 copy to b
42
44
43 git=auto: git patch when using --git:
45 git=auto: git patch when using --git:
44
46
45 $ echo regular > regular
47 $ echo regular > regular
46 $ hg add regular
48 $ hg add regular
47 $ hg qnew -d '0 0' --git -f git
49 $ hg qnew -d '0 0' --git -f git
48
50
49 $ cat .hg/patches/git
51 $ cat .hg/patches/git
50 # HG changeset patch
52 # HG changeset patch
51 # Date 0 0
53 # Date 0 0
52 # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
54 # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
53
55
54 diff --git a/regular b/regular
56 diff --git a/regular b/regular
55 new file mode 100644
57 new file mode 100644
56 --- /dev/null
58 --- /dev/null
57 +++ b/regular
59 +++ b/regular
58 @@ -0,0 +1,1 @@
60 @@ -0,0 +1,1 @@
59 +regular
61 +regular
60
62
61 git=auto: regular patch after qrefresh without --git:
63 git=auto: regular patch after qrefresh without --git:
62
64
63 $ hg qrefresh -d '0 0'
65 $ hg qrefresh -d '0 0'
64
66
65 $ cat .hg/patches/git
67 $ cat .hg/patches/git
66 # HG changeset patch
68 # HG changeset patch
67 # Date 0 0
69 # Date 0 0
68 # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
70 # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
69
71
70 diff -r 99586d5f048c regular
72 diff -r 99586d5f048c regular
71 --- /dev/null
73 --- /dev/null
72 +++ b/regular
74 +++ b/regular
73 @@ -0,0 +1,1 @@
75 @@ -0,0 +1,1 @@
74 +regular
76 +regular
75
77
76 $ cd ..
78 $ cd ..
77
79
78 $ hg init repo-keep
80 $ hg init repo-keep
79 $ cd repo-keep
81 $ cd repo-keep
80 $ echo '[mq]' > .hg/hgrc
82 $ echo '[mq]' > .hg/hgrc
81 $ echo 'git = KEEP' >> .hg/hgrc
83 $ echo 'git = KEEP' >> .hg/hgrc
82
84
83 git=keep: git patch with --git:
85 git=keep: git patch with --git:
84
86
85 $ echo a > a
87 $ echo a > a
86 $ hg add a
88 $ hg add a
87 $ hg qnew -d '0 0' -f --git git
89 $ hg qnew -d '0 0' -f --git git
88
90
89 $ cat .hg/patches/git
91 $ cat .hg/patches/git
90 # HG changeset patch
92 # HG changeset patch
91 # Date 0 0
93 # Date 0 0
92 # Parent 0000000000000000000000000000000000000000
94 # Parent 0000000000000000000000000000000000000000
93
95
94 diff --git a/a b/a
96 diff --git a/a b/a
95 new file mode 100644
97 new file mode 100644
96 --- /dev/null
98 --- /dev/null
97 +++ b/a
99 +++ b/a
98 @@ -0,0 +1,1 @@
100 @@ -0,0 +1,1 @@
99 +a
101 +a
100
102
101 git=keep: git patch after qrefresh without --git:
103 git=keep: git patch after qrefresh without --git:
102
104
103 $ echo a >> a
105 $ echo a >> a
104 $ hg qrefresh -d '0 0'
106 $ hg qrefresh -d '0 0'
105
107
106 $ cat .hg/patches/git
108 $ cat .hg/patches/git
107 # HG changeset patch
109 # HG changeset patch
108 # Date 0 0
110 # Date 0 0
109 # Parent 0000000000000000000000000000000000000000
111 # Parent 0000000000000000000000000000000000000000
110
112
111 diff --git a/a b/a
113 diff --git a/a b/a
112 new file mode 100644
114 new file mode 100644
113 --- /dev/null
115 --- /dev/null
114 +++ b/a
116 +++ b/a
115 @@ -0,0 +1,2 @@
117 @@ -0,0 +1,2 @@
116 +a
118 +a
117 +a
119 +a
118 $ cd ..
120 $ cd ..
119
121
120 $ hg init repo-yes
122 $ hg init repo-yes
121 $ cd repo-yes
123 $ cd repo-yes
122 $ echo '[mq]' > .hg/hgrc
124 $ echo '[mq]' > .hg/hgrc
123 $ echo 'git = yes' >> .hg/hgrc
125 $ echo 'git = yes' >> .hg/hgrc
124
126
125 git=yes: git patch:
127 git=yes: git patch:
126
128
127 $ echo a > a
129 $ echo a > a
128 $ hg add a
130 $ hg add a
129 $ hg qnew -d '0 0' -f git
131 $ hg qnew -d '0 0' -f git
130
132
131 $ cat .hg/patches/git
133 $ cat .hg/patches/git
132 # HG changeset patch
134 # HG changeset patch
133 # Date 0 0
135 # Date 0 0
134 # Parent 0000000000000000000000000000000000000000
136 # Parent 0000000000000000000000000000000000000000
135
137
136 diff --git a/a b/a
138 diff --git a/a b/a
137 new file mode 100644
139 new file mode 100644
138 --- /dev/null
140 --- /dev/null
139 +++ b/a
141 +++ b/a
140 @@ -0,0 +1,1 @@
142 @@ -0,0 +1,1 @@
141 +a
143 +a
142
144
143 git=yes: git patch after qrefresh:
145 git=yes: git patch after qrefresh:
144
146
145 $ echo a >> a
147 $ echo a >> a
146 $ hg qrefresh -d '0 0'
148 $ hg qrefresh -d '0 0'
147
149
148 $ cat .hg/patches/git
150 $ cat .hg/patches/git
149 # HG changeset patch
151 # HG changeset patch
150 # Date 0 0
152 # Date 0 0
151 # Parent 0000000000000000000000000000000000000000
153 # Parent 0000000000000000000000000000000000000000
152
154
153 diff --git a/a b/a
155 diff --git a/a b/a
154 new file mode 100644
156 new file mode 100644
155 --- /dev/null
157 --- /dev/null
156 +++ b/a
158 +++ b/a
157 @@ -0,0 +1,2 @@
159 @@ -0,0 +1,2 @@
158 +a
160 +a
159 +a
161 +a
160 $ cd ..
162 $ cd ..
161
163
162 $ hg init repo-no
164 $ hg init repo-no
163 $ cd repo-no
165 $ cd repo-no
164 $ echo '[diff]' > .hg/hgrc
166 $ echo '[diff]' > .hg/hgrc
165 $ echo 'git = True' >> .hg/hgrc
167 $ echo 'git = True' >> .hg/hgrc
166 $ echo '[mq]' > .hg/hgrc
168 $ echo '[mq]' > .hg/hgrc
167 $ echo 'git = False' >> .hg/hgrc
169 $ echo 'git = False' >> .hg/hgrc
168
170
169 git=no: regular patch with copy:
171 git=no: regular patch with copy:
170
172
171 $ echo a > a
173 $ echo a > a
172 $ hg add a
174 $ hg add a
173 $ hg qnew -d '0 0' -f adda
175 $ hg qnew -d '0 0' -f adda
174 $ hg cp a b
176 $ hg cp a b
175 $ hg qnew -d '0 0' -f regular
177 $ hg qnew -d '0 0' -f regular
176
178
177 $ cat .hg/patches/regular
179 $ cat .hg/patches/regular
178 # HG changeset patch
180 # HG changeset patch
179 # Date 0 0
181 # Date 0 0
180 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
182 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
181
183
182 diff -r ef8dafc9fa4c -r a70404f79ba3 b
184 diff -r ef8dafc9fa4c -r a70404f79ba3 b
183 --- /dev/null
185 --- /dev/null
184 +++ b/b
186 +++ b/b
185 @@ -0,0 +1,1 @@
187 @@ -0,0 +1,1 @@
186 +a
188 +a
187
189
188 git=no: regular patch after qrefresh with copy:
190 git=no: regular patch after qrefresh with copy:
189
191
190 $ hg cp a c
192 $ hg cp a c
191 $ hg qrefresh -d '0 0'
193 $ hg qrefresh -d '0 0'
192
194
193 $ cat .hg/patches/regular
195 $ cat .hg/patches/regular
194 # HG changeset patch
196 # HG changeset patch
195 # Date 0 0
197 # Date 0 0
196 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
198 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
197
199
198 diff -r ef8dafc9fa4c b
200 diff -r ef8dafc9fa4c b
199 --- /dev/null
201 --- /dev/null
200 +++ b/b
202 +++ b/b
201 @@ -0,0 +1,1 @@
203 @@ -0,0 +1,1 @@
202 +a
204 +a
203 diff -r ef8dafc9fa4c c
205 diff -r ef8dafc9fa4c c
204 --- /dev/null
206 --- /dev/null
205 +++ b/c
207 +++ b/c
206 @@ -0,0 +1,1 @@
208 @@ -0,0 +1,1 @@
207 +a
209 +a
208
210
209 $ cd ..
211 $ cd ..
210
212
@@ -1,892 +1,894 b''
1
1
2 $ echo "[extensions]" >> $HGRCPATH
2 $ cat <<EOF >> $HGRCPATH
3 $ echo "mq=" >> $HGRCPATH
3 > [extensions]
4 $ echo "[diff]" >> $HGRCPATH
4 > mq =
5 $ echo "nodates=true" >> $HGRCPATH
5 > [diff]
6 > nodates = true
7 > EOF
6 $ catpatch() {
8 $ catpatch() {
7 > cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
9 > cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
8 > -e "s/^\(# Parent \).*/\1/"
10 > -e "s/^\(# Parent \).*/\1/"
9 > }
11 > }
10 $ catlog() {
12 $ catlog() {
11 > catpatch $1
13 > catpatch $1
12 > hg log --template "{rev}: {desc} - {author}\n"
14 > hg log --template "{rev}: {desc} - {author}\n"
13 > }
15 > }
14 $ catlogd() {
16 $ catlogd() {
15 > catpatch $1
17 > catpatch $1
16 > hg log --template "{rev}: {desc} - {author} - {date}\n"
18 > hg log --template "{rev}: {desc} - {author} - {date}\n"
17 > }
19 > }
18 $ drop() {
20 $ drop() {
19 > hg qpop
21 > hg qpop
20 > hg qdel $1.patch
22 > hg qdel $1.patch
21 > }
23 > }
22 $ runtest() {
24 $ runtest() {
23 > echo ==== init
25 > echo ==== init
24 > hg init a
26 > hg init a
25 > cd a
27 > cd a
26 > hg qinit
28 > hg qinit
27 >
29 >
28 >
30 >
29 > echo ==== qnew -d
31 > echo ==== qnew -d
30 > hg qnew -d '3 0' 1.patch
32 > hg qnew -d '3 0' 1.patch
31 > catlogd 1
33 > catlogd 1
32 >
34 >
33 > echo ==== qref
35 > echo ==== qref
34 > echo "1" >1
36 > echo "1" >1
35 > hg add
37 > hg add
36 > hg qref
38 > hg qref
37 > catlogd 1
39 > catlogd 1
38 >
40 >
39 > echo ==== qref -d
41 > echo ==== qref -d
40 > hg qref -d '4 0'
42 > hg qref -d '4 0'
41 > catlogd 1
43 > catlogd 1
42 >
44 >
43 >
45 >
44 > echo ==== qnew
46 > echo ==== qnew
45 > hg qnew 2.patch
47 > hg qnew 2.patch
46 > echo "2" >2
48 > echo "2" >2
47 > hg add
49 > hg add
48 > hg qref
50 > hg qref
49 > catlog 2
51 > catlog 2
50 >
52 >
51 > echo ==== qref -d
53 > echo ==== qref -d
52 > hg qref -d '5 0'
54 > hg qref -d '5 0'
53 > catlog 2
55 > catlog 2
54 >
56 >
55 > drop 2
57 > drop 2
56 >
58 >
57 >
59 >
58 > echo ==== qnew -d -m
60 > echo ==== qnew -d -m
59 > hg qnew -d '6 0' -m "Three" 3.patch
61 > hg qnew -d '6 0' -m "Three" 3.patch
60 > catlogd 3
62 > catlogd 3
61 >
63 >
62 > echo ==== qref
64 > echo ==== qref
63 > echo "3" >3
65 > echo "3" >3
64 > hg add
66 > hg add
65 > hg qref
67 > hg qref
66 > catlogd 3
68 > catlogd 3
67 >
69 >
68 > echo ==== qref -m
70 > echo ==== qref -m
69 > hg qref -m "Drei"
71 > hg qref -m "Drei"
70 > catlogd 3
72 > catlogd 3
71 >
73 >
72 > echo ==== qref -d
74 > echo ==== qref -d
73 > hg qref -d '7 0'
75 > hg qref -d '7 0'
74 > catlogd 3
76 > catlogd 3
75 >
77 >
76 > echo ==== qref -d -m
78 > echo ==== qref -d -m
77 > hg qref -d '8 0' -m "Three (again)"
79 > hg qref -d '8 0' -m "Three (again)"
78 > catlogd 3
80 > catlogd 3
79 >
81 >
80 >
82 >
81 > echo ==== qnew -m
83 > echo ==== qnew -m
82 > hg qnew -m "Four" 4.patch
84 > hg qnew -m "Four" 4.patch
83 > echo "4" >4
85 > echo "4" >4
84 > hg add
86 > hg add
85 > hg qref
87 > hg qref
86 > catlog 4
88 > catlog 4
87 >
89 >
88 > echo ==== qref -d
90 > echo ==== qref -d
89 > hg qref -d '9 0'
91 > hg qref -d '9 0'
90 > catlog 4
92 > catlog 4
91 >
93 >
92 > drop 4
94 > drop 4
93 >
95 >
94 >
96 >
95 > echo ==== qnew with HG header
97 > echo ==== qnew with HG header
96 > hg qnew --config 'mq.plain=true' 5.patch
98 > hg qnew --config 'mq.plain=true' 5.patch
97 > hg qpop
99 > hg qpop
98 > echo "# HG changeset patch" >>.hg/patches/5.patch
100 > echo "# HG changeset patch" >>.hg/patches/5.patch
99 > echo "# Date 10 0" >>.hg/patches/5.patch
101 > echo "# Date 10 0" >>.hg/patches/5.patch
100 > hg qpush 2>&1 | grep 'Now at'
102 > hg qpush 2>&1 | grep 'Now at'
101 > catlogd 5
103 > catlogd 5
102 >
104 >
103 > echo ==== hg qref
105 > echo ==== hg qref
104 > echo "5" >5
106 > echo "5" >5
105 > hg add
107 > hg add
106 > hg qref
108 > hg qref
107 > catlogd 5
109 > catlogd 5
108 >
110 >
109 > echo ==== hg qref -d
111 > echo ==== hg qref -d
110 > hg qref -d '11 0'
112 > hg qref -d '11 0'
111 > catlogd 5
113 > catlogd 5
112 >
114 >
113 >
115 >
114 > echo ==== qnew with plain header
116 > echo ==== qnew with plain header
115 > hg qnew --config 'mq.plain=true' -d '12 0' 6.patch
117 > hg qnew --config 'mq.plain=true' -d '12 0' 6.patch
116 > hg qpop
118 > hg qpop
117 > hg qpush 2>&1 | grep 'now at'
119 > hg qpush 2>&1 | grep 'now at'
118 > catlog 6
120 > catlog 6
119 >
121 >
120 > echo ==== hg qref
122 > echo ==== hg qref
121 > echo "6" >6
123 > echo "6" >6
122 > hg add
124 > hg add
123 > hg qref
125 > hg qref
124 > catlogd 6
126 > catlogd 6
125 >
127 >
126 > echo ==== hg qref -d
128 > echo ==== hg qref -d
127 > hg qref -d '13 0'
129 > hg qref -d '13 0'
128 > catlogd 6
130 > catlogd 6
129 >
131 >
130 > drop 6
132 > drop 6
131 >
133 >
132 >
134 >
133 > echo ==== qnew -u
135 > echo ==== qnew -u
134 > hg qnew -u jane 6.patch
136 > hg qnew -u jane 6.patch
135 > echo "6" >6
137 > echo "6" >6
136 > hg add
138 > hg add
137 > hg qref
139 > hg qref
138 > catlog 6
140 > catlog 6
139 >
141 >
140 > echo ==== qref -d
142 > echo ==== qref -d
141 > hg qref -d '12 0'
143 > hg qref -d '12 0'
142 > catlog 6
144 > catlog 6
143 >
145 >
144 > drop 6
146 > drop 6
145 >
147 >
146 >
148 >
147 > echo ==== qnew -d
149 > echo ==== qnew -d
148 > hg qnew -d '13 0' 7.patch
150 > hg qnew -d '13 0' 7.patch
149 > echo "7" >7
151 > echo "7" >7
150 > hg add
152 > hg add
151 > hg qref
153 > hg qref
152 > catlog 7
154 > catlog 7
153 >
155 >
154 > echo ==== qref -u
156 > echo ==== qref -u
155 > hg qref -u john
157 > hg qref -u john
156 > catlogd 7
158 > catlogd 7
157 >
159 >
158 >
160 >
159 > echo ==== qnew
161 > echo ==== qnew
160 > hg qnew 8.patch
162 > hg qnew 8.patch
161 > echo "8" >8
163 > echo "8" >8
162 > hg add
164 > hg add
163 > hg qref
165 > hg qref
164 > catlog 8
166 > catlog 8
165 >
167 >
166 > echo ==== qref -u -d
168 > echo ==== qref -u -d
167 > hg qref -u john -d '14 0'
169 > hg qref -u john -d '14 0'
168 > catlog 8
170 > catlog 8
169 >
171 >
170 > drop 8
172 > drop 8
171 >
173 >
172 >
174 >
173 > echo ==== qnew -m
175 > echo ==== qnew -m
174 > hg qnew -m "Nine" 9.patch
176 > hg qnew -m "Nine" 9.patch
175 > echo "9" >9
177 > echo "9" >9
176 > hg add
178 > hg add
177 > hg qref
179 > hg qref
178 > catlog 9
180 > catlog 9
179 >
181 >
180 > echo ==== qref -u -d
182 > echo ==== qref -u -d
181 > hg qref -u john -d '15 0'
183 > hg qref -u john -d '15 0'
182 > catlog 9
184 > catlog 9
183 >
185 >
184 > drop 9
186 > drop 9
185 >
187 >
186 >
188 >
187 > echo ==== "qpop -a / qpush -a"
189 > echo ==== "qpop -a / qpush -a"
188 > hg qpop -a
190 > hg qpop -a
189 > hg qpush -a
191 > hg qpush -a
190 > hg log --template "{rev}: {desc} - {author} - {date}\n"
192 > hg log --template "{rev}: {desc} - {author} - {date}\n"
191 > }
193 > }
192
194
193 ======= plain headers
195 ======= plain headers
194
196
195 $ echo "[mq]" >> $HGRCPATH
197 $ echo "[mq]" >> $HGRCPATH
196 $ echo "plain=true" >> $HGRCPATH
198 $ echo "plain=true" >> $HGRCPATH
197 $ mkdir sandbox
199 $ mkdir sandbox
198 $ (cd sandbox ; runtest)
200 $ (cd sandbox ; runtest)
199 ==== init
201 ==== init
200 ==== qnew -d
202 ==== qnew -d
201 Date: 3 0
203 Date: 3 0
202
204
203 0: [mq]: 1.patch - test - 3.00
205 0: [mq]: 1.patch - test - 3.00
204 ==== qref
206 ==== qref
205 adding 1
207 adding 1
206 Date: 3 0
208 Date: 3 0
207
209
208 diff -r ... 1
210 diff -r ... 1
209 --- /dev/null
211 --- /dev/null
210 +++ b/1
212 +++ b/1
211 @@ -0,0 +1,1 @@
213 @@ -0,0 +1,1 @@
212 +1
214 +1
213 0: [mq]: 1.patch - test - 3.00
215 0: [mq]: 1.patch - test - 3.00
214 ==== qref -d
216 ==== qref -d
215 Date: 4 0
217 Date: 4 0
216
218
217 diff -r ... 1
219 diff -r ... 1
218 --- /dev/null
220 --- /dev/null
219 +++ b/1
221 +++ b/1
220 @@ -0,0 +1,1 @@
222 @@ -0,0 +1,1 @@
221 +1
223 +1
222 0: [mq]: 1.patch - test - 4.00
224 0: [mq]: 1.patch - test - 4.00
223 ==== qnew
225 ==== qnew
224 adding 2
226 adding 2
225 diff -r ... 2
227 diff -r ... 2
226 --- /dev/null
228 --- /dev/null
227 +++ b/2
229 +++ b/2
228 @@ -0,0 +1,1 @@
230 @@ -0,0 +1,1 @@
229 +2
231 +2
230 1: [mq]: 2.patch - test
232 1: [mq]: 2.patch - test
231 0: [mq]: 1.patch - test
233 0: [mq]: 1.patch - test
232 ==== qref -d
234 ==== qref -d
233 Date: 5 0
235 Date: 5 0
234
236
235 diff -r ... 2
237 diff -r ... 2
236 --- /dev/null
238 --- /dev/null
237 +++ b/2
239 +++ b/2
238 @@ -0,0 +1,1 @@
240 @@ -0,0 +1,1 @@
239 +2
241 +2
240 1: [mq]: 2.patch - test
242 1: [mq]: 2.patch - test
241 0: [mq]: 1.patch - test
243 0: [mq]: 1.patch - test
242 popping 2.patch
244 popping 2.patch
243 now at: 1.patch
245 now at: 1.patch
244 ==== qnew -d -m
246 ==== qnew -d -m
245 Date: 6 0
247 Date: 6 0
246 Three
248 Three
247
249
248 1: Three - test - 6.00
250 1: Three - test - 6.00
249 0: [mq]: 1.patch - test - 4.00
251 0: [mq]: 1.patch - test - 4.00
250 ==== qref
252 ==== qref
251 adding 3
253 adding 3
252 Date: 6 0
254 Date: 6 0
253 Three
255 Three
254
256
255 diff -r ... 3
257 diff -r ... 3
256 --- /dev/null
258 --- /dev/null
257 +++ b/3
259 +++ b/3
258 @@ -0,0 +1,1 @@
260 @@ -0,0 +1,1 @@
259 +3
261 +3
260 1: Three - test - 6.00
262 1: Three - test - 6.00
261 0: [mq]: 1.patch - test - 4.00
263 0: [mq]: 1.patch - test - 4.00
262 ==== qref -m
264 ==== qref -m
263 Date: 6 0
265 Date: 6 0
264 Drei
266 Drei
265
267
266 diff -r ... 3
268 diff -r ... 3
267 --- /dev/null
269 --- /dev/null
268 +++ b/3
270 +++ b/3
269 @@ -0,0 +1,1 @@
271 @@ -0,0 +1,1 @@
270 +3
272 +3
271 1: Drei - test - 6.00
273 1: Drei - test - 6.00
272 0: [mq]: 1.patch - test - 4.00
274 0: [mq]: 1.patch - test - 4.00
273 ==== qref -d
275 ==== qref -d
274 Date: 7 0
276 Date: 7 0
275 Drei
277 Drei
276
278
277 diff -r ... 3
279 diff -r ... 3
278 --- /dev/null
280 --- /dev/null
279 +++ b/3
281 +++ b/3
280 @@ -0,0 +1,1 @@
282 @@ -0,0 +1,1 @@
281 +3
283 +3
282 1: Drei - test - 7.00
284 1: Drei - test - 7.00
283 0: [mq]: 1.patch - test - 4.00
285 0: [mq]: 1.patch - test - 4.00
284 ==== qref -d -m
286 ==== qref -d -m
285 Date: 8 0
287 Date: 8 0
286 Three (again)
288 Three (again)
287
289
288 diff -r ... 3
290 diff -r ... 3
289 --- /dev/null
291 --- /dev/null
290 +++ b/3
292 +++ b/3
291 @@ -0,0 +1,1 @@
293 @@ -0,0 +1,1 @@
292 +3
294 +3
293 1: Three (again) - test - 8.00
295 1: Three (again) - test - 8.00
294 0: [mq]: 1.patch - test - 4.00
296 0: [mq]: 1.patch - test - 4.00
295 ==== qnew -m
297 ==== qnew -m
296 adding 4
298 adding 4
297 Four
299 Four
298
300
299 diff -r ... 4
301 diff -r ... 4
300 --- /dev/null
302 --- /dev/null
301 +++ b/4
303 +++ b/4
302 @@ -0,0 +1,1 @@
304 @@ -0,0 +1,1 @@
303 +4
305 +4
304 2: Four - test
306 2: Four - test
305 1: Three (again) - test
307 1: Three (again) - test
306 0: [mq]: 1.patch - test
308 0: [mq]: 1.patch - test
307 ==== qref -d
309 ==== qref -d
308 Date: 9 0
310 Date: 9 0
309 Four
311 Four
310
312
311 diff -r ... 4
313 diff -r ... 4
312 --- /dev/null
314 --- /dev/null
313 +++ b/4
315 +++ b/4
314 @@ -0,0 +1,1 @@
316 @@ -0,0 +1,1 @@
315 +4
317 +4
316 2: Four - test
318 2: Four - test
317 1: Three (again) - test
319 1: Three (again) - test
318 0: [mq]: 1.patch - test
320 0: [mq]: 1.patch - test
319 popping 4.patch
321 popping 4.patch
320 now at: 3.patch
322 now at: 3.patch
321 ==== qnew with HG header
323 ==== qnew with HG header
322 popping 5.patch
324 popping 5.patch
323 now at: 3.patch
325 now at: 3.patch
324 # HG changeset patch
326 # HG changeset patch
325 # Date 10 0
327 # Date 10 0
326 2: imported patch 5.patch - test - 10.00
328 2: imported patch 5.patch - test - 10.00
327 1: Three (again) - test - 8.00
329 1: Three (again) - test - 8.00
328 0: [mq]: 1.patch - test - 4.00
330 0: [mq]: 1.patch - test - 4.00
329 ==== hg qref
331 ==== hg qref
330 adding 5
332 adding 5
331 # HG changeset patch
333 # HG changeset patch
332 # Date 10 0
334 # Date 10 0
333 # Parent
335 # Parent
334
336
335 diff -r ... 5
337 diff -r ... 5
336 --- /dev/null
338 --- /dev/null
337 +++ b/5
339 +++ b/5
338 @@ -0,0 +1,1 @@
340 @@ -0,0 +1,1 @@
339 +5
341 +5
340 2: [mq]: 5.patch - test - 10.00
342 2: [mq]: 5.patch - test - 10.00
341 1: Three (again) - test - 8.00
343 1: Three (again) - test - 8.00
342 0: [mq]: 1.patch - test - 4.00
344 0: [mq]: 1.patch - test - 4.00
343 ==== hg qref -d
345 ==== hg qref -d
344 # HG changeset patch
346 # HG changeset patch
345 # Date 11 0
347 # Date 11 0
346 # Parent
348 # Parent
347
349
348 diff -r ... 5
350 diff -r ... 5
349 --- /dev/null
351 --- /dev/null
350 +++ b/5
352 +++ b/5
351 @@ -0,0 +1,1 @@
353 @@ -0,0 +1,1 @@
352 +5
354 +5
353 2: [mq]: 5.patch - test - 11.00
355 2: [mq]: 5.patch - test - 11.00
354 1: Three (again) - test - 8.00
356 1: Three (again) - test - 8.00
355 0: [mq]: 1.patch - test - 4.00
357 0: [mq]: 1.patch - test - 4.00
356 ==== qnew with plain header
358 ==== qnew with plain header
357 popping 6.patch
359 popping 6.patch
358 now at: 5.patch
360 now at: 5.patch
359 now at: 6.patch
361 now at: 6.patch
360 Date: 12 0
362 Date: 12 0
361
363
362 3: imported patch 6.patch - test
364 3: imported patch 6.patch - test
363 2: [mq]: 5.patch - test
365 2: [mq]: 5.patch - test
364 1: Three (again) - test
366 1: Three (again) - test
365 0: [mq]: 1.patch - test
367 0: [mq]: 1.patch - test
366 ==== hg qref
368 ==== hg qref
367 adding 6
369 adding 6
368 Date: 12 0
370 Date: 12 0
369
371
370 diff -r ... 6
372 diff -r ... 6
371 --- /dev/null
373 --- /dev/null
372 +++ b/6
374 +++ b/6
373 @@ -0,0 +1,1 @@
375 @@ -0,0 +1,1 @@
374 +6
376 +6
375 3: [mq]: 6.patch - test - 12.00
377 3: [mq]: 6.patch - test - 12.00
376 2: [mq]: 5.patch - test - 11.00
378 2: [mq]: 5.patch - test - 11.00
377 1: Three (again) - test - 8.00
379 1: Three (again) - test - 8.00
378 0: [mq]: 1.patch - test - 4.00
380 0: [mq]: 1.patch - test - 4.00
379 ==== hg qref -d
381 ==== hg qref -d
380 Date: 13 0
382 Date: 13 0
381
383
382 diff -r ... 6
384 diff -r ... 6
383 --- /dev/null
385 --- /dev/null
384 +++ b/6
386 +++ b/6
385 @@ -0,0 +1,1 @@
387 @@ -0,0 +1,1 @@
386 +6
388 +6
387 3: [mq]: 6.patch - test - 13.00
389 3: [mq]: 6.patch - test - 13.00
388 2: [mq]: 5.patch - test - 11.00
390 2: [mq]: 5.patch - test - 11.00
389 1: Three (again) - test - 8.00
391 1: Three (again) - test - 8.00
390 0: [mq]: 1.patch - test - 4.00
392 0: [mq]: 1.patch - test - 4.00
391 popping 6.patch
393 popping 6.patch
392 now at: 5.patch
394 now at: 5.patch
393 ==== qnew -u
395 ==== qnew -u
394 adding 6
396 adding 6
395 From: jane
397 From: jane
396
398
397 diff -r ... 6
399 diff -r ... 6
398 --- /dev/null
400 --- /dev/null
399 +++ b/6
401 +++ b/6
400 @@ -0,0 +1,1 @@
402 @@ -0,0 +1,1 @@
401 +6
403 +6
402 3: [mq]: 6.patch - jane
404 3: [mq]: 6.patch - jane
403 2: [mq]: 5.patch - test
405 2: [mq]: 5.patch - test
404 1: Three (again) - test
406 1: Three (again) - test
405 0: [mq]: 1.patch - test
407 0: [mq]: 1.patch - test
406 ==== qref -d
408 ==== qref -d
407 Date: 12 0
409 Date: 12 0
408 From: jane
410 From: jane
409
411
410 diff -r ... 6
412 diff -r ... 6
411 --- /dev/null
413 --- /dev/null
412 +++ b/6
414 +++ b/6
413 @@ -0,0 +1,1 @@
415 @@ -0,0 +1,1 @@
414 +6
416 +6
415 3: [mq]: 6.patch - jane
417 3: [mq]: 6.patch - jane
416 2: [mq]: 5.patch - test
418 2: [mq]: 5.patch - test
417 1: Three (again) - test
419 1: Three (again) - test
418 0: [mq]: 1.patch - test
420 0: [mq]: 1.patch - test
419 popping 6.patch
421 popping 6.patch
420 now at: 5.patch
422 now at: 5.patch
421 ==== qnew -d
423 ==== qnew -d
422 adding 7
424 adding 7
423 Date: 13 0
425 Date: 13 0
424
426
425 diff -r ... 7
427 diff -r ... 7
426 --- /dev/null
428 --- /dev/null
427 +++ b/7
429 +++ b/7
428 @@ -0,0 +1,1 @@
430 @@ -0,0 +1,1 @@
429 +7
431 +7
430 3: [mq]: 7.patch - test
432 3: [mq]: 7.patch - test
431 2: [mq]: 5.patch - test
433 2: [mq]: 5.patch - test
432 1: Three (again) - test
434 1: Three (again) - test
433 0: [mq]: 1.patch - test
435 0: [mq]: 1.patch - test
434 ==== qref -u
436 ==== qref -u
435 From: john
437 From: john
436 Date: 13 0
438 Date: 13 0
437
439
438 diff -r ... 7
440 diff -r ... 7
439 --- /dev/null
441 --- /dev/null
440 +++ b/7
442 +++ b/7
441 @@ -0,0 +1,1 @@
443 @@ -0,0 +1,1 @@
442 +7
444 +7
443 3: [mq]: 7.patch - john - 13.00
445 3: [mq]: 7.patch - john - 13.00
444 2: [mq]: 5.patch - test - 11.00
446 2: [mq]: 5.patch - test - 11.00
445 1: Three (again) - test - 8.00
447 1: Three (again) - test - 8.00
446 0: [mq]: 1.patch - test - 4.00
448 0: [mq]: 1.patch - test - 4.00
447 ==== qnew
449 ==== qnew
448 adding 8
450 adding 8
449 diff -r ... 8
451 diff -r ... 8
450 --- /dev/null
452 --- /dev/null
451 +++ b/8
453 +++ b/8
452 @@ -0,0 +1,1 @@
454 @@ -0,0 +1,1 @@
453 +8
455 +8
454 4: [mq]: 8.patch - test
456 4: [mq]: 8.patch - test
455 3: [mq]: 7.patch - john
457 3: [mq]: 7.patch - john
456 2: [mq]: 5.patch - test
458 2: [mq]: 5.patch - test
457 1: Three (again) - test
459 1: Three (again) - test
458 0: [mq]: 1.patch - test
460 0: [mq]: 1.patch - test
459 ==== qref -u -d
461 ==== qref -u -d
460 Date: 14 0
462 Date: 14 0
461 From: john
463 From: john
462
464
463 diff -r ... 8
465 diff -r ... 8
464 --- /dev/null
466 --- /dev/null
465 +++ b/8
467 +++ b/8
466 @@ -0,0 +1,1 @@
468 @@ -0,0 +1,1 @@
467 +8
469 +8
468 4: [mq]: 8.patch - john
470 4: [mq]: 8.patch - john
469 3: [mq]: 7.patch - john
471 3: [mq]: 7.patch - john
470 2: [mq]: 5.patch - test
472 2: [mq]: 5.patch - test
471 1: Three (again) - test
473 1: Three (again) - test
472 0: [mq]: 1.patch - test
474 0: [mq]: 1.patch - test
473 popping 8.patch
475 popping 8.patch
474 now at: 7.patch
476 now at: 7.patch
475 ==== qnew -m
477 ==== qnew -m
476 adding 9
478 adding 9
477 Nine
479 Nine
478
480
479 diff -r ... 9
481 diff -r ... 9
480 --- /dev/null
482 --- /dev/null
481 +++ b/9
483 +++ b/9
482 @@ -0,0 +1,1 @@
484 @@ -0,0 +1,1 @@
483 +9
485 +9
484 4: Nine - test
486 4: Nine - test
485 3: [mq]: 7.patch - john
487 3: [mq]: 7.patch - john
486 2: [mq]: 5.patch - test
488 2: [mq]: 5.patch - test
487 1: Three (again) - test
489 1: Three (again) - test
488 0: [mq]: 1.patch - test
490 0: [mq]: 1.patch - test
489 ==== qref -u -d
491 ==== qref -u -d
490 Date: 15 0
492 Date: 15 0
491 From: john
493 From: john
492 Nine
494 Nine
493
495
494 diff -r ... 9
496 diff -r ... 9
495 --- /dev/null
497 --- /dev/null
496 +++ b/9
498 +++ b/9
497 @@ -0,0 +1,1 @@
499 @@ -0,0 +1,1 @@
498 +9
500 +9
499 4: Nine - john
501 4: Nine - john
500 3: [mq]: 7.patch - john
502 3: [mq]: 7.patch - john
501 2: [mq]: 5.patch - test
503 2: [mq]: 5.patch - test
502 1: Three (again) - test
504 1: Three (again) - test
503 0: [mq]: 1.patch - test
505 0: [mq]: 1.patch - test
504 popping 9.patch
506 popping 9.patch
505 now at: 7.patch
507 now at: 7.patch
506 ==== qpop -a / qpush -a
508 ==== qpop -a / qpush -a
507 popping 7.patch
509 popping 7.patch
508 popping 5.patch
510 popping 5.patch
509 popping 3.patch
511 popping 3.patch
510 popping 1.patch
512 popping 1.patch
511 patch queue now empty
513 patch queue now empty
512 applying 1.patch
514 applying 1.patch
513 applying 3.patch
515 applying 3.patch
514 applying 5.patch
516 applying 5.patch
515 applying 7.patch
517 applying 7.patch
516 now at: 7.patch
518 now at: 7.patch
517 3: imported patch 7.patch - john - 13.00
519 3: imported patch 7.patch - john - 13.00
518 2: imported patch 5.patch - test - 11.00
520 2: imported patch 5.patch - test - 11.00
519 1: Three (again) - test - 8.00
521 1: Three (again) - test - 8.00
520 0: imported patch 1.patch - test - 4.00
522 0: imported patch 1.patch - test - 4.00
521 $ rm -r sandbox
523 $ rm -r sandbox
522
524
523 ======= hg headers
525 ======= hg headers
524
526
525 $ echo "plain=false" >> $HGRCPATH
527 $ echo "plain=false" >> $HGRCPATH
526 $ mkdir sandbox
528 $ mkdir sandbox
527 $ (cd sandbox ; runtest)
529 $ (cd sandbox ; runtest)
528 ==== init
530 ==== init
529 ==== qnew -d
531 ==== qnew -d
530 # HG changeset patch
532 # HG changeset patch
531 # Date 3 0
533 # Date 3 0
532 # Parent
534 # Parent
533
535
534 0: [mq]: 1.patch - test - 3.00
536 0: [mq]: 1.patch - test - 3.00
535 ==== qref
537 ==== qref
536 adding 1
538 adding 1
537 # HG changeset patch
539 # HG changeset patch
538 # Date 3 0
540 # Date 3 0
539 # Parent
541 # Parent
540
542
541 diff -r ... 1
543 diff -r ... 1
542 --- /dev/null
544 --- /dev/null
543 +++ b/1
545 +++ b/1
544 @@ -0,0 +1,1 @@
546 @@ -0,0 +1,1 @@
545 +1
547 +1
546 0: [mq]: 1.patch - test - 3.00
548 0: [mq]: 1.patch - test - 3.00
547 ==== qref -d
549 ==== qref -d
548 # HG changeset patch
550 # HG changeset patch
549 # Date 4 0
551 # Date 4 0
550 # Parent
552 # Parent
551
553
552 diff -r ... 1
554 diff -r ... 1
553 --- /dev/null
555 --- /dev/null
554 +++ b/1
556 +++ b/1
555 @@ -0,0 +1,1 @@
557 @@ -0,0 +1,1 @@
556 +1
558 +1
557 0: [mq]: 1.patch - test - 4.00
559 0: [mq]: 1.patch - test - 4.00
558 ==== qnew
560 ==== qnew
559 adding 2
561 adding 2
560 # HG changeset patch
562 # HG changeset patch
561 # Parent
563 # Parent
562
564
563 diff -r ... 2
565 diff -r ... 2
564 --- /dev/null
566 --- /dev/null
565 +++ b/2
567 +++ b/2
566 @@ -0,0 +1,1 @@
568 @@ -0,0 +1,1 @@
567 +2
569 +2
568 1: [mq]: 2.patch - test
570 1: [mq]: 2.patch - test
569 0: [mq]: 1.patch - test
571 0: [mq]: 1.patch - test
570 ==== qref -d
572 ==== qref -d
571 # HG changeset patch
573 # HG changeset patch
572 # Date 5 0
574 # Date 5 0
573 # Parent
575 # Parent
574
576
575 diff -r ... 2
577 diff -r ... 2
576 --- /dev/null
578 --- /dev/null
577 +++ b/2
579 +++ b/2
578 @@ -0,0 +1,1 @@
580 @@ -0,0 +1,1 @@
579 +2
581 +2
580 1: [mq]: 2.patch - test
582 1: [mq]: 2.patch - test
581 0: [mq]: 1.patch - test
583 0: [mq]: 1.patch - test
582 popping 2.patch
584 popping 2.patch
583 now at: 1.patch
585 now at: 1.patch
584 ==== qnew -d -m
586 ==== qnew -d -m
585 # HG changeset patch
587 # HG changeset patch
586 # Date 6 0
588 # Date 6 0
587 # Parent
589 # Parent
588 Three
590 Three
589
591
590 1: Three - test - 6.00
592 1: Three - test - 6.00
591 0: [mq]: 1.patch - test - 4.00
593 0: [mq]: 1.patch - test - 4.00
592 ==== qref
594 ==== qref
593 adding 3
595 adding 3
594 # HG changeset patch
596 # HG changeset patch
595 # Date 6 0
597 # Date 6 0
596 # Parent
598 # Parent
597 Three
599 Three
598
600
599 diff -r ... 3
601 diff -r ... 3
600 --- /dev/null
602 --- /dev/null
601 +++ b/3
603 +++ b/3
602 @@ -0,0 +1,1 @@
604 @@ -0,0 +1,1 @@
603 +3
605 +3
604 1: Three - test - 6.00
606 1: Three - test - 6.00
605 0: [mq]: 1.patch - test - 4.00
607 0: [mq]: 1.patch - test - 4.00
606 ==== qref -m
608 ==== qref -m
607 # HG changeset patch
609 # HG changeset patch
608 # Date 6 0
610 # Date 6 0
609 # Parent
611 # Parent
610 Drei
612 Drei
611
613
612 diff -r ... 3
614 diff -r ... 3
613 --- /dev/null
615 --- /dev/null
614 +++ b/3
616 +++ b/3
615 @@ -0,0 +1,1 @@
617 @@ -0,0 +1,1 @@
616 +3
618 +3
617 1: Drei - test - 6.00
619 1: Drei - test - 6.00
618 0: [mq]: 1.patch - test - 4.00
620 0: [mq]: 1.patch - test - 4.00
619 ==== qref -d
621 ==== qref -d
620 # HG changeset patch
622 # HG changeset patch
621 # Date 7 0
623 # Date 7 0
622 # Parent
624 # Parent
623 Drei
625 Drei
624
626
625 diff -r ... 3
627 diff -r ... 3
626 --- /dev/null
628 --- /dev/null
627 +++ b/3
629 +++ b/3
628 @@ -0,0 +1,1 @@
630 @@ -0,0 +1,1 @@
629 +3
631 +3
630 1: Drei - test - 7.00
632 1: Drei - test - 7.00
631 0: [mq]: 1.patch - test - 4.00
633 0: [mq]: 1.patch - test - 4.00
632 ==== qref -d -m
634 ==== qref -d -m
633 # HG changeset patch
635 # HG changeset patch
634 # Date 8 0
636 # Date 8 0
635 # Parent
637 # Parent
636 Three (again)
638 Three (again)
637
639
638 diff -r ... 3
640 diff -r ... 3
639 --- /dev/null
641 --- /dev/null
640 +++ b/3
642 +++ b/3
641 @@ -0,0 +1,1 @@
643 @@ -0,0 +1,1 @@
642 +3
644 +3
643 1: Three (again) - test - 8.00
645 1: Three (again) - test - 8.00
644 0: [mq]: 1.patch - test - 4.00
646 0: [mq]: 1.patch - test - 4.00
645 ==== qnew -m
647 ==== qnew -m
646 adding 4
648 adding 4
647 # HG changeset patch
649 # HG changeset patch
648 # Parent
650 # Parent
649 Four
651 Four
650
652
651 diff -r ... 4
653 diff -r ... 4
652 --- /dev/null
654 --- /dev/null
653 +++ b/4
655 +++ b/4
654 @@ -0,0 +1,1 @@
656 @@ -0,0 +1,1 @@
655 +4
657 +4
656 2: Four - test
658 2: Four - test
657 1: Three (again) - test
659 1: Three (again) - test
658 0: [mq]: 1.patch - test
660 0: [mq]: 1.patch - test
659 ==== qref -d
661 ==== qref -d
660 # HG changeset patch
662 # HG changeset patch
661 # Date 9 0
663 # Date 9 0
662 # Parent
664 # Parent
663 Four
665 Four
664
666
665 diff -r ... 4
667 diff -r ... 4
666 --- /dev/null
668 --- /dev/null
667 +++ b/4
669 +++ b/4
668 @@ -0,0 +1,1 @@
670 @@ -0,0 +1,1 @@
669 +4
671 +4
670 2: Four - test
672 2: Four - test
671 1: Three (again) - test
673 1: Three (again) - test
672 0: [mq]: 1.patch - test
674 0: [mq]: 1.patch - test
673 popping 4.patch
675 popping 4.patch
674 now at: 3.patch
676 now at: 3.patch
675 ==== qnew with HG header
677 ==== qnew with HG header
676 popping 5.patch
678 popping 5.patch
677 now at: 3.patch
679 now at: 3.patch
678 # HG changeset patch
680 # HG changeset patch
679 # Date 10 0
681 # Date 10 0
680 2: imported patch 5.patch - test - 10.00
682 2: imported patch 5.patch - test - 10.00
681 1: Three (again) - test - 8.00
683 1: Three (again) - test - 8.00
682 0: [mq]: 1.patch - test - 4.00
684 0: [mq]: 1.patch - test - 4.00
683 ==== hg qref
685 ==== hg qref
684 adding 5
686 adding 5
685 # HG changeset patch
687 # HG changeset patch
686 # Date 10 0
688 # Date 10 0
687 # Parent
689 # Parent
688
690
689 diff -r ... 5
691 diff -r ... 5
690 --- /dev/null
692 --- /dev/null
691 +++ b/5
693 +++ b/5
692 @@ -0,0 +1,1 @@
694 @@ -0,0 +1,1 @@
693 +5
695 +5
694 2: [mq]: 5.patch - test - 10.00
696 2: [mq]: 5.patch - test - 10.00
695 1: Three (again) - test - 8.00
697 1: Three (again) - test - 8.00
696 0: [mq]: 1.patch - test - 4.00
698 0: [mq]: 1.patch - test - 4.00
697 ==== hg qref -d
699 ==== hg qref -d
698 # HG changeset patch
700 # HG changeset patch
699 # Date 11 0
701 # Date 11 0
700 # Parent
702 # Parent
701
703
702 diff -r ... 5
704 diff -r ... 5
703 --- /dev/null
705 --- /dev/null
704 +++ b/5
706 +++ b/5
705 @@ -0,0 +1,1 @@
707 @@ -0,0 +1,1 @@
706 +5
708 +5
707 2: [mq]: 5.patch - test - 11.00
709 2: [mq]: 5.patch - test - 11.00
708 1: Three (again) - test - 8.00
710 1: Three (again) - test - 8.00
709 0: [mq]: 1.patch - test - 4.00
711 0: [mq]: 1.patch - test - 4.00
710 ==== qnew with plain header
712 ==== qnew with plain header
711 popping 6.patch
713 popping 6.patch
712 now at: 5.patch
714 now at: 5.patch
713 now at: 6.patch
715 now at: 6.patch
714 Date: 12 0
716 Date: 12 0
715
717
716 3: imported patch 6.patch - test
718 3: imported patch 6.patch - test
717 2: [mq]: 5.patch - test
719 2: [mq]: 5.patch - test
718 1: Three (again) - test
720 1: Three (again) - test
719 0: [mq]: 1.patch - test
721 0: [mq]: 1.patch - test
720 ==== hg qref
722 ==== hg qref
721 adding 6
723 adding 6
722 Date: 12 0
724 Date: 12 0
723
725
724 diff -r ... 6
726 diff -r ... 6
725 --- /dev/null
727 --- /dev/null
726 +++ b/6
728 +++ b/6
727 @@ -0,0 +1,1 @@
729 @@ -0,0 +1,1 @@
728 +6
730 +6
729 3: [mq]: 6.patch - test - 12.00
731 3: [mq]: 6.patch - test - 12.00
730 2: [mq]: 5.patch - test - 11.00
732 2: [mq]: 5.patch - test - 11.00
731 1: Three (again) - test - 8.00
733 1: Three (again) - test - 8.00
732 0: [mq]: 1.patch - test - 4.00
734 0: [mq]: 1.patch - test - 4.00
733 ==== hg qref -d
735 ==== hg qref -d
734 Date: 13 0
736 Date: 13 0
735
737
736 diff -r ... 6
738 diff -r ... 6
737 --- /dev/null
739 --- /dev/null
738 +++ b/6
740 +++ b/6
739 @@ -0,0 +1,1 @@
741 @@ -0,0 +1,1 @@
740 +6
742 +6
741 3: [mq]: 6.patch - test - 13.00
743 3: [mq]: 6.patch - test - 13.00
742 2: [mq]: 5.patch - test - 11.00
744 2: [mq]: 5.patch - test - 11.00
743 1: Three (again) - test - 8.00
745 1: Three (again) - test - 8.00
744 0: [mq]: 1.patch - test - 4.00
746 0: [mq]: 1.patch - test - 4.00
745 popping 6.patch
747 popping 6.patch
746 now at: 5.patch
748 now at: 5.patch
747 ==== qnew -u
749 ==== qnew -u
748 adding 6
750 adding 6
749 # HG changeset patch
751 # HG changeset patch
750 # User jane
752 # User jane
751 # Parent
753 # Parent
752
754
753 diff -r ... 6
755 diff -r ... 6
754 --- /dev/null
756 --- /dev/null
755 +++ b/6
757 +++ b/6
756 @@ -0,0 +1,1 @@
758 @@ -0,0 +1,1 @@
757 +6
759 +6
758 3: [mq]: 6.patch - jane
760 3: [mq]: 6.patch - jane
759 2: [mq]: 5.patch - test
761 2: [mq]: 5.patch - test
760 1: Three (again) - test
762 1: Three (again) - test
761 0: [mq]: 1.patch - test
763 0: [mq]: 1.patch - test
762 ==== qref -d
764 ==== qref -d
763 # HG changeset patch
765 # HG changeset patch
764 # User jane
766 # User jane
765 # Date 12 0
767 # Date 12 0
766 # Parent
768 # Parent
767
769
768 diff -r ... 6
770 diff -r ... 6
769 --- /dev/null
771 --- /dev/null
770 +++ b/6
772 +++ b/6
771 @@ -0,0 +1,1 @@
773 @@ -0,0 +1,1 @@
772 +6
774 +6
773 3: [mq]: 6.patch - jane
775 3: [mq]: 6.patch - jane
774 2: [mq]: 5.patch - test
776 2: [mq]: 5.patch - test
775 1: Three (again) - test
777 1: Three (again) - test
776 0: [mq]: 1.patch - test
778 0: [mq]: 1.patch - test
777 popping 6.patch
779 popping 6.patch
778 now at: 5.patch
780 now at: 5.patch
779 ==== qnew -d
781 ==== qnew -d
780 adding 7
782 adding 7
781 # HG changeset patch
783 # HG changeset patch
782 # Date 13 0
784 # Date 13 0
783 # Parent
785 # Parent
784
786
785 diff -r ... 7
787 diff -r ... 7
786 --- /dev/null
788 --- /dev/null
787 +++ b/7
789 +++ b/7
788 @@ -0,0 +1,1 @@
790 @@ -0,0 +1,1 @@
789 +7
791 +7
790 3: [mq]: 7.patch - test
792 3: [mq]: 7.patch - test
791 2: [mq]: 5.patch - test
793 2: [mq]: 5.patch - test
792 1: Three (again) - test
794 1: Three (again) - test
793 0: [mq]: 1.patch - test
795 0: [mq]: 1.patch - test
794 ==== qref -u
796 ==== qref -u
795 # HG changeset patch
797 # HG changeset patch
796 # User john
798 # User john
797 # Date 13 0
799 # Date 13 0
798 # Parent
800 # Parent
799
801
800 diff -r ... 7
802 diff -r ... 7
801 --- /dev/null
803 --- /dev/null
802 +++ b/7
804 +++ b/7
803 @@ -0,0 +1,1 @@
805 @@ -0,0 +1,1 @@
804 +7
806 +7
805 3: [mq]: 7.patch - john - 13.00
807 3: [mq]: 7.patch - john - 13.00
806 2: [mq]: 5.patch - test - 11.00
808 2: [mq]: 5.patch - test - 11.00
807 1: Three (again) - test - 8.00
809 1: Three (again) - test - 8.00
808 0: [mq]: 1.patch - test - 4.00
810 0: [mq]: 1.patch - test - 4.00
809 ==== qnew
811 ==== qnew
810 adding 8
812 adding 8
811 # HG changeset patch
813 # HG changeset patch
812 # Parent
814 # Parent
813
815
814 diff -r ... 8
816 diff -r ... 8
815 --- /dev/null
817 --- /dev/null
816 +++ b/8
818 +++ b/8
817 @@ -0,0 +1,1 @@
819 @@ -0,0 +1,1 @@
818 +8
820 +8
819 4: [mq]: 8.patch - test
821 4: [mq]: 8.patch - test
820 3: [mq]: 7.patch - john
822 3: [mq]: 7.patch - john
821 2: [mq]: 5.patch - test
823 2: [mq]: 5.patch - test
822 1: Three (again) - test
824 1: Three (again) - test
823 0: [mq]: 1.patch - test
825 0: [mq]: 1.patch - test
824 ==== qref -u -d
826 ==== qref -u -d
825 # HG changeset patch
827 # HG changeset patch
826 # User john
828 # User john
827 # Date 14 0
829 # Date 14 0
828 # Parent
830 # Parent
829
831
830 diff -r ... 8
832 diff -r ... 8
831 --- /dev/null
833 --- /dev/null
832 +++ b/8
834 +++ b/8
833 @@ -0,0 +1,1 @@
835 @@ -0,0 +1,1 @@
834 +8
836 +8
835 4: [mq]: 8.patch - john
837 4: [mq]: 8.patch - john
836 3: [mq]: 7.patch - john
838 3: [mq]: 7.patch - john
837 2: [mq]: 5.patch - test
839 2: [mq]: 5.patch - test
838 1: Three (again) - test
840 1: Three (again) - test
839 0: [mq]: 1.patch - test
841 0: [mq]: 1.patch - test
840 popping 8.patch
842 popping 8.patch
841 now at: 7.patch
843 now at: 7.patch
842 ==== qnew -m
844 ==== qnew -m
843 adding 9
845 adding 9
844 # HG changeset patch
846 # HG changeset patch
845 # Parent
847 # Parent
846 Nine
848 Nine
847
849
848 diff -r ... 9
850 diff -r ... 9
849 --- /dev/null
851 --- /dev/null
850 +++ b/9
852 +++ b/9
851 @@ -0,0 +1,1 @@
853 @@ -0,0 +1,1 @@
852 +9
854 +9
853 4: Nine - test
855 4: Nine - test
854 3: [mq]: 7.patch - john
856 3: [mq]: 7.patch - john
855 2: [mq]: 5.patch - test
857 2: [mq]: 5.patch - test
856 1: Three (again) - test
858 1: Three (again) - test
857 0: [mq]: 1.patch - test
859 0: [mq]: 1.patch - test
858 ==== qref -u -d
860 ==== qref -u -d
859 # HG changeset patch
861 # HG changeset patch
860 # User john
862 # User john
861 # Date 15 0
863 # Date 15 0
862 # Parent
864 # Parent
863 Nine
865 Nine
864
866
865 diff -r ... 9
867 diff -r ... 9
866 --- /dev/null
868 --- /dev/null
867 +++ b/9
869 +++ b/9
868 @@ -0,0 +1,1 @@
870 @@ -0,0 +1,1 @@
869 +9
871 +9
870 4: Nine - john
872 4: Nine - john
871 3: [mq]: 7.patch - john
873 3: [mq]: 7.patch - john
872 2: [mq]: 5.patch - test
874 2: [mq]: 5.patch - test
873 1: Three (again) - test
875 1: Three (again) - test
874 0: [mq]: 1.patch - test
876 0: [mq]: 1.patch - test
875 popping 9.patch
877 popping 9.patch
876 now at: 7.patch
878 now at: 7.patch
877 ==== qpop -a / qpush -a
879 ==== qpop -a / qpush -a
878 popping 7.patch
880 popping 7.patch
879 popping 5.patch
881 popping 5.patch
880 popping 3.patch
882 popping 3.patch
881 popping 1.patch
883 popping 1.patch
882 patch queue now empty
884 patch queue now empty
883 applying 1.patch
885 applying 1.patch
884 applying 3.patch
886 applying 3.patch
885 applying 5.patch
887 applying 5.patch
886 applying 7.patch
888 applying 7.patch
887 now at: 7.patch
889 now at: 7.patch
888 3: imported patch 7.patch - john - 13.00
890 3: imported patch 7.patch - john - 13.00
889 2: imported patch 5.patch - test - 11.00
891 2: imported patch 5.patch - test - 11.00
890 1: Three (again) - test - 8.00
892 1: Three (again) - test - 8.00
891 0: imported patch 1.patch - test - 4.00
893 0: imported patch 1.patch - test - 4.00
892 $ rm -r sandbox
894 $ rm -r sandbox
@@ -1,175 +1,177 b''
1 Setup extension:
1 Setup extension:
2
2
3 $ echo "[extensions]" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 $ echo "mq =" >> $HGRCPATH
4 > [extensions]
5 $ echo "[mq]" >> $HGRCPATH
5 > mq =
6 $ echo "git = keep" >> $HGRCPATH
6 > [mq]
7 > git = keep
8 > EOF
7
9
8 Test merge with mq changeset as the second parent:
10 Test merge with mq changeset as the second parent:
9
11
10 $ hg init m
12 $ hg init m
11 $ cd m
13 $ cd m
12 $ touch a b c
14 $ touch a b c
13 $ hg add a
15 $ hg add a
14 $ hg commit -m a
16 $ hg commit -m a
15 $ hg add b
17 $ hg add b
16 $ hg qnew -d "0 0" b
18 $ hg qnew -d "0 0" b
17 $ hg update 0
19 $ hg update 0
18 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
20 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
19 $ hg add c
21 $ hg add c
20 $ hg commit -m c
22 $ hg commit -m c
21 created new head
23 created new head
22 $ hg merge
24 $ hg merge
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 (branch merge, don't forget to commit)
26 (branch merge, don't forget to commit)
25 $ hg commit -m merge
27 $ hg commit -m merge
26 abort: cannot commit over an applied mq patch
28 abort: cannot commit over an applied mq patch
27 [255]
29 [255]
28 $ cd ..
30 $ cd ..
29
31
30 Issue529: mq aborts when merging patch deleting files
32 Issue529: mq aborts when merging patch deleting files
31
33
32 $ checkundo()
34 $ checkundo()
33 > {
35 > {
34 > if [ -f .hg/store/undo ]; then
36 > if [ -f .hg/store/undo ]; then
35 > echo ".hg/store/undo still exists"
37 > echo ".hg/store/undo still exists"
36 > fi
38 > fi
37 > }
39 > }
38
40
39 Commit two dummy files in "init" changeset:
41 Commit two dummy files in "init" changeset:
40
42
41 $ hg init t
43 $ hg init t
42 $ cd t
44 $ cd t
43 $ echo a > a
45 $ echo a > a
44 $ echo b > b
46 $ echo b > b
45 $ hg ci -Am init
47 $ hg ci -Am init
46 adding a
48 adding a
47 adding b
49 adding b
48 $ hg tag -l init
50 $ hg tag -l init
49
51
50 Create a patch removing a:
52 Create a patch removing a:
51
53
52 $ hg qnew rm_a
54 $ hg qnew rm_a
53 $ hg rm a
55 $ hg rm a
54 $ hg qrefresh -m "rm a"
56 $ hg qrefresh -m "rm a"
55
57
56 Save the patch queue so we can merge it later:
58 Save the patch queue so we can merge it later:
57
59
58 $ hg qsave -c -e
60 $ hg qsave -c -e
59 copy $TESTTMP/t/.hg/patches to $TESTTMP/t/.hg/patches.1 (glob)
61 copy $TESTTMP/t/.hg/patches to $TESTTMP/t/.hg/patches.1 (glob)
60 $ checkundo
62 $ checkundo
61
63
62 Update b and commit in an "update" changeset:
64 Update b and commit in an "update" changeset:
63
65
64 $ hg up -C init
66 $ hg up -C init
65 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 $ echo b >> b
68 $ echo b >> b
67 $ hg st
69 $ hg st
68 M b
70 M b
69 $ hg ci -m update
71 $ hg ci -m update
70 created new head
72 created new head
71
73
72 # Here, qpush used to abort with :
74 # Here, qpush used to abort with :
73 # The system cannot find the file specified => a
75 # The system cannot find the file specified => a
74 $ hg manifest
76 $ hg manifest
75 a
77 a
76 b
78 b
77
79
78 $ hg qpush -a -m
80 $ hg qpush -a -m
79 merging with queue at: $TESTTMP/t/.hg/patches.1 (glob)
81 merging with queue at: $TESTTMP/t/.hg/patches.1 (glob)
80 applying rm_a
82 applying rm_a
81 now at: rm_a
83 now at: rm_a
82
84
83 $ checkundo
85 $ checkundo
84 $ hg manifest
86 $ hg manifest
85 b
87 b
86
88
87 Ensure status is correct after merge:
89 Ensure status is correct after merge:
88
90
89 $ hg qpop -a
91 $ hg qpop -a
90 popping rm_a
92 popping rm_a
91 popping .hg.patches.merge.marker
93 popping .hg.patches.merge.marker
92 patch queue now empty
94 patch queue now empty
93
95
94 $ cd ..
96 $ cd ..
95
97
96 Classic MQ merge sequence *with an explicit named queue*:
98 Classic MQ merge sequence *with an explicit named queue*:
97
99
98 $ hg init t2
100 $ hg init t2
99 $ cd t2
101 $ cd t2
100 $ echo '[diff]' > .hg/hgrc
102 $ echo '[diff]' > .hg/hgrc
101 $ echo 'nodates = 1' >> .hg/hgrc
103 $ echo 'nodates = 1' >> .hg/hgrc
102 $ echo a > a
104 $ echo a > a
103 $ hg ci -Am init
105 $ hg ci -Am init
104 adding a
106 adding a
105 $ echo b > a
107 $ echo b > a
106 $ hg ci -m changea
108 $ hg ci -m changea
107 $ hg up -C 0
109 $ hg up -C 0
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 $ hg cp a aa
111 $ hg cp a aa
110 $ echo c >> a
112 $ echo c >> a
111 $ hg qnew --git -f -e patcha
113 $ hg qnew --git -f -e patcha
112 $ echo d >> a
114 $ echo d >> a
113 $ hg qnew -d '0 0' -f -e patcha2
115 $ hg qnew -d '0 0' -f -e patcha2
114
116
115 Create the reference queue:
117 Create the reference queue:
116
118
117 $ hg qsave -c -e -n refqueue
119 $ hg qsave -c -e -n refqueue
118 copy $TESTTMP/t2/.hg/patches to $TESTTMP/t2/.hg/refqueue (glob)
120 copy $TESTTMP/t2/.hg/patches to $TESTTMP/t2/.hg/refqueue (glob)
119 $ hg up -C 1
121 $ hg up -C 1
120 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
122 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
121
123
122 Merge:
124 Merge:
123
125
124 $ HGMERGE=internal:other hg qpush -a -m -n refqueue
126 $ HGMERGE=internal:other hg qpush -a -m -n refqueue
125 merging with queue at: $TESTTMP/t2/.hg/refqueue (glob)
127 merging with queue at: $TESTTMP/t2/.hg/refqueue (glob)
126 applying patcha
128 applying patcha
127 patching file a
129 patching file a
128 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
130 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
129 fuzz found when applying patch, stopping
131 fuzz found when applying patch, stopping
130 patch didn't work out, merging patcha
132 patch didn't work out, merging patcha
131 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
133 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
132 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
134 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
133 (branch merge, don't forget to commit)
135 (branch merge, don't forget to commit)
134 applying patcha2
136 applying patcha2
135 now at: patcha2
137 now at: patcha2
136
138
137 Check patcha is still a git patch:
139 Check patcha is still a git patch:
138
140
139 $ cat .hg/patches/patcha
141 $ cat .hg/patches/patcha
140 # HG changeset patch
142 # HG changeset patch
141 # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4
143 # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4
142
144
143 diff --git a/a b/a
145 diff --git a/a b/a
144 --- a/a
146 --- a/a
145 +++ b/a
147 +++ b/a
146 @@ -1,1 +1,2 @@
148 @@ -1,1 +1,2 @@
147 -b
149 -b
148 +a
150 +a
149 +c
151 +c
150 diff --git a/a b/aa
152 diff --git a/a b/aa
151 copy from a
153 copy from a
152 copy to aa
154 copy to aa
153 --- a/a
155 --- a/a
154 +++ b/aa
156 +++ b/aa
155 @@ -1,1 +1,1 @@
157 @@ -1,1 +1,1 @@
156 -b
158 -b
157 +a
159 +a
158
160
159 Check patcha2 is still a regular patch:
161 Check patcha2 is still a regular patch:
160
162
161 $ cat .hg/patches/patcha2
163 $ cat .hg/patches/patcha2
162 # HG changeset patch
164 # HG changeset patch
163 # Date 0 0
165 # Date 0 0
164 # Parent ???????????????????????????????????????? (glob)
166 # Parent ???????????????????????????????????????? (glob)
165
167
166 diff -r ???????????? -r ???????????? a (glob)
168 diff -r ???????????? -r ???????????? a (glob)
167 --- a/a
169 --- a/a
168 +++ b/a
170 +++ b/a
169 @@ -1,2 +1,3 @@
171 @@ -1,2 +1,3 @@
170 a
172 a
171 c
173 c
172 +d
174 +d
173
175
174 $ cd ..
176 $ cd ..
175
177
@@ -1,177 +1,179 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
2 > [extensions]
3 $ echo "[mq]" >> $HGRCPATH
3 > mq =
4 $ echo "git=keep" >> $HGRCPATH
4 > [mq]
5 > git = keep
6 > EOF
5
7
6 $ hg init a
8 $ hg init a
7 $ cd a
9 $ cd a
8
10
9 $ echo 'base' > base
11 $ echo 'base' > base
10 $ hg ci -Ambase
12 $ hg ci -Ambase
11 adding base
13 adding base
12
14
13 $ hg qnew -mmqbase mqbase
15 $ hg qnew -mmqbase mqbase
14
16
15 $ echo 'patched' > base
17 $ echo 'patched' > base
16 $ hg qrefresh
18 $ hg qrefresh
17
19
18 qdiff:
20 qdiff:
19
21
20 $ hg qdiff
22 $ hg qdiff
21 diff -r d20a80d4def3 base
23 diff -r d20a80d4def3 base
22 --- a/base Thu Jan 01 00:00:00 1970 +0000
24 --- a/base Thu Jan 01 00:00:00 1970 +0000
23 +++ b/base* (glob)
25 +++ b/base* (glob)
24 @@ -1,1 +1,1 @@
26 @@ -1,1 +1,1 @@
25 -base
27 -base
26 +patched
28 +patched
27
29
28 qdiff dirname:
30 qdiff dirname:
29
31
30 $ hg qdiff --nodates .
32 $ hg qdiff --nodates .
31 diff -r d20a80d4def3 base
33 diff -r d20a80d4def3 base
32 --- a/base
34 --- a/base
33 +++ b/base
35 +++ b/base
34 @@ -1,1 +1,1 @@
36 @@ -1,1 +1,1 @@
35 -base
37 -base
36 +patched
38 +patched
37
39
38 qdiff filename:
40 qdiff filename:
39
41
40 $ hg qdiff --nodates base
42 $ hg qdiff --nodates base
41 diff -r d20a80d4def3 base
43 diff -r d20a80d4def3 base
42 --- a/base
44 --- a/base
43 +++ b/base
45 +++ b/base
44 @@ -1,1 +1,1 @@
46 @@ -1,1 +1,1 @@
45 -base
47 -base
46 +patched
48 +patched
47
49
48 $ hg revert -a
50 $ hg revert -a
49
51
50 $ hg qpop
52 $ hg qpop
51 popping mqbase
53 popping mqbase
52 patch queue now empty
54 patch queue now empty
53
55
54 $ hg qdelete mqbase
56 $ hg qdelete mqbase
55
57
56 $ printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines
58 $ printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines
57 $ hg ci -Amlines -d '2 0'
59 $ hg ci -Amlines -d '2 0'
58 adding lines
60 adding lines
59
61
60 $ hg qnew -mmqbase2 mqbase2
62 $ hg qnew -mmqbase2 mqbase2
61 $ printf '\n\n1\n2\n3\n4\nhello world\n goodbye world\n7\n8\n9\n' > lines
63 $ printf '\n\n1\n2\n3\n4\nhello world\n goodbye world\n7\n8\n9\n' > lines
62
64
63 $ hg qdiff --nodates -U 1
65 $ hg qdiff --nodates -U 1
64 diff -r b0c220e1cf43 lines
66 diff -r b0c220e1cf43 lines
65 --- a/lines
67 --- a/lines
66 +++ b/lines
68 +++ b/lines
67 @@ -1,1 +1,3 @@
69 @@ -1,1 +1,3 @@
68 +
70 +
69 +
71 +
70 1
72 1
71 @@ -4,4 +6,4 @@
73 @@ -4,4 +6,4 @@
72 4
74 4
73 -hello world
75 -hello world
74 -goodbye world
76 -goodbye world
75 +hello world
77 +hello world
76 + goodbye world
78 + goodbye world
77 7
79 7
78
80
79 $ hg qdiff --nodates -b
81 $ hg qdiff --nodates -b
80 diff -r b0c220e1cf43 lines
82 diff -r b0c220e1cf43 lines
81 --- a/lines
83 --- a/lines
82 +++ b/lines
84 +++ b/lines
83 @@ -1,9 +1,11 @@
85 @@ -1,9 +1,11 @@
84 +
86 +
85 +
87 +
86 1
88 1
87 2
89 2
88 3
90 3
89 4
91 4
90 hello world
92 hello world
91 -goodbye world
93 -goodbye world
92 + goodbye world
94 + goodbye world
93 7
95 7
94 8
96 8
95 9
97 9
96
98
97 $ hg qdiff --nodates -U 1 -B
99 $ hg qdiff --nodates -U 1 -B
98 diff -r b0c220e1cf43 lines
100 diff -r b0c220e1cf43 lines
99 --- a/lines
101 --- a/lines
100 +++ b/lines
102 +++ b/lines
101 @@ -4,4 +4,4 @@
103 @@ -4,4 +4,4 @@
102 4
104 4
103 -hello world
105 -hello world
104 -goodbye world
106 -goodbye world
105 +hello world
107 +hello world
106 + goodbye world
108 + goodbye world
107 7
109 7
108
110
109 $ hg qdiff --nodates -w
111 $ hg qdiff --nodates -w
110 diff -r b0c220e1cf43 lines
112 diff -r b0c220e1cf43 lines
111 --- a/lines
113 --- a/lines
112 +++ b/lines
114 +++ b/lines
113 @@ -1,3 +1,5 @@
115 @@ -1,3 +1,5 @@
114 +
116 +
115 +
117 +
116 1
118 1
117 2
119 2
118 3
120 3
119
121
120 $ hg qdiff --nodates --reverse
122 $ hg qdiff --nodates --reverse
121 diff -r b0c220e1cf43 lines
123 diff -r b0c220e1cf43 lines
122 --- a/lines
124 --- a/lines
123 +++ b/lines
125 +++ b/lines
124 @@ -1,11 +1,9 @@
126 @@ -1,11 +1,9 @@
125 -
127 -
126 -
128 -
127 1
129 1
128 2
130 2
129 3
131 3
130 4
132 4
131 -hello world
133 -hello world
132 - goodbye world
134 - goodbye world
133 +hello world
135 +hello world
134 +goodbye world
136 +goodbye world
135 7
137 7
136 8
138 8
137 9
139 9
138
140
139 qdiff preserve existing git flag:
141 qdiff preserve existing git flag:
140
142
141 $ hg qrefresh --git
143 $ hg qrefresh --git
142 $ echo a >> lines
144 $ echo a >> lines
143 $ hg qdiff
145 $ hg qdiff
144 diff --git a/lines b/lines
146 diff --git a/lines b/lines
145 --- a/lines
147 --- a/lines
146 +++ b/lines
148 +++ b/lines
147 @@ -1,9 +1,12 @@
149 @@ -1,9 +1,12 @@
148 +
150 +
149 +
151 +
150 1
152 1
151 2
153 2
152 3
154 3
153 4
155 4
154 -hello world
156 -hello world
155 -goodbye world
157 -goodbye world
156 +hello world
158 +hello world
157 + goodbye world
159 + goodbye world
158 7
160 7
159 8
161 8
160 9
162 9
161 +a
163 +a
162
164
163 $ hg qdiff --stat
165 $ hg qdiff --stat
164 lines | 7 +++++--
166 lines | 7 +++++--
165 1 files changed, 5 insertions(+), 2 deletions(-)
167 1 files changed, 5 insertions(+), 2 deletions(-)
166 $ hg qrefresh
168 $ hg qrefresh
167
169
168 qdiff when file deleted (but not removed) in working dir:
170 qdiff when file deleted (but not removed) in working dir:
169
171
170 $ hg qnew deleted-file
172 $ hg qnew deleted-file
171 $ echo a > newfile
173 $ echo a > newfile
172 $ hg add newfile
174 $ hg add newfile
173 $ hg qrefresh
175 $ hg qrefresh
174 $ rm newfile
176 $ rm newfile
175 $ hg qdiff
177 $ hg qdiff
176
178
177 $ cd ..
179 $ cd ..
@@ -1,261 +1,263 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
2 > [extensions]
3 $ echo "[mq]" >> $HGRCPATH
3 > mq =
4 $ echo "git=keep" >> $HGRCPATH
4 > [mq]
5 $ echo "[diff]" >> $HGRCPATH
5 > git = keep
6 $ echo "nodates=1" >> $HGRCPATH
6 > [diff]
7 > nodates = 1
8 > EOF
7
9
8 init:
10 init:
9
11
10 $ hg init repo
12 $ hg init repo
11 $ cd repo
13 $ cd repo
12 $ echo a > a
14 $ echo a > a
13 $ hg ci -Am adda
15 $ hg ci -Am adda
14 adding a
16 adding a
15 $ echo a >> a
17 $ echo a >> a
16 $ hg qnew -f p1
18 $ hg qnew -f p1
17 $ echo b >> a
19 $ echo b >> a
18 $ hg qnew -f p2
20 $ hg qnew -f p2
19 $ echo c >> a
21 $ echo c >> a
20 $ hg qnew -f p3
22 $ hg qnew -f p3
21
23
22 Fold in the middle of the queue:
24 Fold in the middle of the queue:
23 (this tests also that editor is not invoked if '--edit' is not
25 (this tests also that editor is not invoked if '--edit' is not
24 specified)
26 specified)
25
27
26 $ hg qpop p1
28 $ hg qpop p1
27 popping p3
29 popping p3
28 popping p2
30 popping p2
29 now at: p1
31 now at: p1
30
32
31 $ hg qdiff
33 $ hg qdiff
32 diff -r 07f494440405 a
34 diff -r 07f494440405 a
33 --- a/a
35 --- a/a
34 +++ b/a
36 +++ b/a
35 @@ -1,1 +1,2 @@
37 @@ -1,1 +1,2 @@
36 a
38 a
37 +a
39 +a
38
40
39 $ HGEDITOR=cat hg qfold p2
41 $ HGEDITOR=cat hg qfold p2
40 $ grep git .hg/patches/p1 && echo 'git patch found!'
42 $ grep git .hg/patches/p1 && echo 'git patch found!'
41 [1]
43 [1]
42
44
43 $ hg qser
45 $ hg qser
44 p1
46 p1
45 p3
47 p3
46
48
47 $ hg qdiff
49 $ hg qdiff
48 diff -r 07f494440405 a
50 diff -r 07f494440405 a
49 --- a/a
51 --- a/a
50 +++ b/a
52 +++ b/a
51 @@ -1,1 +1,3 @@
53 @@ -1,1 +1,3 @@
52 a
54 a
53 +a
55 +a
54 +b
56 +b
55
57
56 Fold with local changes:
58 Fold with local changes:
57
59
58 $ echo d >> a
60 $ echo d >> a
59 $ hg qfold p3
61 $ hg qfold p3
60 abort: local changes found, refresh first
62 abort: local changes found, refresh first
61 [255]
63 [255]
62
64
63 $ hg diff -c .
65 $ hg diff -c .
64 diff -r 07f494440405 -r ???????????? a (glob)
66 diff -r 07f494440405 -r ???????????? a (glob)
65 --- a/a
67 --- a/a
66 +++ b/a
68 +++ b/a
67 @@ -1,1 +1,3 @@
69 @@ -1,1 +1,3 @@
68 a
70 a
69 +a
71 +a
70 +b
72 +b
71
73
72 $ hg revert -a --no-backup
74 $ hg revert -a --no-backup
73 reverting a
75 reverting a
74
76
75 Fold git patch into a regular patch, expect git patch:
77 Fold git patch into a regular patch, expect git patch:
76
78
77 $ echo a >> a
79 $ echo a >> a
78 $ hg qnew -f regular
80 $ hg qnew -f regular
79 $ hg cp a aa
81 $ hg cp a aa
80 $ hg qnew --git -f git
82 $ hg qnew --git -f git
81
83
82 $ hg qpop
84 $ hg qpop
83 popping git
85 popping git
84 now at: regular
86 now at: regular
85
87
86 $ hg qfold git
88 $ hg qfold git
87
89
88 $ cat .hg/patches/regular
90 $ cat .hg/patches/regular
89 # HG changeset patch
91 # HG changeset patch
90 # Parent ???????????????????????????????????????? (glob)
92 # Parent ???????????????????????????????????????? (glob)
91
93
92 diff --git a/a b/a
94 diff --git a/a b/a
93 --- a/a
95 --- a/a
94 +++ b/a
96 +++ b/a
95 @@ -1,3 +1,4 @@
97 @@ -1,3 +1,4 @@
96 a
98 a
97 a
99 a
98 b
100 b
99 +a
101 +a
100 diff --git a/a b/aa
102 diff --git a/a b/aa
101 copy from a
103 copy from a
102 copy to aa
104 copy to aa
103 --- a/a
105 --- a/a
104 +++ b/aa
106 +++ b/aa
105 @@ -1,3 +1,4 @@
107 @@ -1,3 +1,4 @@
106 a
108 a
107 a
109 a
108 b
110 b
109 +a
111 +a
110
112
111 $ hg qpop
113 $ hg qpop
112 popping regular
114 popping regular
113 now at: p1
115 now at: p1
114
116
115 $ hg qdel regular
117 $ hg qdel regular
116
118
117 Fold regular patch into a git patch, expect git patch:
119 Fold regular patch into a git patch, expect git patch:
118
120
119 $ hg cp a aa
121 $ hg cp a aa
120 $ hg qnew --git -f git
122 $ hg qnew --git -f git
121 $ echo b >> aa
123 $ echo b >> aa
122 $ hg qnew -f regular
124 $ hg qnew -f regular
123
125
124 $ hg qpop
126 $ hg qpop
125 popping regular
127 popping regular
126 now at: git
128 now at: git
127
129
128 $ hg qfold regular
130 $ hg qfold regular
129
131
130 $ cat .hg/patches/git
132 $ cat .hg/patches/git
131 # HG changeset patch
133 # HG changeset patch
132 # Parent ???????????????????????????????????????? (glob)
134 # Parent ???????????????????????????????????????? (glob)
133
135
134 diff --git a/a b/aa
136 diff --git a/a b/aa
135 copy from a
137 copy from a
136 copy to aa
138 copy to aa
137 --- a/a
139 --- a/a
138 +++ b/aa
140 +++ b/aa
139 @@ -1,3 +1,4 @@
141 @@ -1,3 +1,4 @@
140 a
142 a
141 a
143 a
142 b
144 b
143 +b
145 +b
144
146
145 Test saving last-message.txt:
147 Test saving last-message.txt:
146
148
147 $ hg qrefresh -m "original message"
149 $ hg qrefresh -m "original message"
148
150
149 $ cat > $TESTTMP/commitfailure.py <<EOF
151 $ cat > $TESTTMP/commitfailure.py <<EOF
150 > from mercurial import util
152 > from mercurial import util
151 > def reposetup(ui, repo):
153 > def reposetup(ui, repo):
152 > class commitfailure(repo.__class__):
154 > class commitfailure(repo.__class__):
153 > def commit(self, *args, **kwargs):
155 > def commit(self, *args, **kwargs):
154 > raise util.Abort('emulating unexpected abort')
156 > raise util.Abort('emulating unexpected abort')
155 > repo.__class__ = commitfailure
157 > repo.__class__ = commitfailure
156 > EOF
158 > EOF
157
159
158 $ cat >> .hg/hgrc <<EOF
160 $ cat >> .hg/hgrc <<EOF
159 > [extensions]
161 > [extensions]
160 > # this failure occurs before editor invocation
162 > # this failure occurs before editor invocation
161 > commitfailure = $TESTTMP/commitfailure.py
163 > commitfailure = $TESTTMP/commitfailure.py
162 > EOF
164 > EOF
163
165
164 $ cat > $TESTTMP/editor.sh << EOF
166 $ cat > $TESTTMP/editor.sh << EOF
165 > echo "==== before editing"
167 > echo "==== before editing"
166 > cat \$1
168 > cat \$1
167 > echo "===="
169 > echo "===="
168 > (echo; echo "test saving last-message.txt") >> \$1
170 > (echo; echo "test saving last-message.txt") >> \$1
169 > EOF
171 > EOF
170
172
171 $ hg qapplied
173 $ hg qapplied
172 p1
174 p1
173 git
175 git
174 $ hg tip --template "{files}\n"
176 $ hg tip --template "{files}\n"
175 aa
177 aa
176
178
177 (test that editor is not invoked before transaction starting,
179 (test that editor is not invoked before transaction starting,
178 and that combination of '--edit' and '--message' doesn't abort execution)
180 and that combination of '--edit' and '--message' doesn't abort execution)
179
181
180 $ rm -f .hg/last-message.txt
182 $ rm -f .hg/last-message.txt
181 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e -m MESSAGE p3
183 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e -m MESSAGE p3
182 refresh interrupted while patch was popped! (revert --all, qpush to recover)
184 refresh interrupted while patch was popped! (revert --all, qpush to recover)
183 abort: emulating unexpected abort
185 abort: emulating unexpected abort
184 [255]
186 [255]
185 $ test -f .hg/last-message.txt
187 $ test -f .hg/last-message.txt
186 [1]
188 [1]
187
189
188 (reset applied patches and directory status)
190 (reset applied patches and directory status)
189
191
190 $ cat >> .hg/hgrc <<EOF
192 $ cat >> .hg/hgrc <<EOF
191 > [extensions]
193 > [extensions]
192 > # this failure occurs after editor invocation
194 > # this failure occurs after editor invocation
193 > commitfailure = !
195 > commitfailure = !
194 > EOF
196 > EOF
195
197
196 $ hg qapplied
198 $ hg qapplied
197 p1
199 p1
198 $ hg status -A aa
200 $ hg status -A aa
199 ? aa
201 ? aa
200 $ rm aa
202 $ rm aa
201 $ hg status -m
203 $ hg status -m
202 M a
204 M a
203 $ hg revert --no-backup -q a
205 $ hg revert --no-backup -q a
204 $ hg qpush -q git
206 $ hg qpush -q git
205 now at: git
207 now at: git
206
208
207 (test that editor is invoked and commit message is saved into
209 (test that editor is invoked and commit message is saved into
208 "last-message.txt")
210 "last-message.txt")
209
211
210 $ cat >> .hg/hgrc <<EOF
212 $ cat >> .hg/hgrc <<EOF
211 > [hooks]
213 > [hooks]
212 > # this failure occurs after editor invocation
214 > # this failure occurs after editor invocation
213 > pretxncommit.unexpectedabort = false
215 > pretxncommit.unexpectedabort = false
214 > EOF
216 > EOF
215
217
216 $ rm -f .hg/last-message.txt
218 $ rm -f .hg/last-message.txt
217 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e p3
219 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e p3
218 ==== before editing
220 ==== before editing
219 original message
221 original message
220
222
221
223
222 HG: Enter commit message. Lines beginning with 'HG:' are removed.
224 HG: Enter commit message. Lines beginning with 'HG:' are removed.
223 HG: Leave message empty to use default message.
225 HG: Leave message empty to use default message.
224 HG: --
226 HG: --
225 HG: user: test
227 HG: user: test
226 HG: branch 'default'
228 HG: branch 'default'
227 HG: added aa
229 HG: added aa
228 HG: changed a
230 HG: changed a
229 ====
231 ====
230 transaction abort!
232 transaction abort!
231 rollback completed
233 rollback completed
232 note: commit message saved in .hg/last-message.txt
234 note: commit message saved in .hg/last-message.txt
233 refresh interrupted while patch was popped! (revert --all, qpush to recover)
235 refresh interrupted while patch was popped! (revert --all, qpush to recover)
234 abort: pretxncommit.unexpectedabort hook exited with status 1
236 abort: pretxncommit.unexpectedabort hook exited with status 1
235 [255]
237 [255]
236 $ cat .hg/last-message.txt
238 $ cat .hg/last-message.txt
237 original message
239 original message
238
240
239
241
240
242
241 test saving last-message.txt
243 test saving last-message.txt
242
244
243 (confirm whether files listed up in the commit message editing are correct)
245 (confirm whether files listed up in the commit message editing are correct)
244
246
245 $ cat >> .hg/hgrc <<EOF
247 $ cat >> .hg/hgrc <<EOF
246 > [hooks]
248 > [hooks]
247 > pretxncommit.unexpectedabort =
249 > pretxncommit.unexpectedabort =
248 > EOF
250 > EOF
249 $ hg status -u | while read f; do rm ${f}; done
251 $ hg status -u | while read f; do rm ${f}; done
250 $ hg revert --no-backup -q --all
252 $ hg revert --no-backup -q --all
251 $ hg qpush -q git
253 $ hg qpush -q git
252 now at: git
254 now at: git
253 $ hg qpush -q --move p3
255 $ hg qpush -q --move p3
254 now at: p3
256 now at: p3
255
257
256 $ hg status --rev "git^1" --rev . -arm
258 $ hg status --rev "git^1" --rev . -arm
257 M a
259 M a
258 A aa
260 A aa
259
261
260 $ cd ..
262 $ cd ..
261
263
@@ -1,290 +1,292 b''
1 #require killdaemons
1 #require killdaemons
2
2
3 $ cat > writelines.py <<EOF
3 $ cat > writelines.py <<EOF
4 > import sys
4 > import sys
5 > path = sys.argv[1]
5 > path = sys.argv[1]
6 > args = sys.argv[2:]
6 > args = sys.argv[2:]
7 > assert (len(args) % 2) == 0
7 > assert (len(args) % 2) == 0
8 >
8 >
9 > f = file(path, 'wb')
9 > f = file(path, 'wb')
10 > for i in xrange(len(args)/2):
10 > for i in xrange(len(args)/2):
11 > count, s = args[2*i:2*i+2]
11 > count, s = args[2*i:2*i+2]
12 > count = int(count)
12 > count = int(count)
13 > s = s.decode('string_escape')
13 > s = s.decode('string_escape')
14 > f.write(s*count)
14 > f.write(s*count)
15 > f.close()
15 > f.close()
16 >
16 >
17 > EOF
17 > EOF
18 $ echo "[extensions]" >> $HGRCPATH
18 > cat <<EOF >> $HGRCPATH
19 $ echo "mq=" >> $HGRCPATH
19 > [extensions]
20 $ echo "[diff]" >> $HGRCPATH
20 > mq =
21 $ echo "git=1" >> $HGRCPATH
21 > [diff]
22 > git = 1
23 > EOF
22 $ hg init repo
24 $ hg init repo
23 $ cd repo
25 $ cd repo
24
26
25 qimport without file or revision
27 qimport without file or revision
26
28
27 $ hg qimport
29 $ hg qimport
28 abort: no files or revisions specified
30 abort: no files or revisions specified
29 [255]
31 [255]
30
32
31 qimport non-existing-file
33 qimport non-existing-file
32
34
33 $ hg qimport non-existing-file
35 $ hg qimport non-existing-file
34 abort: unable to read file non-existing-file
36 abort: unable to read file non-existing-file
35 [255]
37 [255]
36
38
37 qimport null revision
39 qimport null revision
38
40
39 $ hg qimport -r null
41 $ hg qimport -r null
40 abort: revision -1 is not mutable
42 abort: revision -1 is not mutable
41 (see "hg help phases" for details)
43 (see "hg help phases" for details)
42 [255]
44 [255]
43 $ hg qseries
45 $ hg qseries
44
46
45 import email
47 import email
46
48
47 $ hg qimport --push -n email - <<EOF
49 $ hg qimport --push -n email - <<EOF
48 > From: Username in email <test@example.net>
50 > From: Username in email <test@example.net>
49 > Subject: [PATCH] Message in email
51 > Subject: [PATCH] Message in email
50 > Date: Fri, 02 Jan 1970 00:00:00 +0000
52 > Date: Fri, 02 Jan 1970 00:00:00 +0000
51 >
53 >
52 > Text before patch.
54 > Text before patch.
53 >
55 >
54 > # HG changeset patch
56 > # HG changeset patch
55 > # User Username in patch <test@example.net>
57 > # User Username in patch <test@example.net>
56 > # Date 0 0
58 > # Date 0 0
57 > # Node ID 1a706973a7d84cb549823634a821d9bdf21c6220
59 > # Node ID 1a706973a7d84cb549823634a821d9bdf21c6220
58 > # Parent 0000000000000000000000000000000000000000
60 > # Parent 0000000000000000000000000000000000000000
59 > First line of commit message.
61 > First line of commit message.
60 >
62 >
61 > More text in commit message.
63 > More text in commit message.
62 > --- confuse the diff detection
64 > --- confuse the diff detection
63 >
65 >
64 > diff --git a/x b/x
66 > diff --git a/x b/x
65 > new file mode 100644
67 > new file mode 100644
66 > --- /dev/null
68 > --- /dev/null
67 > +++ b/x
69 > +++ b/x
68 > @@ -0,0 +1,1 @@
70 > @@ -0,0 +1,1 @@
69 > +new file
71 > +new file
70 > Text after patch.
72 > Text after patch.
71 >
73 >
72 > EOF
74 > EOF
73 adding email to series file
75 adding email to series file
74 applying email
76 applying email
75 now at: email
77 now at: email
76
78
77 hg tip -v
79 hg tip -v
78
80
79 $ hg tip -v
81 $ hg tip -v
80 changeset: 0:1a706973a7d8
82 changeset: 0:1a706973a7d8
81 tag: email
83 tag: email
82 tag: qbase
84 tag: qbase
83 tag: qtip
85 tag: qtip
84 tag: tip
86 tag: tip
85 user: Username in patch <test@example.net>
87 user: Username in patch <test@example.net>
86 date: Thu Jan 01 00:00:00 1970 +0000
88 date: Thu Jan 01 00:00:00 1970 +0000
87 files: x
89 files: x
88 description:
90 description:
89 First line of commit message.
91 First line of commit message.
90
92
91 More text in commit message.
93 More text in commit message.
92
94
93
95
94 $ hg qpop
96 $ hg qpop
95 popping email
97 popping email
96 patch queue now empty
98 patch queue now empty
97 $ hg qdelete email
99 $ hg qdelete email
98
100
99 import URL
101 import URL
100
102
101 $ echo foo >> foo
103 $ echo foo >> foo
102 $ hg add foo
104 $ hg add foo
103 $ hg diff > url.diff
105 $ hg diff > url.diff
104 $ hg revert --no-backup foo
106 $ hg revert --no-backup foo
105 $ rm foo
107 $ rm foo
106
108
107 Under unix: file:///foobar/blah
109 Under unix: file:///foobar/blah
108 Under windows: file:///c:/foobar/blah
110 Under windows: file:///c:/foobar/blah
109
111
110 $ patchurl=`pwd | tr '\\\\' /`/url.diff
112 $ patchurl=`pwd | tr '\\\\' /`/url.diff
111 $ expr "$patchurl" : "\/" > /dev/null || patchurl="/$patchurl"
113 $ expr "$patchurl" : "\/" > /dev/null || patchurl="/$patchurl"
112 $ hg qimport file://"$patchurl"
114 $ hg qimport file://"$patchurl"
113 adding url.diff to series file
115 adding url.diff to series file
114 $ rm url.diff
116 $ rm url.diff
115 $ hg qun
117 $ hg qun
116 url.diff
118 url.diff
117
119
118 import patch that already exists
120 import patch that already exists
119
121
120 $ echo foo2 >> foo
122 $ echo foo2 >> foo
121 $ hg add foo
123 $ hg add foo
122 $ hg diff > ../url.diff
124 $ hg diff > ../url.diff
123 $ hg revert --no-backup foo
125 $ hg revert --no-backup foo
124 $ rm foo
126 $ rm foo
125 $ hg qimport ../url.diff
127 $ hg qimport ../url.diff
126 abort: patch "url.diff" already exists
128 abort: patch "url.diff" already exists
127 [255]
129 [255]
128 $ hg qpush
130 $ hg qpush
129 applying url.diff
131 applying url.diff
130 now at: url.diff
132 now at: url.diff
131 $ cat foo
133 $ cat foo
132 foo
134 foo
133 $ hg qpop
135 $ hg qpop
134 popping url.diff
136 popping url.diff
135 patch queue now empty
137 patch queue now empty
136
138
137 qimport -f
139 qimport -f
138
140
139 $ hg qimport -f ../url.diff
141 $ hg qimport -f ../url.diff
140 adding url.diff to series file
142 adding url.diff to series file
141 $ hg qpush
143 $ hg qpush
142 applying url.diff
144 applying url.diff
143 now at: url.diff
145 now at: url.diff
144 $ cat foo
146 $ cat foo
145 foo2
147 foo2
146 $ hg qpop
148 $ hg qpop
147 popping url.diff
149 popping url.diff
148 patch queue now empty
150 patch queue now empty
149
151
150 build diff with CRLF
152 build diff with CRLF
151
153
152 $ python ../writelines.py b 5 'a\n' 5 'a\r\n'
154 $ python ../writelines.py b 5 'a\n' 5 'a\r\n'
153 $ hg ci -Am addb
155 $ hg ci -Am addb
154 adding b
156 adding b
155 $ python ../writelines.py b 2 'a\n' 10 'b\n' 2 'a\r\n'
157 $ python ../writelines.py b 2 'a\n' 10 'b\n' 2 'a\r\n'
156 $ hg diff > b.diff
158 $ hg diff > b.diff
157 $ hg up -C
159 $ hg up -C
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159
161
160 qimport CRLF diff
162 qimport CRLF diff
161
163
162 $ hg qimport b.diff
164 $ hg qimport b.diff
163 adding b.diff to series file
165 adding b.diff to series file
164 $ hg qpush
166 $ hg qpush
165 applying b.diff
167 applying b.diff
166 now at: b.diff
168 now at: b.diff
167
169
168 try to import --push
170 try to import --push
169
171
170 $ cat > appendfoo.diff <<EOF
172 $ cat > appendfoo.diff <<EOF
171 > append foo
173 > append foo
172 >
174 >
173 > diff -r 07f494440405 -r 261500830e46 baz
175 > diff -r 07f494440405 -r 261500830e46 baz
174 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
176 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
175 > +++ b/baz Thu Jan 01 00:00:00 1970 +0000
177 > +++ b/baz Thu Jan 01 00:00:00 1970 +0000
176 > @@ -0,0 +1,1 @@
178 > @@ -0,0 +1,1 @@
177 > +foo
179 > +foo
178 > EOF
180 > EOF
179
181
180 $ cat > appendbar.diff <<EOF
182 $ cat > appendbar.diff <<EOF
181 > append bar
183 > append bar
182 >
184 >
183 > diff -r 07f494440405 -r 261500830e46 baz
185 > diff -r 07f494440405 -r 261500830e46 baz
184 > --- a/baz Thu Jan 01 00:00:00 1970 +0000
186 > --- a/baz Thu Jan 01 00:00:00 1970 +0000
185 > +++ b/baz Thu Jan 01 00:00:00 1970 +0000
187 > +++ b/baz Thu Jan 01 00:00:00 1970 +0000
186 > @@ -1,1 +1,2 @@
188 > @@ -1,1 +1,2 @@
187 > foo
189 > foo
188 > +bar
190 > +bar
189 > EOF
191 > EOF
190
192
191 $ hg qimport --push appendfoo.diff appendbar.diff
193 $ hg qimport --push appendfoo.diff appendbar.diff
192 adding appendfoo.diff to series file
194 adding appendfoo.diff to series file
193 adding appendbar.diff to series file
195 adding appendbar.diff to series file
194 applying appendfoo.diff
196 applying appendfoo.diff
195 applying appendbar.diff
197 applying appendbar.diff
196 now at: appendbar.diff
198 now at: appendbar.diff
197 $ hg qfin -a
199 $ hg qfin -a
198 patch b.diff finalized without changeset message
200 patch b.diff finalized without changeset message
199 $ touch .hg/patches/2.diff
201 $ touch .hg/patches/2.diff
200 $ hg qimport -r 'p1(.)::'
202 $ hg qimport -r 'p1(.)::'
201 abort: patch "2.diff" already exists
203 abort: patch "2.diff" already exists
202 [255]
204 [255]
203 $ hg qapplied
205 $ hg qapplied
204 3.diff
206 3.diff
205 $ hg qfin -a
207 $ hg qfin -a
206 $ rm .hg/patches/2.diff
208 $ rm .hg/patches/2.diff
207 $ hg qimport -r 'p1(.)::' -P
209 $ hg qimport -r 'p1(.)::' -P
208 $ hg qpop -a
210 $ hg qpop -a
209 popping 3.diff
211 popping 3.diff
210 popping 2.diff
212 popping 2.diff
211 patch queue now empty
213 patch queue now empty
212 $ hg qdel 3.diff
214 $ hg qdel 3.diff
213 $ hg qdel -k 2.diff
215 $ hg qdel -k 2.diff
214
216
215 qimport -e
217 qimport -e
216
218
217 $ hg qimport -e 2.diff
219 $ hg qimport -e 2.diff
218 adding 2.diff to series file
220 adding 2.diff to series file
219 $ hg qdel -k 2.diff
221 $ hg qdel -k 2.diff
220
222
221 qimport -e --name newname oldexisitingpatch
223 qimport -e --name newname oldexisitingpatch
222
224
223 $ hg qimport -e --name this-name-is-better 2.diff
225 $ hg qimport -e --name this-name-is-better 2.diff
224 renaming 2.diff to this-name-is-better
226 renaming 2.diff to this-name-is-better
225 adding this-name-is-better to series file
227 adding this-name-is-better to series file
226 $ hg qser
228 $ hg qser
227 this-name-is-better
229 this-name-is-better
228 url.diff
230 url.diff
229
231
230 qimport -e --name without --force
232 qimport -e --name without --force
231
233
232 $ cp .hg/patches/this-name-is-better .hg/patches/3.diff
234 $ cp .hg/patches/this-name-is-better .hg/patches/3.diff
233 $ hg qimport -e --name this-name-is-better 3.diff
235 $ hg qimport -e --name this-name-is-better 3.diff
234 abort: patch "this-name-is-better" already exists
236 abort: patch "this-name-is-better" already exists
235 [255]
237 [255]
236 $ hg qser
238 $ hg qser
237 this-name-is-better
239 this-name-is-better
238 url.diff
240 url.diff
239
241
240 qimport -e --name with --force
242 qimport -e --name with --force
241
243
242 $ hg qimport --force -e --name this-name-is-better 3.diff
244 $ hg qimport --force -e --name this-name-is-better 3.diff
243 renaming 3.diff to this-name-is-better
245 renaming 3.diff to this-name-is-better
244 adding this-name-is-better to series file
246 adding this-name-is-better to series file
245 $ hg qser
247 $ hg qser
246 this-name-is-better
248 this-name-is-better
247 url.diff
249 url.diff
248
250
249 qimport with bad name, should abort before reading file
251 qimport with bad name, should abort before reading file
250
252
251 $ hg qimport non-existent-file --name .hg
253 $ hg qimport non-existent-file --name .hg
252 abort: patch name cannot begin with ".hg"
254 abort: patch name cannot begin with ".hg"
253 [255]
255 [255]
254
256
255 qimport http:// patch with leading slashes in url
257 qimport http:// patch with leading slashes in url
256
258
257 set up hgweb
259 set up hgweb
258
260
259 $ cd ..
261 $ cd ..
260 $ hg init served
262 $ hg init served
261 $ cd served
263 $ cd served
262 $ echo a > a
264 $ echo a > a
263 $ hg ci -Am patch
265 $ hg ci -Am patch
264 adding a
266 adding a
265 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
267 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
266 $ cat hg.pid >> $DAEMON_PIDS
268 $ cat hg.pid >> $DAEMON_PIDS
267
269
268 $ cd ../repo
270 $ cd ../repo
269 $ hg qimport http://localhost:$HGPORT/raw-rev/0///
271 $ hg qimport http://localhost:$HGPORT/raw-rev/0///
270 adding 0 to series file
272 adding 0 to series file
271
273
272 check qimport phase:
274 check qimport phase:
273
275
274 $ hg -q qpush
276 $ hg -q qpush
275 now at: 0
277 now at: 0
276 $ hg phase qparent
278 $ hg phase qparent
277 1: draft
279 1: draft
278 $ hg qimport -r qparent
280 $ hg qimport -r qparent
279 $ hg phase qbase
281 $ hg phase qbase
280 1: draft
282 1: draft
281 $ hg qfinish qbase
283 $ hg qfinish qbase
282 $ echo '[mq]' >> $HGRCPATH
284 $ echo '[mq]' >> $HGRCPATH
283 $ echo 'secret=true' >> $HGRCPATH
285 $ echo 'secret=true' >> $HGRCPATH
284 $ hg qimport -r qparent
286 $ hg qimport -r qparent
285 $ hg phase qbase
287 $ hg phase qbase
286 1: secret
288 1: secret
287
289
288 $ cd ..
290 $ cd ..
289
291
290 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
292 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
@@ -1,550 +1,552 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
2 > [extensions]
3 $ echo "[diff]" >> $HGRCPATH
3 > mq =
4 $ echo "nodates=1" >> $HGRCPATH
4 > [diff]
5 > nodates = 1
6 > EOF
5
7
6 $ hg init a
8 $ hg init a
7 $ cd a
9 $ cd a
8
10
9 $ mkdir 1 2
11 $ mkdir 1 2
10 $ echo 'base' > 1/base
12 $ echo 'base' > 1/base
11 $ echo 'base' > 2/base
13 $ echo 'base' > 2/base
12 $ hg ci -Ambase
14 $ hg ci -Ambase
13 adding 1/base
15 adding 1/base
14 adding 2/base
16 adding 2/base
15
17
16 $ hg qnew -mmqbase mqbase
18 $ hg qnew -mmqbase mqbase
17
19
18 $ echo 'patched' > 1/base
20 $ echo 'patched' > 1/base
19 $ echo 'patched' > 2/base
21 $ echo 'patched' > 2/base
20 $ hg qrefresh
22 $ hg qrefresh
21
23
22 $ hg qdiff
24 $ hg qdiff
23 diff -r e7af5904b465 1/base
25 diff -r e7af5904b465 1/base
24 --- a/1/base
26 --- a/1/base
25 +++ b/1/base
27 +++ b/1/base
26 @@ -1,1 +1,1 @@
28 @@ -1,1 +1,1 @@
27 -base
29 -base
28 +patched
30 +patched
29 diff -r e7af5904b465 2/base
31 diff -r e7af5904b465 2/base
30 --- a/2/base
32 --- a/2/base
31 +++ b/2/base
33 +++ b/2/base
32 @@ -1,1 +1,1 @@
34 @@ -1,1 +1,1 @@
33 -base
35 -base
34 +patched
36 +patched
35
37
36 $ hg qdiff .
38 $ hg qdiff .
37 diff -r e7af5904b465 1/base
39 diff -r e7af5904b465 1/base
38 --- a/1/base
40 --- a/1/base
39 +++ b/1/base
41 +++ b/1/base
40 @@ -1,1 +1,1 @@
42 @@ -1,1 +1,1 @@
41 -base
43 -base
42 +patched
44 +patched
43 diff -r e7af5904b465 2/base
45 diff -r e7af5904b465 2/base
44 --- a/2/base
46 --- a/2/base
45 +++ b/2/base
47 +++ b/2/base
46 @@ -1,1 +1,1 @@
48 @@ -1,1 +1,1 @@
47 -base
49 -base
48 +patched
50 +patched
49
51
50 $ cat .hg/patches/mqbase
52 $ cat .hg/patches/mqbase
51 # HG changeset patch
53 # HG changeset patch
52 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
54 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
53 mqbase
55 mqbase
54
56
55 diff -r e7af5904b465 1/base
57 diff -r e7af5904b465 1/base
56 --- a/1/base
58 --- a/1/base
57 +++ b/1/base
59 +++ b/1/base
58 @@ -1,1 +1,1 @@
60 @@ -1,1 +1,1 @@
59 -base
61 -base
60 +patched
62 +patched
61 diff -r e7af5904b465 2/base
63 diff -r e7af5904b465 2/base
62 --- a/2/base
64 --- a/2/base
63 +++ b/2/base
65 +++ b/2/base
64 @@ -1,1 +1,1 @@
66 @@ -1,1 +1,1 @@
65 -base
67 -base
66 +patched
68 +patched
67
69
68 $ echo 'patched again' > base
70 $ echo 'patched again' > base
69 $ hg qrefresh 1
71 $ hg qrefresh 1
70
72
71 $ hg qdiff
73 $ hg qdiff
72 diff -r e7af5904b465 1/base
74 diff -r e7af5904b465 1/base
73 --- a/1/base
75 --- a/1/base
74 +++ b/1/base
76 +++ b/1/base
75 @@ -1,1 +1,1 @@
77 @@ -1,1 +1,1 @@
76 -base
78 -base
77 +patched
79 +patched
78 diff -r e7af5904b465 2/base
80 diff -r e7af5904b465 2/base
79 --- a/2/base
81 --- a/2/base
80 +++ b/2/base
82 +++ b/2/base
81 @@ -1,1 +1,1 @@
83 @@ -1,1 +1,1 @@
82 -base
84 -base
83 +patched
85 +patched
84
86
85 $ hg qdiff .
87 $ hg qdiff .
86 diff -r e7af5904b465 1/base
88 diff -r e7af5904b465 1/base
87 --- a/1/base
89 --- a/1/base
88 +++ b/1/base
90 +++ b/1/base
89 @@ -1,1 +1,1 @@
91 @@ -1,1 +1,1 @@
90 -base
92 -base
91 +patched
93 +patched
92 diff -r e7af5904b465 2/base
94 diff -r e7af5904b465 2/base
93 --- a/2/base
95 --- a/2/base
94 +++ b/2/base
96 +++ b/2/base
95 @@ -1,1 +1,1 @@
97 @@ -1,1 +1,1 @@
96 -base
98 -base
97 +patched
99 +patched
98
100
99 $ cat .hg/patches/mqbase
101 $ cat .hg/patches/mqbase
100 # HG changeset patch
102 # HG changeset patch
101 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
103 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
102 mqbase
104 mqbase
103
105
104 diff -r e7af5904b465 1/base
106 diff -r e7af5904b465 1/base
105 --- a/1/base
107 --- a/1/base
106 +++ b/1/base
108 +++ b/1/base
107 @@ -1,1 +1,1 @@
109 @@ -1,1 +1,1 @@
108 -base
110 -base
109 +patched
111 +patched
110
112
111 qrefresh . in subdir:
113 qrefresh . in subdir:
112
114
113 $ ( cd 1 ; hg qrefresh . )
115 $ ( cd 1 ; hg qrefresh . )
114
116
115 $ hg qdiff
117 $ hg qdiff
116 diff -r e7af5904b465 1/base
118 diff -r e7af5904b465 1/base
117 --- a/1/base
119 --- a/1/base
118 +++ b/1/base
120 +++ b/1/base
119 @@ -1,1 +1,1 @@
121 @@ -1,1 +1,1 @@
120 -base
122 -base
121 +patched
123 +patched
122 diff -r e7af5904b465 2/base
124 diff -r e7af5904b465 2/base
123 --- a/2/base
125 --- a/2/base
124 +++ b/2/base
126 +++ b/2/base
125 @@ -1,1 +1,1 @@
127 @@ -1,1 +1,1 @@
126 -base
128 -base
127 +patched
129 +patched
128
130
129 $ hg qdiff .
131 $ hg qdiff .
130 diff -r e7af5904b465 1/base
132 diff -r e7af5904b465 1/base
131 --- a/1/base
133 --- a/1/base
132 +++ b/1/base
134 +++ b/1/base
133 @@ -1,1 +1,1 @@
135 @@ -1,1 +1,1 @@
134 -base
136 -base
135 +patched
137 +patched
136 diff -r e7af5904b465 2/base
138 diff -r e7af5904b465 2/base
137 --- a/2/base
139 --- a/2/base
138 +++ b/2/base
140 +++ b/2/base
139 @@ -1,1 +1,1 @@
141 @@ -1,1 +1,1 @@
140 -base
142 -base
141 +patched
143 +patched
142
144
143 $ cat .hg/patches/mqbase
145 $ cat .hg/patches/mqbase
144 # HG changeset patch
146 # HG changeset patch
145 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
147 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
146 mqbase
148 mqbase
147
149
148 diff -r e7af5904b465 1/base
150 diff -r e7af5904b465 1/base
149 --- a/1/base
151 --- a/1/base
150 +++ b/1/base
152 +++ b/1/base
151 @@ -1,1 +1,1 @@
153 @@ -1,1 +1,1 @@
152 -base
154 -base
153 +patched
155 +patched
154
156
155 qrefresh in hg-root again:
157 qrefresh in hg-root again:
156
158
157 $ hg qrefresh
159 $ hg qrefresh
158
160
159 $ hg qdiff
161 $ hg qdiff
160 diff -r e7af5904b465 1/base
162 diff -r e7af5904b465 1/base
161 --- a/1/base
163 --- a/1/base
162 +++ b/1/base
164 +++ b/1/base
163 @@ -1,1 +1,1 @@
165 @@ -1,1 +1,1 @@
164 -base
166 -base
165 +patched
167 +patched
166 diff -r e7af5904b465 2/base
168 diff -r e7af5904b465 2/base
167 --- a/2/base
169 --- a/2/base
168 +++ b/2/base
170 +++ b/2/base
169 @@ -1,1 +1,1 @@
171 @@ -1,1 +1,1 @@
170 -base
172 -base
171 +patched
173 +patched
172
174
173 $ hg qdiff .
175 $ hg qdiff .
174 diff -r e7af5904b465 1/base
176 diff -r e7af5904b465 1/base
175 --- a/1/base
177 --- a/1/base
176 +++ b/1/base
178 +++ b/1/base
177 @@ -1,1 +1,1 @@
179 @@ -1,1 +1,1 @@
178 -base
180 -base
179 +patched
181 +patched
180 diff -r e7af5904b465 2/base
182 diff -r e7af5904b465 2/base
181 --- a/2/base
183 --- a/2/base
182 +++ b/2/base
184 +++ b/2/base
183 @@ -1,1 +1,1 @@
185 @@ -1,1 +1,1 @@
184 -base
186 -base
185 +patched
187 +patched
186
188
187 $ cat .hg/patches/mqbase
189 $ cat .hg/patches/mqbase
188 # HG changeset patch
190 # HG changeset patch
189 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
191 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
190 mqbase
192 mqbase
191
193
192 diff -r e7af5904b465 1/base
194 diff -r e7af5904b465 1/base
193 --- a/1/base
195 --- a/1/base
194 +++ b/1/base
196 +++ b/1/base
195 @@ -1,1 +1,1 @@
197 @@ -1,1 +1,1 @@
196 -base
198 -base
197 +patched
199 +patched
198 diff -r e7af5904b465 2/base
200 diff -r e7af5904b465 2/base
199 --- a/2/base
201 --- a/2/base
200 +++ b/2/base
202 +++ b/2/base
201 @@ -1,1 +1,1 @@
203 @@ -1,1 +1,1 @@
202 -base
204 -base
203 +patched
205 +patched
204
206
205
207
206 qrefresh --short tests:
208 qrefresh --short tests:
207
209
208 $ echo 'orphan' > orphanchild
210 $ echo 'orphan' > orphanchild
209 $ hg add orphanchild
211 $ hg add orphanchild
210 $ hg qrefresh nonexistentfilename # clear patch
212 $ hg qrefresh nonexistentfilename # clear patch
211 nonexistentfilename: * (glob)
213 nonexistentfilename: * (glob)
212 $ hg diff -c qtip
214 $ hg diff -c qtip
213 $ hg qrefresh --short 1/base
215 $ hg qrefresh --short 1/base
214 $ hg qrefresh --short 2/base
216 $ hg qrefresh --short 2/base
215
217
216 $ hg qdiff
218 $ hg qdiff
217 diff -r e7af5904b465 1/base
219 diff -r e7af5904b465 1/base
218 --- a/1/base
220 --- a/1/base
219 +++ b/1/base
221 +++ b/1/base
220 @@ -1,1 +1,1 @@
222 @@ -1,1 +1,1 @@
221 -base
223 -base
222 +patched
224 +patched
223 diff -r e7af5904b465 2/base
225 diff -r e7af5904b465 2/base
224 --- a/2/base
226 --- a/2/base
225 +++ b/2/base
227 +++ b/2/base
226 @@ -1,1 +1,1 @@
228 @@ -1,1 +1,1 @@
227 -base
229 -base
228 +patched
230 +patched
229 diff -r e7af5904b465 orphanchild
231 diff -r e7af5904b465 orphanchild
230 --- /dev/null
232 --- /dev/null
231 +++ b/orphanchild
233 +++ b/orphanchild
232 @@ -0,0 +1,1 @@
234 @@ -0,0 +1,1 @@
233 +orphan
235 +orphan
234
236
235 $ cat .hg/patches/mqbase
237 $ cat .hg/patches/mqbase
236 # HG changeset patch
238 # HG changeset patch
237 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
239 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
238 mqbase
240 mqbase
239
241
240 diff -r e7af5904b465 1/base
242 diff -r e7af5904b465 1/base
241 --- a/1/base
243 --- a/1/base
242 +++ b/1/base
244 +++ b/1/base
243 @@ -1,1 +1,1 @@
245 @@ -1,1 +1,1 @@
244 -base
246 -base
245 +patched
247 +patched
246 diff -r e7af5904b465 2/base
248 diff -r e7af5904b465 2/base
247 --- a/2/base
249 --- a/2/base
248 +++ b/2/base
250 +++ b/2/base
249 @@ -1,1 +1,1 @@
251 @@ -1,1 +1,1 @@
250 -base
252 -base
251 +patched
253 +patched
252
254
253 $ hg st
255 $ hg st
254 A orphanchild
256 A orphanchild
255 ? base
257 ? base
256
258
257 diff shows what is not in patch:
259 diff shows what is not in patch:
258
260
259 $ hg diff
261 $ hg diff
260 diff -r ???????????? orphanchild (glob)
262 diff -r ???????????? orphanchild (glob)
261 --- /dev/null
263 --- /dev/null
262 +++ b/orphanchild
264 +++ b/orphanchild
263 @@ -0,0 +1,1 @@
265 @@ -0,0 +1,1 @@
264 +orphan
266 +orphan
265
267
266 Before starting exclusive tests:
268 Before starting exclusive tests:
267
269
268 $ cat .hg/patches/mqbase
270 $ cat .hg/patches/mqbase
269 # HG changeset patch
271 # HG changeset patch
270 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
272 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
271 mqbase
273 mqbase
272
274
273 diff -r e7af5904b465 1/base
275 diff -r e7af5904b465 1/base
274 --- a/1/base
276 --- a/1/base
275 +++ b/1/base
277 +++ b/1/base
276 @@ -1,1 +1,1 @@
278 @@ -1,1 +1,1 @@
277 -base
279 -base
278 +patched
280 +patched
279 diff -r e7af5904b465 2/base
281 diff -r e7af5904b465 2/base
280 --- a/2/base
282 --- a/2/base
281 +++ b/2/base
283 +++ b/2/base
282 @@ -1,1 +1,1 @@
284 @@ -1,1 +1,1 @@
283 -base
285 -base
284 +patched
286 +patched
285
287
286 Exclude 2/base:
288 Exclude 2/base:
287
289
288 $ hg qref -s -X 2/base
290 $ hg qref -s -X 2/base
289
291
290 $ cat .hg/patches/mqbase
292 $ cat .hg/patches/mqbase
291 # HG changeset patch
293 # HG changeset patch
292 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
294 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
293 mqbase
295 mqbase
294
296
295 diff -r e7af5904b465 1/base
297 diff -r e7af5904b465 1/base
296 --- a/1/base
298 --- a/1/base
297 +++ b/1/base
299 +++ b/1/base
298 @@ -1,1 +1,1 @@
300 @@ -1,1 +1,1 @@
299 -base
301 -base
300 +patched
302 +patched
301
303
302 status shows 2/base as dirty:
304 status shows 2/base as dirty:
303
305
304 $ hg status
306 $ hg status
305 M 2/base
307 M 2/base
306 A orphanchild
308 A orphanchild
307 ? base
309 ? base
308
310
309 Remove 1/base and add 2/base again but not orphanchild:
311 Remove 1/base and add 2/base again but not orphanchild:
310
312
311 $ hg qref -s -X orphanchild -X 1/base 2/base orphanchild
313 $ hg qref -s -X orphanchild -X 1/base 2/base orphanchild
312
314
313 $ cat .hg/patches/mqbase
315 $ cat .hg/patches/mqbase
314 # HG changeset patch
316 # HG changeset patch
315 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
317 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
316 mqbase
318 mqbase
317
319
318 diff -r e7af5904b465 2/base
320 diff -r e7af5904b465 2/base
319 --- a/2/base
321 --- a/2/base
320 +++ b/2/base
322 +++ b/2/base
321 @@ -1,1 +1,1 @@
323 @@ -1,1 +1,1 @@
322 -base
324 -base
323 +patched
325 +patched
324
326
325 Add 1/base with include filter - and thus remove 2/base from patch:
327 Add 1/base with include filter - and thus remove 2/base from patch:
326
328
327 $ hg qref -s -I 1/ o* */*
329 $ hg qref -s -I 1/ o* */*
328
330
329 $ cat .hg/patches/mqbase
331 $ cat .hg/patches/mqbase
330 # HG changeset patch
332 # HG changeset patch
331 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
333 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
332 mqbase
334 mqbase
333
335
334 diff -r e7af5904b465 1/base
336 diff -r e7af5904b465 1/base
335 --- a/1/base
337 --- a/1/base
336 +++ b/1/base
338 +++ b/1/base
337 @@ -1,1 +1,1 @@
339 @@ -1,1 +1,1 @@
338 -base
340 -base
339 +patched
341 +patched
340
342
341 $ cd ..
343 $ cd ..
342
344
343
345
344 Test qrefresh --git losing copy metadata:
346 Test qrefresh --git losing copy metadata:
345
347
346 $ hg init repo
348 $ hg init repo
347 $ cd repo
349 $ cd repo
348
350
349 $ echo "[diff]" >> .hg/hgrc
351 $ echo "[diff]" >> .hg/hgrc
350 $ echo "git=True" >> .hg/hgrc
352 $ echo "git=True" >> .hg/hgrc
351 $ echo a > a
353 $ echo a > a
352
354
353 $ hg ci -Am adda
355 $ hg ci -Am adda
354 adding a
356 adding a
355 $ hg copy a ab
357 $ hg copy a ab
356 $ echo b >> ab
358 $ echo b >> ab
357 $ hg copy a ac
359 $ hg copy a ac
358 $ echo c >> ac
360 $ echo c >> ac
359
361
360 Capture changes:
362 Capture changes:
361
363
362 $ hg qnew -f p1
364 $ hg qnew -f p1
363
365
364 $ hg qdiff
366 $ hg qdiff
365 diff --git a/a b/ab
367 diff --git a/a b/ab
366 copy from a
368 copy from a
367 copy to ab
369 copy to ab
368 --- a/a
370 --- a/a
369 +++ b/ab
371 +++ b/ab
370 @@ -1,1 +1,2 @@
372 @@ -1,1 +1,2 @@
371 a
373 a
372 +b
374 +b
373 diff --git a/a b/ac
375 diff --git a/a b/ac
374 copy from a
376 copy from a
375 copy to ac
377 copy to ac
376 --- a/a
378 --- a/a
377 +++ b/ac
379 +++ b/ac
378 @@ -1,1 +1,2 @@
380 @@ -1,1 +1,2 @@
379 a
381 a
380 +c
382 +c
381
383
382 Refresh and check changes again:
384 Refresh and check changes again:
383
385
384 $ hg qrefresh
386 $ hg qrefresh
385
387
386 $ hg qdiff
388 $ hg qdiff
387 diff --git a/a b/ab
389 diff --git a/a b/ab
388 copy from a
390 copy from a
389 copy to ab
391 copy to ab
390 --- a/a
392 --- a/a
391 +++ b/ab
393 +++ b/ab
392 @@ -1,1 +1,2 @@
394 @@ -1,1 +1,2 @@
393 a
395 a
394 +b
396 +b
395 diff --git a/a b/ac
397 diff --git a/a b/ac
396 copy from a
398 copy from a
397 copy to ac
399 copy to ac
398 --- a/a
400 --- a/a
399 +++ b/ac
401 +++ b/ac
400 @@ -1,1 +1,2 @@
402 @@ -1,1 +1,2 @@
401 a
403 a
402 +c
404 +c
403
405
404 $ cd ..
406 $ cd ..
405
407
406
408
407 Issue1441: qrefresh confused after hg rename:
409 Issue1441: qrefresh confused after hg rename:
408
410
409 $ hg init repo-1441
411 $ hg init repo-1441
410 $ cd repo-1441
412 $ cd repo-1441
411 $ echo a > a
413 $ echo a > a
412 $ hg add a
414 $ hg add a
413 $ hg qnew -f p
415 $ hg qnew -f p
414 $ hg mv a b
416 $ hg mv a b
415 $ hg qrefresh
417 $ hg qrefresh
416
418
417 $ hg qdiff
419 $ hg qdiff
418 diff -r 000000000000 b
420 diff -r 000000000000 b
419 --- /dev/null
421 --- /dev/null
420 +++ b/b
422 +++ b/b
421 @@ -0,0 +1,1 @@
423 @@ -0,0 +1,1 @@
422 +a
424 +a
423
425
424 $ cd ..
426 $ cd ..
425
427
426
428
427 Issue2025: qrefresh does not honor filtering options when tip !=
429 Issue2025: qrefresh does not honor filtering options when tip !=
428 qtip:
430 qtip:
429
431
430 $ hg init repo-2025
432 $ hg init repo-2025
431 $ cd repo-2025
433 $ cd repo-2025
432 $ echo a > a
434 $ echo a > a
433 $ echo b > b
435 $ echo b > b
434 $ hg ci -qAm addab
436 $ hg ci -qAm addab
435 $ echo a >> a
437 $ echo a >> a
436 $ echo b >> b
438 $ echo b >> b
437 $ hg qnew -f patch
439 $ hg qnew -f patch
438 $ hg up -qC 0
440 $ hg up -qC 0
439 $ echo c > c
441 $ echo c > c
440 $ hg ci -qAm addc
442 $ hg ci -qAm addc
441 $ hg up -qC 1
443 $ hg up -qC 1
442
444
443 refresh with tip != qtip:
445 refresh with tip != qtip:
444
446
445 $ hg --config diff.nodates=1 qrefresh -I b
447 $ hg --config diff.nodates=1 qrefresh -I b
446
448
447 $ hg st
449 $ hg st
448 M a
450 M a
449
451
450 $ cat b
452 $ cat b
451 b
453 b
452 b
454 b
453
455
454 $ cat .hg/patches/patch
456 $ cat .hg/patches/patch
455 # HG changeset patch
457 # HG changeset patch
456 # Parent 1a60229be7ac3e4a7f647508e99b87bef1f03593
458 # Parent 1a60229be7ac3e4a7f647508e99b87bef1f03593
457
459
458 diff -r 1a60229be7ac b
460 diff -r 1a60229be7ac b
459 --- a/b
461 --- a/b
460 +++ b/b
462 +++ b/b
461 @@ -1,1 +1,2 @@
463 @@ -1,1 +1,2 @@
462 b
464 b
463 +b
465 +b
464
466
465 $ cd ..
467 $ cd ..
466
468
467
469
468 Issue1441 with git patches:
470 Issue1441 with git patches:
469
471
470 $ hg init repo-1441-git
472 $ hg init repo-1441-git
471 $ cd repo-1441-git
473 $ cd repo-1441-git
472
474
473 $ echo "[diff]" >> .hg/hgrc
475 $ echo "[diff]" >> .hg/hgrc
474 $ echo "git=True" >> .hg/hgrc
476 $ echo "git=True" >> .hg/hgrc
475
477
476 $ echo a > a
478 $ echo a > a
477 $ hg add a
479 $ hg add a
478 $ hg qnew -f p
480 $ hg qnew -f p
479 $ hg mv a b
481 $ hg mv a b
480 $ hg qrefresh
482 $ hg qrefresh
481
483
482 $ hg qdiff --nodates
484 $ hg qdiff --nodates
483 diff --git a/b b/b
485 diff --git a/b b/b
484 new file mode 100644
486 new file mode 100644
485 --- /dev/null
487 --- /dev/null
486 +++ b/b
488 +++ b/b
487 @@ -0,0 +1,1 @@
489 @@ -0,0 +1,1 @@
488 +a
490 +a
489
491
490 $ cd ..
492 $ cd ..
491
493
492 Refresh with bad usernames. Mercurial used to abort on bad usernames,
494 Refresh with bad usernames. Mercurial used to abort on bad usernames,
493 but only after writing the bad name into the patch.
495 but only after writing the bad name into the patch.
494
496
495 $ hg init bad-usernames
497 $ hg init bad-usernames
496 $ cd bad-usernames
498 $ cd bad-usernames
497 $ touch a
499 $ touch a
498 $ hg add a
500 $ hg add a
499 $ hg qnew a
501 $ hg qnew a
500 $ hg qrefresh -u 'foo
502 $ hg qrefresh -u 'foo
501 > bar'
503 > bar'
502 transaction abort!
504 transaction abort!
503 rollback completed
505 rollback completed
504 refresh interrupted while patch was popped! (revert --all, qpush to recover)
506 refresh interrupted while patch was popped! (revert --all, qpush to recover)
505 abort: username 'foo\nbar' contains a newline!
507 abort: username 'foo\nbar' contains a newline!
506 [255]
508 [255]
507 $ rm a
509 $ rm a
508 $ cat .hg/patches/a
510 $ cat .hg/patches/a
509 # HG changeset patch
511 # HG changeset patch
510 # Parent 0000000000000000000000000000000000000000
512 # Parent 0000000000000000000000000000000000000000
511
513
512 diff --git a/a b/a
514 diff --git a/a b/a
513 new file mode 100644
515 new file mode 100644
514 $ hg qpush
516 $ hg qpush
515 applying a
517 applying a
516 now at: a
518 now at: a
517 $ hg qrefresh -u ' '
519 $ hg qrefresh -u ' '
518 transaction abort!
520 transaction abort!
519 rollback completed
521 rollback completed
520 refresh interrupted while patch was popped! (revert --all, qpush to recover)
522 refresh interrupted while patch was popped! (revert --all, qpush to recover)
521 abort: empty username!
523 abort: empty username!
522 [255]
524 [255]
523 $ cat .hg/patches/a
525 $ cat .hg/patches/a
524 # HG changeset patch
526 # HG changeset patch
525 # Parent 0000000000000000000000000000000000000000
527 # Parent 0000000000000000000000000000000000000000
526
528
527 diff --git a/a b/a
529 diff --git a/a b/a
528 new file mode 100644
530 new file mode 100644
529 $ cd ..
531 $ cd ..
530
532
531 Refresh with phase data:
533 Refresh with phase data:
532
534
533
535
534
536
535 $ cd repo
537 $ cd repo
536 $ echo 'babar' >> a
538 $ echo 'babar' >> a
537 $ hg qnew -m 'update a' p2.diff
539 $ hg qnew -m 'update a' p2.diff
538 $ hg phase p2.diff
540 $ hg phase p2.diff
539 2: draft
541 2: draft
540 $ echo 'beber' >> a
542 $ echo 'beber' >> a
541 $ hg qref
543 $ hg qref
542 $ hg phase p2.diff
544 $ hg phase p2.diff
543 2: draft
545 2: draft
544 $ hg phase --force --secret p2.diff
546 $ hg phase --force --secret p2.diff
545 $ echo 'bibir' >> a
547 $ echo 'bibir' >> a
546 $ hg qref
548 $ hg qref
547 $ hg phase p2.diff
549 $ hg phase p2.diff
548 2: secret
550 2: secret
549
551
550 $ cd ..
552 $ cd ..
@@ -1,54 +1,56 b''
1 #require svn13
1 #require svn13
2
2
3 $ echo "[extensions]" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 $ echo "mq=" >> $HGRCPATH
4 > [extensions]
5 $ echo "[diff]" >> $HGRCPATH
5 > mq =
6 $ echo "nodates=1" >> $HGRCPATH
6 > [diff]
7 > nodates = 1
8 > EOF
7
9
8 fn to create new repository, and cd into it
10 fn to create new repository, and cd into it
9 $ mkrepo() {
11 $ mkrepo() {
10 > hg init $1
12 > hg init $1
11 > cd $1
13 > cd $1
12 > hg qinit
14 > hg qinit
13 > }
15 > }
14
16
15
17
16 handle svn subrepos safely
18 handle svn subrepos safely
17
19
18 $ svnadmin create svn-repo-2499
20 $ svnadmin create svn-repo-2499
19
21
20 $ SVNREPOPATH=`pwd`/svn-repo-2499/project
22 $ SVNREPOPATH=`pwd`/svn-repo-2499/project
21 #if windows
23 #if windows
22 $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
24 $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
23 #else
25 #else
24 $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
26 $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
25 #endif
27 #endif
26
28
27 $ mkdir -p svn-project-2499/trunk
29 $ mkdir -p svn-project-2499/trunk
28 $ svn import -m 'init project' svn-project-2499 "$SVNREPOURL"
30 $ svn import -m 'init project' svn-project-2499 "$SVNREPOURL"
29 Adding svn-project-2499/trunk (glob)
31 Adding svn-project-2499/trunk (glob)
30
32
31 Committed revision 1.
33 Committed revision 1.
32
34
33 qnew on repo w/svn subrepo
35 qnew on repo w/svn subrepo
34 $ mkrepo repo-2499-svn-subrepo
36 $ mkrepo repo-2499-svn-subrepo
35 $ svn co "$SVNREPOURL"/trunk sub
37 $ svn co "$SVNREPOURL"/trunk sub
36 Checked out revision 1.
38 Checked out revision 1.
37 $ echo 'sub = [svn]sub' >> .hgsub
39 $ echo 'sub = [svn]sub' >> .hgsub
38 $ hg add .hgsub
40 $ hg add .hgsub
39 $ hg status -S -X '**/format'
41 $ hg status -S -X '**/format'
40 A .hgsub
42 A .hgsub
41 $ hg qnew -m0 0.diff
43 $ hg qnew -m0 0.diff
42 $ cd sub
44 $ cd sub
43 $ echo a > a
45 $ echo a > a
44 $ svn add a
46 $ svn add a
45 A a
47 A a
46 $ svn st
48 $ svn st
47 A* a (glob)
49 A* a (glob)
48 $ cd ..
50 $ cd ..
49 $ hg status -S # doesn't show status for svn subrepos (yet)
51 $ hg status -S # doesn't show status for svn subrepos (yet)
50 $ hg qnew -m1 1.diff
52 $ hg qnew -m1 1.diff
51 abort: uncommitted changes in subrepository sub
53 abort: uncommitted changes in subrepository sub
52 [255]
54 [255]
53
55
54 $ cd ..
56 $ cd ..
@@ -1,609 +1,611 b''
1 $ echo "[ui]" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 $ echo "commitsubrepos = Yes" >> $HGRCPATH
2 > [ui]
3 $ echo "[extensions]" >> $HGRCPATH
3 > commitsubrepos = Yes
4 $ echo "mq=" >> $HGRCPATH
4 > [extensions]
5 $ echo "record=" >> $HGRCPATH
5 > mq =
6 $ echo "[diff]" >> $HGRCPATH
6 > record =
7 $ echo "nodates=1" >> $HGRCPATH
7 > [diff]
8 > nodates = 1
9 > EOF
8
10
9 $ stdin=`pwd`/stdin.tmp
11 $ stdin=`pwd`/stdin.tmp
10
12
11 fn to create new repository w/dirty subrepo, and cd into it
13 fn to create new repository w/dirty subrepo, and cd into it
12 $ mkrepo() {
14 $ mkrepo() {
13 > hg init $1
15 > hg init $1
14 > cd $1
16 > cd $1
15 > hg qinit
17 > hg qinit
16 > }
18 > }
17
19
18 fn to create dirty subrepo
20 fn to create dirty subrepo
19 $ mksubrepo() {
21 $ mksubrepo() {
20 > hg init $1
22 > hg init $1
21 > cd $1
23 > cd $1
22 > echo a > a
24 > echo a > a
23 > hg add
25 > hg add
24 > cd ..
26 > cd ..
25 > }
27 > }
26
28
27 $ testadd() {
29 $ testadd() {
28 > cat - > "$stdin"
30 > cat - > "$stdin"
29 > mksubrepo sub
31 > mksubrepo sub
30 > echo sub = sub >> .hgsub
32 > echo sub = sub >> .hgsub
31 > hg add .hgsub
33 > hg add .hgsub
32 > echo % abort when adding .hgsub w/dirty subrepo
34 > echo % abort when adding .hgsub w/dirty subrepo
33 > hg status -S
35 > hg status -S
34 > echo '%' $*
36 > echo '%' $*
35 > cat "$stdin" | hg $*
37 > cat "$stdin" | hg $*
36 > echo [$?]
38 > echo [$?]
37 > hg -R sub ci -m0sub
39 > hg -R sub ci -m0sub
38 > echo % update substate when adding .hgsub w/clean updated subrepo
40 > echo % update substate when adding .hgsub w/clean updated subrepo
39 > hg status -S
41 > hg status -S
40 > echo '%' $*
42 > echo '%' $*
41 > cat "$stdin" | hg $*
43 > cat "$stdin" | hg $*
42 > hg debugsub
44 > hg debugsub
43 > }
45 > }
44
46
45 $ testmod() {
47 $ testmod() {
46 > cat - > "$stdin"
48 > cat - > "$stdin"
47 > mksubrepo sub2
49 > mksubrepo sub2
48 > echo sub2 = sub2 >> .hgsub
50 > echo sub2 = sub2 >> .hgsub
49 > echo % abort when modifying .hgsub w/dirty subrepo
51 > echo % abort when modifying .hgsub w/dirty subrepo
50 > hg status -S
52 > hg status -S
51 > echo '%' $*
53 > echo '%' $*
52 > cat "$stdin" | hg $*
54 > cat "$stdin" | hg $*
53 > echo [$?]
55 > echo [$?]
54 > hg -R sub2 ci -m0sub2
56 > hg -R sub2 ci -m0sub2
55 > echo % update substate when modifying .hgsub w/clean updated subrepo
57 > echo % update substate when modifying .hgsub w/clean updated subrepo
56 > hg status -S
58 > hg status -S
57 > echo '%' $*
59 > echo '%' $*
58 > cat "$stdin" | hg $*
60 > cat "$stdin" | hg $*
59 > hg debugsub
61 > hg debugsub
60 > }
62 > }
61
63
62 $ testrm1() {
64 $ testrm1() {
63 > cat - > "$stdin"
65 > cat - > "$stdin"
64 > mksubrepo sub3
66 > mksubrepo sub3
65 > echo sub3 = sub3 >> .hgsub
67 > echo sub3 = sub3 >> .hgsub
66 > hg ci -Aqmsub3
68 > hg ci -Aqmsub3
67 > $EXTRA
69 > $EXTRA
68 > echo b >> sub3/a
70 > echo b >> sub3/a
69 > hg rm .hgsub
71 > hg rm .hgsub
70 > echo % update substate when removing .hgsub w/dirty subrepo
72 > echo % update substate when removing .hgsub w/dirty subrepo
71 > hg status -S
73 > hg status -S
72 > echo '%' $*
74 > echo '%' $*
73 > cat "$stdin" | hg $*
75 > cat "$stdin" | hg $*
74 > echo % debugsub should be empty
76 > echo % debugsub should be empty
75 > hg debugsub
77 > hg debugsub
76 > }
78 > }
77
79
78 $ testrm2() {
80 $ testrm2() {
79 > cat - > "$stdin"
81 > cat - > "$stdin"
80 > mksubrepo sub4
82 > mksubrepo sub4
81 > echo sub4 = sub4 >> .hgsub
83 > echo sub4 = sub4 >> .hgsub
82 > hg ci -Aqmsub4
84 > hg ci -Aqmsub4
83 > $EXTRA
85 > $EXTRA
84 > hg rm .hgsub
86 > hg rm .hgsub
85 > echo % update substate when removing .hgsub w/clean updated subrepo
87 > echo % update substate when removing .hgsub w/clean updated subrepo
86 > hg status -S
88 > hg status -S
87 > echo '%' $*
89 > echo '%' $*
88 > cat "$stdin" | hg $*
90 > cat "$stdin" | hg $*
89 > echo % debugsub should be empty
91 > echo % debugsub should be empty
90 > hg debugsub
92 > hg debugsub
91 > }
93 > }
92
94
93
95
94 handle subrepos safely on qnew
96 handle subrepos safely on qnew
95
97
96 $ mkrepo repo-2499-qnew
98 $ mkrepo repo-2499-qnew
97 $ testadd qnew -X path:no-effect -m0 0.diff
99 $ testadd qnew -X path:no-effect -m0 0.diff
98 adding a
100 adding a
99 % abort when adding .hgsub w/dirty subrepo
101 % abort when adding .hgsub w/dirty subrepo
100 A .hgsub
102 A .hgsub
101 A sub/a
103 A sub/a
102 % qnew -X path:no-effect -m0 0.diff
104 % qnew -X path:no-effect -m0 0.diff
103 abort: uncommitted changes in subrepository sub
105 abort: uncommitted changes in subrepository sub
104 [255]
106 [255]
105 % update substate when adding .hgsub w/clean updated subrepo
107 % update substate when adding .hgsub w/clean updated subrepo
106 A .hgsub
108 A .hgsub
107 % qnew -X path:no-effect -m0 0.diff
109 % qnew -X path:no-effect -m0 0.diff
108 path sub
110 path sub
109 source sub
111 source sub
110 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
112 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
111
113
112 $ testmod qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
114 $ testmod qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
113 adding a
115 adding a
114 % abort when modifying .hgsub w/dirty subrepo
116 % abort when modifying .hgsub w/dirty subrepo
115 M .hgsub
117 M .hgsub
116 A sub2/a
118 A sub2/a
117 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
119 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
118 abort: uncommitted changes in subrepository sub2
120 abort: uncommitted changes in subrepository sub2
119 [255]
121 [255]
120 % update substate when modifying .hgsub w/clean updated subrepo
122 % update substate when modifying .hgsub w/clean updated subrepo
121 M .hgsub
123 M .hgsub
122 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
124 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
123 path sub
125 path sub
124 source sub
126 source sub
125 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
127 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
126 path sub2
128 path sub2
127 source sub2
129 source sub2
128 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
130 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
129
131
130 $ hg qpop -qa
132 $ hg qpop -qa
131 patch queue now empty
133 patch queue now empty
132 $ testrm1 qnew -m2 2.diff
134 $ testrm1 qnew -m2 2.diff
133 adding a
135 adding a
134 % update substate when removing .hgsub w/dirty subrepo
136 % update substate when removing .hgsub w/dirty subrepo
135 M sub3/a
137 M sub3/a
136 R .hgsub
138 R .hgsub
137 % qnew -m2 2.diff
139 % qnew -m2 2.diff
138 % debugsub should be empty
140 % debugsub should be empty
139
141
140 $ hg qpop -qa
142 $ hg qpop -qa
141 patch queue now empty
143 patch queue now empty
142 $ testrm2 qnew -m3 3.diff
144 $ testrm2 qnew -m3 3.diff
143 adding a
145 adding a
144 % update substate when removing .hgsub w/clean updated subrepo
146 % update substate when removing .hgsub w/clean updated subrepo
145 R .hgsub
147 R .hgsub
146 % qnew -m3 3.diff
148 % qnew -m3 3.diff
147 % debugsub should be empty
149 % debugsub should be empty
148
150
149 $ cd ..
151 $ cd ..
150
152
151
153
152 handle subrepos safely on qrefresh
154 handle subrepos safely on qrefresh
153
155
154 $ mkrepo repo-2499-qrefresh
156 $ mkrepo repo-2499-qrefresh
155 $ hg qnew -m0 0.diff
157 $ hg qnew -m0 0.diff
156 $ testadd qrefresh
158 $ testadd qrefresh
157 adding a
159 adding a
158 % abort when adding .hgsub w/dirty subrepo
160 % abort when adding .hgsub w/dirty subrepo
159 A .hgsub
161 A .hgsub
160 A sub/a
162 A sub/a
161 % qrefresh
163 % qrefresh
162 abort: uncommitted changes in subrepository sub
164 abort: uncommitted changes in subrepository sub
163 [255]
165 [255]
164 % update substate when adding .hgsub w/clean updated subrepo
166 % update substate when adding .hgsub w/clean updated subrepo
165 A .hgsub
167 A .hgsub
166 % qrefresh
168 % qrefresh
167 path sub
169 path sub
168 source sub
170 source sub
169 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
171 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
170
172
171 $ hg qnew -m1 1.diff
173 $ hg qnew -m1 1.diff
172 $ testmod qrefresh
174 $ testmod qrefresh
173 adding a
175 adding a
174 % abort when modifying .hgsub w/dirty subrepo
176 % abort when modifying .hgsub w/dirty subrepo
175 M .hgsub
177 M .hgsub
176 A sub2/a
178 A sub2/a
177 % qrefresh
179 % qrefresh
178 abort: uncommitted changes in subrepository sub2
180 abort: uncommitted changes in subrepository sub2
179 [255]
181 [255]
180 % update substate when modifying .hgsub w/clean updated subrepo
182 % update substate when modifying .hgsub w/clean updated subrepo
181 M .hgsub
183 M .hgsub
182 % qrefresh
184 % qrefresh
183 path sub
185 path sub
184 source sub
186 source sub
185 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
187 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
186 path sub2
188 path sub2
187 source sub2
189 source sub2
188 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
190 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
189
191
190 $ hg qpop -qa
192 $ hg qpop -qa
191 patch queue now empty
193 patch queue now empty
192 $ EXTRA='hg qnew -m2 2.diff'
194 $ EXTRA='hg qnew -m2 2.diff'
193 $ testrm1 qrefresh
195 $ testrm1 qrefresh
194 adding a
196 adding a
195 % update substate when removing .hgsub w/dirty subrepo
197 % update substate when removing .hgsub w/dirty subrepo
196 M sub3/a
198 M sub3/a
197 R .hgsub
199 R .hgsub
198 % qrefresh
200 % qrefresh
199 % debugsub should be empty
201 % debugsub should be empty
200
202
201 $ hg qpop -qa
203 $ hg qpop -qa
202 patch queue now empty
204 patch queue now empty
203 $ EXTRA='hg qnew -m3 3.diff'
205 $ EXTRA='hg qnew -m3 3.diff'
204 $ testrm2 qrefresh
206 $ testrm2 qrefresh
205 adding a
207 adding a
206 % update substate when removing .hgsub w/clean updated subrepo
208 % update substate when removing .hgsub w/clean updated subrepo
207 R .hgsub
209 R .hgsub
208 % qrefresh
210 % qrefresh
209 % debugsub should be empty
211 % debugsub should be empty
210 $ EXTRA=
212 $ EXTRA=
211
213
212 $ cd ..
214 $ cd ..
213
215
214
216
215 handle subrepos safely on qpush/qpop
217 handle subrepos safely on qpush/qpop
216 (and we cannot qpop / qpush with a modified subrepo)
218 (and we cannot qpop / qpush with a modified subrepo)
217
219
218 $ mkrepo repo-2499-qpush
220 $ mkrepo repo-2499-qpush
219 $ mksubrepo sub
221 $ mksubrepo sub
220 adding a
222 adding a
221 $ hg -R sub ci -m0sub
223 $ hg -R sub ci -m0sub
222 $ echo sub = sub > .hgsub
224 $ echo sub = sub > .hgsub
223 $ hg add .hgsub
225 $ hg add .hgsub
224 $ hg commit -m0
226 $ hg commit -m0
225 $ hg debugsub
227 $ hg debugsub
226 path sub
228 path sub
227 source sub
229 source sub
228 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
230 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
229 $ echo foo > ./sub/a
231 $ echo foo > ./sub/a
230 $ hg -R sub commit -m foo
232 $ hg -R sub commit -m foo
231 $ hg commit -m1
233 $ hg commit -m1
232 $ hg qimport -r "0:tip"
234 $ hg qimport -r "0:tip"
233 $ hg -R sub id --id
235 $ hg -R sub id --id
234 aa037b301eba
236 aa037b301eba
235
237
236 qpop
238 qpop
237 $ hg -R sub update 0000
239 $ hg -R sub update 0000
238 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
240 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
239 $ hg qpop
241 $ hg qpop
240 abort: local changed subrepos found, refresh first
242 abort: local changed subrepos found, refresh first
241 [255]
243 [255]
242 $ hg revert sub
244 $ hg revert sub
243 reverting subrepo sub
245 reverting subrepo sub
244 adding sub/a
246 adding sub/a
245 $ hg qpop
247 $ hg qpop
246 popping 1.diff
248 popping 1.diff
247 now at: 0.diff
249 now at: 0.diff
248 $ hg status -AS
250 $ hg status -AS
249 C .hgsub
251 C .hgsub
250 C .hgsubstate
252 C .hgsubstate
251 C sub/a
253 C sub/a
252 $ hg -R sub id --id
254 $ hg -R sub id --id
253 b2fdb12cd82b
255 b2fdb12cd82b
254
256
255 qpush
257 qpush
256 $ hg -R sub update 0000
258 $ hg -R sub update 0000
257 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
259 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
258 $ hg qpush
260 $ hg qpush
259 abort: local changed subrepos found, refresh first
261 abort: local changed subrepos found, refresh first
260 [255]
262 [255]
261 $ hg revert sub
263 $ hg revert sub
262 reverting subrepo sub
264 reverting subrepo sub
263 adding sub/a
265 adding sub/a
264 $ hg qpush
266 $ hg qpush
265 applying 1.diff
267 applying 1.diff
266 subrepository sub diverged (local revision: b2fdb12cd82b, remote revision: aa037b301eba)
268 subrepository sub diverged (local revision: b2fdb12cd82b, remote revision: aa037b301eba)
267 (M)erge, keep (l)ocal or keep (r)emote? m
269 (M)erge, keep (l)ocal or keep (r)emote? m
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
270 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 now at: 1.diff
271 now at: 1.diff
270 $ hg status -AS
272 $ hg status -AS
271 C .hgsub
273 C .hgsub
272 C .hgsubstate
274 C .hgsubstate
273 C sub/a
275 C sub/a
274 $ hg -R sub id --id
276 $ hg -R sub id --id
275 aa037b301eba
277 aa037b301eba
276
278
277 $ cd ..
279 $ cd ..
278
280
279
281
280 handle subrepos safely on qrecord
282 handle subrepos safely on qrecord
281
283
282 $ mkrepo repo-2499-qrecord
284 $ mkrepo repo-2499-qrecord
283 $ testadd qrecord --config ui.interactive=1 -m0 0.diff <<EOF
285 $ testadd qrecord --config ui.interactive=1 -m0 0.diff <<EOF
284 > y
286 > y
285 > y
287 > y
286 > EOF
288 > EOF
287 adding a
289 adding a
288 % abort when adding .hgsub w/dirty subrepo
290 % abort when adding .hgsub w/dirty subrepo
289 A .hgsub
291 A .hgsub
290 A sub/a
292 A sub/a
291 % qrecord --config ui.interactive=1 -m0 0.diff
293 % qrecord --config ui.interactive=1 -m0 0.diff
292 diff --git a/.hgsub b/.hgsub
294 diff --git a/.hgsub b/.hgsub
293 new file mode 100644
295 new file mode 100644
294 examine changes to '.hgsub'? [Ynesfdaq?] y
296 examine changes to '.hgsub'? [Ynesfdaq?] y
295
297
296 abort: uncommitted changes in subrepository sub
298 abort: uncommitted changes in subrepository sub
297 [255]
299 [255]
298 % update substate when adding .hgsub w/clean updated subrepo
300 % update substate when adding .hgsub w/clean updated subrepo
299 A .hgsub
301 A .hgsub
300 % qrecord --config ui.interactive=1 -m0 0.diff
302 % qrecord --config ui.interactive=1 -m0 0.diff
301 diff --git a/.hgsub b/.hgsub
303 diff --git a/.hgsub b/.hgsub
302 new file mode 100644
304 new file mode 100644
303 examine changes to '.hgsub'? [Ynesfdaq?] y
305 examine changes to '.hgsub'? [Ynesfdaq?] y
304
306
305 path sub
307 path sub
306 source sub
308 source sub
307 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
309 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
308
310
309 $ testmod qrecord --config ui.interactive=1 -m1 1.diff <<EOF
311 $ testmod qrecord --config ui.interactive=1 -m1 1.diff <<EOF
310 > y
312 > y
311 > y
313 > y
312 > EOF
314 > EOF
313 adding a
315 adding a
314 % abort when modifying .hgsub w/dirty subrepo
316 % abort when modifying .hgsub w/dirty subrepo
315 M .hgsub
317 M .hgsub
316 A sub2/a
318 A sub2/a
317 % qrecord --config ui.interactive=1 -m1 1.diff
319 % qrecord --config ui.interactive=1 -m1 1.diff
318 diff --git a/.hgsub b/.hgsub
320 diff --git a/.hgsub b/.hgsub
319 1 hunks, 1 lines changed
321 1 hunks, 1 lines changed
320 examine changes to '.hgsub'? [Ynesfdaq?] y
322 examine changes to '.hgsub'? [Ynesfdaq?] y
321
323
322 @@ -1,1 +1,2 @@
324 @@ -1,1 +1,2 @@
323 sub = sub
325 sub = sub
324 +sub2 = sub2
326 +sub2 = sub2
325 record this change to '.hgsub'? [Ynesfdaq?] y
327 record this change to '.hgsub'? [Ynesfdaq?] y
326
328
327 abort: uncommitted changes in subrepository sub2
329 abort: uncommitted changes in subrepository sub2
328 [255]
330 [255]
329 % update substate when modifying .hgsub w/clean updated subrepo
331 % update substate when modifying .hgsub w/clean updated subrepo
330 M .hgsub
332 M .hgsub
331 % qrecord --config ui.interactive=1 -m1 1.diff
333 % qrecord --config ui.interactive=1 -m1 1.diff
332 diff --git a/.hgsub b/.hgsub
334 diff --git a/.hgsub b/.hgsub
333 1 hunks, 1 lines changed
335 1 hunks, 1 lines changed
334 examine changes to '.hgsub'? [Ynesfdaq?] y
336 examine changes to '.hgsub'? [Ynesfdaq?] y
335
337
336 @@ -1,1 +1,2 @@
338 @@ -1,1 +1,2 @@
337 sub = sub
339 sub = sub
338 +sub2 = sub2
340 +sub2 = sub2
339 record this change to '.hgsub'? [Ynesfdaq?] y
341 record this change to '.hgsub'? [Ynesfdaq?] y
340
342
341 path sub
343 path sub
342 source sub
344 source sub
343 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
345 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
344 path sub2
346 path sub2
345 source sub2
347 source sub2
346 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
348 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
347
349
348 $ hg qpop -qa
350 $ hg qpop -qa
349 patch queue now empty
351 patch queue now empty
350 $ testrm1 qrecord --config ui.interactive=1 -m2 2.diff <<EOF
352 $ testrm1 qrecord --config ui.interactive=1 -m2 2.diff <<EOF
351 > y
353 > y
352 > y
354 > y
353 > EOF
355 > EOF
354 adding a
356 adding a
355 % update substate when removing .hgsub w/dirty subrepo
357 % update substate when removing .hgsub w/dirty subrepo
356 M sub3/a
358 M sub3/a
357 R .hgsub
359 R .hgsub
358 % qrecord --config ui.interactive=1 -m2 2.diff
360 % qrecord --config ui.interactive=1 -m2 2.diff
359 diff --git a/.hgsub b/.hgsub
361 diff --git a/.hgsub b/.hgsub
360 deleted file mode 100644
362 deleted file mode 100644
361 examine changes to '.hgsub'? [Ynesfdaq?] y
363 examine changes to '.hgsub'? [Ynesfdaq?] y
362
364
363 % debugsub should be empty
365 % debugsub should be empty
364
366
365 $ hg qpop -qa
367 $ hg qpop -qa
366 patch queue now empty
368 patch queue now empty
367 $ testrm2 qrecord --config ui.interactive=1 -m3 3.diff <<EOF
369 $ testrm2 qrecord --config ui.interactive=1 -m3 3.diff <<EOF
368 > y
370 > y
369 > y
371 > y
370 > EOF
372 > EOF
371 adding a
373 adding a
372 % update substate when removing .hgsub w/clean updated subrepo
374 % update substate when removing .hgsub w/clean updated subrepo
373 R .hgsub
375 R .hgsub
374 % qrecord --config ui.interactive=1 -m3 3.diff
376 % qrecord --config ui.interactive=1 -m3 3.diff
375 diff --git a/.hgsub b/.hgsub
377 diff --git a/.hgsub b/.hgsub
376 deleted file mode 100644
378 deleted file mode 100644
377 examine changes to '.hgsub'? [Ynesfdaq?] y
379 examine changes to '.hgsub'? [Ynesfdaq?] y
378
380
379 % debugsub should be empty
381 % debugsub should be empty
380
382
381 $ cd ..
383 $ cd ..
382
384
383
385
384 correctly handle subrepos with patch queues
386 correctly handle subrepos with patch queues
385 $ mkrepo repo-subrepo-with-queue
387 $ mkrepo repo-subrepo-with-queue
386 $ mksubrepo sub
388 $ mksubrepo sub
387 adding a
389 adding a
388 $ hg -R sub qnew sub0.diff
390 $ hg -R sub qnew sub0.diff
389 $ echo sub = sub >> .hgsub
391 $ echo sub = sub >> .hgsub
390 $ hg add .hgsub
392 $ hg add .hgsub
391 $ hg qnew 0.diff
393 $ hg qnew 0.diff
392
394
393 $ cd ..
395 $ cd ..
394
396
395 check whether MQ operations can import updated .hgsubstate correctly
397 check whether MQ operations can import updated .hgsubstate correctly
396 both into 'revision' and 'patch file under .hg/patches':
398 both into 'revision' and 'patch file under .hg/patches':
397
399
398 $ hg init importing-hgsubstate
400 $ hg init importing-hgsubstate
399 $ cd importing-hgsubstate
401 $ cd importing-hgsubstate
400
402
401 $ echo a > a
403 $ echo a > a
402 $ hg commit -u test -d '0 0' -Am '#0 in parent'
404 $ hg commit -u test -d '0 0' -Am '#0 in parent'
403 adding a
405 adding a
404 $ hg init sub
406 $ hg init sub
405 $ echo sa > sub/sa
407 $ echo sa > sub/sa
406 $ hg -R sub commit -u test -d '0 0' -Am '#0 in sub'
408 $ hg -R sub commit -u test -d '0 0' -Am '#0 in sub'
407 adding sa
409 adding sa
408 $ echo 'sub = sub' > .hgsub
410 $ echo 'sub = sub' > .hgsub
409 $ touch .hgsubstate
411 $ touch .hgsubstate
410 $ hg add .hgsub .hgsubstate
412 $ hg add .hgsub .hgsubstate
411
413
412 $ hg qnew -u test -d '0 0' import-at-qnew
414 $ hg qnew -u test -d '0 0' import-at-qnew
413 $ hg -R sub parents --template '{node} sub\n'
415 $ hg -R sub parents --template '{node} sub\n'
414 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
416 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
415 $ cat .hgsubstate
417 $ cat .hgsubstate
416 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
418 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
417 $ hg diff -c tip
419 $ hg diff -c tip
418 diff -r f499373e340c -r f69e96d86e75 .hgsub
420 diff -r f499373e340c -r f69e96d86e75 .hgsub
419 --- /dev/null
421 --- /dev/null
420 +++ b/.hgsub
422 +++ b/.hgsub
421 @@ -0,0 +1,1 @@
423 @@ -0,0 +1,1 @@
422 +sub = sub
424 +sub = sub
423 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
425 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
424 --- /dev/null
426 --- /dev/null
425 +++ b/.hgsubstate
427 +++ b/.hgsubstate
426 @@ -0,0 +1,1 @@
428 @@ -0,0 +1,1 @@
427 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
429 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
428 $ cat .hg/patches/import-at-qnew
430 $ cat .hg/patches/import-at-qnew
429 # HG changeset patch
431 # HG changeset patch
430 # User test
432 # User test
431 # Date 0 0
433 # Date 0 0
432 # Parent f499373e340cdca5d01dee904aeb42dd2a325e71
434 # Parent f499373e340cdca5d01dee904aeb42dd2a325e71
433
435
434 diff -r f499373e340c -r f69e96d86e75 .hgsub
436 diff -r f499373e340c -r f69e96d86e75 .hgsub
435 --- /dev/null
437 --- /dev/null
436 +++ b/.hgsub
438 +++ b/.hgsub
437 @@ -0,0 +1,1 @@
439 @@ -0,0 +1,1 @@
438 +sub = sub
440 +sub = sub
439 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
441 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
440 --- /dev/null
442 --- /dev/null
441 +++ b/.hgsubstate
443 +++ b/.hgsubstate
442 @@ -0,0 +1,1 @@
444 @@ -0,0 +1,1 @@
443 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
445 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
444 $ hg parents --template '{node}\n'
446 $ hg parents --template '{node}\n'
445 f69e96d86e75a6d4fd88285dc9697acb23951041
447 f69e96d86e75a6d4fd88285dc9697acb23951041
446 $ hg parents --template '{files}\n'
448 $ hg parents --template '{files}\n'
447 .hgsub .hgsubstate
449 .hgsub .hgsubstate
448
450
449 check also whether qnew not including ".hgsubstate" explicitly causes
451 check also whether qnew not including ".hgsubstate" explicitly causes
450 as same result (in node hash) as one including it.
452 as same result (in node hash) as one including it.
451
453
452 $ hg qpop -a -q
454 $ hg qpop -a -q
453 patch queue now empty
455 patch queue now empty
454 $ hg qdelete import-at-qnew
456 $ hg qdelete import-at-qnew
455 $ echo 'sub = sub' > .hgsub
457 $ echo 'sub = sub' > .hgsub
456 $ hg add .hgsub
458 $ hg add .hgsub
457 $ rm -f .hgsubstate
459 $ rm -f .hgsubstate
458 $ hg qnew -u test -d '0 0' import-at-qnew
460 $ hg qnew -u test -d '0 0' import-at-qnew
459 $ hg parents --template '{node}\n'
461 $ hg parents --template '{node}\n'
460 f69e96d86e75a6d4fd88285dc9697acb23951041
462 f69e96d86e75a6d4fd88285dc9697acb23951041
461 $ hg parents --template '{files}\n'
463 $ hg parents --template '{files}\n'
462 .hgsub .hgsubstate
464 .hgsub .hgsubstate
463
465
464 check whether qrefresh imports updated .hgsubstate correctly
466 check whether qrefresh imports updated .hgsubstate correctly
465
467
466 $ hg qpop
468 $ hg qpop
467 popping import-at-qnew
469 popping import-at-qnew
468 patch queue now empty
470 patch queue now empty
469 $ hg qpush
471 $ hg qpush
470 applying import-at-qnew
472 applying import-at-qnew
471 now at: import-at-qnew
473 now at: import-at-qnew
472 $ hg parents --template '{files}\n'
474 $ hg parents --template '{files}\n'
473 .hgsub .hgsubstate
475 .hgsub .hgsubstate
474
476
475 $ hg qnew import-at-qrefresh
477 $ hg qnew import-at-qrefresh
476 $ echo sb > sub/sb
478 $ echo sb > sub/sb
477 $ hg -R sub commit -u test -d '0 0' -Am '#1 in sub'
479 $ hg -R sub commit -u test -d '0 0' -Am '#1 in sub'
478 adding sb
480 adding sb
479 $ hg qrefresh -u test -d '0 0'
481 $ hg qrefresh -u test -d '0 0'
480 $ hg -R sub parents --template '{node} sub\n'
482 $ hg -R sub parents --template '{node} sub\n'
481 88ac1bef5ed43b689d1d200b59886b675dec474b sub
483 88ac1bef5ed43b689d1d200b59886b675dec474b sub
482 $ cat .hgsubstate
484 $ cat .hgsubstate
483 88ac1bef5ed43b689d1d200b59886b675dec474b sub
485 88ac1bef5ed43b689d1d200b59886b675dec474b sub
484 $ hg diff -c tip
486 $ hg diff -c tip
485 diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
487 diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
486 --- a/.hgsubstate
488 --- a/.hgsubstate
487 +++ b/.hgsubstate
489 +++ b/.hgsubstate
488 @@ -1,1 +1,1 @@
490 @@ -1,1 +1,1 @@
489 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
491 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
490 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
492 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
491 $ cat .hg/patches/import-at-qrefresh
493 $ cat .hg/patches/import-at-qrefresh
492 # HG changeset patch
494 # HG changeset patch
493 # User test
495 # User test
494 # Date 0 0
496 # Date 0 0
495 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
497 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
496
498
497 diff -r 05b056bb9c8c .hgsubstate
499 diff -r 05b056bb9c8c .hgsubstate
498 --- a/.hgsubstate
500 --- a/.hgsubstate
499 +++ b/.hgsubstate
501 +++ b/.hgsubstate
500 @@ -1,1 +1,1 @@
502 @@ -1,1 +1,1 @@
501 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
503 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
502 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
504 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
503 $ hg parents --template '{files}\n'
505 $ hg parents --template '{files}\n'
504 .hgsubstate
506 .hgsubstate
505
507
506 $ hg qrefresh -u test -d '0 0'
508 $ hg qrefresh -u test -d '0 0'
507 $ cat .hgsubstate
509 $ cat .hgsubstate
508 88ac1bef5ed43b689d1d200b59886b675dec474b sub
510 88ac1bef5ed43b689d1d200b59886b675dec474b sub
509 $ hg diff -c tip
511 $ hg diff -c tip
510 diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
512 diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
511 --- a/.hgsubstate
513 --- a/.hgsubstate
512 +++ b/.hgsubstate
514 +++ b/.hgsubstate
513 @@ -1,1 +1,1 @@
515 @@ -1,1 +1,1 @@
514 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
516 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
515 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
517 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
516 $ cat .hg/patches/import-at-qrefresh
518 $ cat .hg/patches/import-at-qrefresh
517 # HG changeset patch
519 # HG changeset patch
518 # User test
520 # User test
519 # Date 0 0
521 # Date 0 0
520 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
522 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
521
523
522 diff -r 05b056bb9c8c .hgsubstate
524 diff -r 05b056bb9c8c .hgsubstate
523 --- a/.hgsubstate
525 --- a/.hgsubstate
524 +++ b/.hgsubstate
526 +++ b/.hgsubstate
525 @@ -1,1 +1,1 @@
527 @@ -1,1 +1,1 @@
526 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
528 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
527 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
529 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
528 $ hg parents --template '{files}\n'
530 $ hg parents --template '{files}\n'
529 .hgsubstate
531 .hgsubstate
530
532
531 $ hg update -C tip
533 $ hg update -C tip
532 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
534 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
533 $ hg qpop -a
535 $ hg qpop -a
534 popping import-at-qrefresh
536 popping import-at-qrefresh
535 popping import-at-qnew
537 popping import-at-qnew
536 patch queue now empty
538 patch queue now empty
537
539
538 $ hg -R sub update -C 0
540 $ hg -R sub update -C 0
539 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
541 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
540 $ echo 'sub = sub' > .hgsub
542 $ echo 'sub = sub' > .hgsub
541 $ hg commit -Am '#1 in parent'
543 $ hg commit -Am '#1 in parent'
542 adding .hgsub
544 adding .hgsub
543 $ hg -R sub update -C 1
545 $ hg -R sub update -C 1
544 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
546 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
545 $ hg commit -Am '#2 in parent (but will be rolled back soon)'
547 $ hg commit -Am '#2 in parent (but will be rolled back soon)'
546 $ hg rollback
548 $ hg rollback
547 repository tip rolled back to revision 1 (undo commit)
549 repository tip rolled back to revision 1 (undo commit)
548 working directory now based on revision 1
550 working directory now based on revision 1
549 $ hg status
551 $ hg status
550 M .hgsubstate
552 M .hgsubstate
551 $ hg qnew -u test -d '0 0' checkstate-at-qnew
553 $ hg qnew -u test -d '0 0' checkstate-at-qnew
552 $ hg -R sub parents --template '{node} sub\n'
554 $ hg -R sub parents --template '{node} sub\n'
553 88ac1bef5ed43b689d1d200b59886b675dec474b sub
555 88ac1bef5ed43b689d1d200b59886b675dec474b sub
554 $ cat .hgsubstate
556 $ cat .hgsubstate
555 88ac1bef5ed43b689d1d200b59886b675dec474b sub
557 88ac1bef5ed43b689d1d200b59886b675dec474b sub
556 $ hg diff -c tip
558 $ hg diff -c tip
557 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
559 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
558 --- a/.hgsubstate
560 --- a/.hgsubstate
559 +++ b/.hgsubstate
561 +++ b/.hgsubstate
560 @@ -1,1 +1,1 @@
562 @@ -1,1 +1,1 @@
561 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
563 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
562 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
564 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
563 $ cat .hg/patches/checkstate-at-qnew
565 $ cat .hg/patches/checkstate-at-qnew
564 # HG changeset patch
566 # HG changeset patch
565 # User test
567 # User test
566 # Date 0 0
568 # Date 0 0
567 # Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa
569 # Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa
568
570
569 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
571 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
570 --- a/.hgsubstate
572 --- a/.hgsubstate
571 +++ b/.hgsubstate
573 +++ b/.hgsubstate
572 @@ -1,1 +1,1 @@
574 @@ -1,1 +1,1 @@
573 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
575 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
574 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
576 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
575 $ hg parents --template '{files}\n'
577 $ hg parents --template '{files}\n'
576 .hgsubstate
578 .hgsubstate
577
579
578 check whether qrefresh not including ".hgsubstate" explicitly causes
580 check whether qrefresh not including ".hgsubstate" explicitly causes
579 as same result (in node hash) as one including it.
581 as same result (in node hash) as one including it.
580
582
581 $ hg update -C -q 0
583 $ hg update -C -q 0
582 $ hg qpop -a -q
584 $ hg qpop -a -q
583 patch queue now empty
585 patch queue now empty
584 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
586 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
585 $ echo 'sub = sub' > .hgsub
587 $ echo 'sub = sub' > .hgsub
586 $ echo > .hgsubstate
588 $ echo > .hgsubstate
587 $ hg add .hgsub .hgsubstate
589 $ hg add .hgsub .hgsubstate
588 $ hg qrefresh -u test -d '0 0'
590 $ hg qrefresh -u test -d '0 0'
589 $ hg parents --template '{node}\n'
591 $ hg parents --template '{node}\n'
590 7c48c35501aae6770ed9c2517014628615821a8e
592 7c48c35501aae6770ed9c2517014628615821a8e
591 $ hg parents --template '{files}\n'
593 $ hg parents --template '{files}\n'
592 .hgsub .hgsubstate
594 .hgsub .hgsubstate
593
595
594 $ hg qpop -a -q
596 $ hg qpop -a -q
595 patch queue now empty
597 patch queue now empty
596 $ hg qdelete add-hgsub-at-qrefresh
598 $ hg qdelete add-hgsub-at-qrefresh
597 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
599 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
598 $ echo 'sub = sub' > .hgsub
600 $ echo 'sub = sub' > .hgsub
599 $ hg add .hgsub
601 $ hg add .hgsub
600 $ rm -f .hgsubstate
602 $ rm -f .hgsubstate
601 $ hg qrefresh -u test -d '0 0'
603 $ hg qrefresh -u test -d '0 0'
602 $ hg parents --template '{node}\n'
604 $ hg parents --template '{node}\n'
603 7c48c35501aae6770ed9c2517014628615821a8e
605 7c48c35501aae6770ed9c2517014628615821a8e
604 $ hg parents --template '{files}\n'
606 $ hg parents --template '{files}\n'
605 .hgsub .hgsubstate
607 .hgsub .hgsubstate
606
608
607 $ cd ..
609 $ cd ..
608
610
609 $ cd ..
611 $ cd ..
@@ -1,1606 +1,1607 b''
1 $ checkundo()
1 $ checkundo()
2 > {
2 > {
3 > if [ -f .hg/store/undo ]; then
3 > if [ -f .hg/store/undo ]; then
4 > echo ".hg/store/undo still exists after $1"
4 > echo ".hg/store/undo still exists after $1"
5 > fi
5 > fi
6 > }
6 > }
7
7
8 $ echo "[extensions]" >> $HGRCPATH
8 $ cat <<EOF >> $HGRCPATH
9 $ echo "mq=" >> $HGRCPATH
9 > [extensions]
10
10 > mq =
11 $ echo "[mq]" >> $HGRCPATH
11 > [mq]
12 $ echo "plain=true" >> $HGRCPATH
12 > plain = true
13 > EOF
13
14
14
15
15 help
16 help
16
17
17 $ hg help mq
18 $ hg help mq
18 mq extension - manage a stack of patches
19 mq extension - manage a stack of patches
19
20
20 This extension lets you work with a stack of patches in a Mercurial
21 This extension lets you work with a stack of patches in a Mercurial
21 repository. It manages two stacks of patches - all known patches, and applied
22 repository. It manages two stacks of patches - all known patches, and applied
22 patches (subset of known patches).
23 patches (subset of known patches).
23
24
24 Known patches are represented as patch files in the .hg/patches directory.
25 Known patches are represented as patch files in the .hg/patches directory.
25 Applied patches are both patch files and changesets.
26 Applied patches are both patch files and changesets.
26
27
27 Common tasks (use "hg help command" for more details):
28 Common tasks (use "hg help command" for more details):
28
29
29 create new patch qnew
30 create new patch qnew
30 import existing patch qimport
31 import existing patch qimport
31
32
32 print patch series qseries
33 print patch series qseries
33 print applied patches qapplied
34 print applied patches qapplied
34
35
35 add known patch to applied stack qpush
36 add known patch to applied stack qpush
36 remove patch from applied stack qpop
37 remove patch from applied stack qpop
37 refresh contents of top applied patch qrefresh
38 refresh contents of top applied patch qrefresh
38
39
39 By default, mq will automatically use git patches when required to avoid
40 By default, mq will automatically use git patches when required to avoid
40 losing file mode changes, copy records, binary files or empty files creations
41 losing file mode changes, copy records, binary files or empty files creations
41 or deletions. This behaviour can be configured with:
42 or deletions. This behaviour can be configured with:
42
43
43 [mq]
44 [mq]
44 git = auto/keep/yes/no
45 git = auto/keep/yes/no
45
46
46 If set to 'keep', mq will obey the [diff] section configuration while
47 If set to 'keep', mq will obey the [diff] section configuration while
47 preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
48 preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
48 will override the [diff] section and always generate git or regular patches,
49 will override the [diff] section and always generate git or regular patches,
49 possibly losing data in the second case.
50 possibly losing data in the second case.
50
51
51 It may be desirable for mq changesets to be kept in the secret phase (see "hg
52 It may be desirable for mq changesets to be kept in the secret phase (see "hg
52 help phases"), which can be enabled with the following setting:
53 help phases"), which can be enabled with the following setting:
53
54
54 [mq]
55 [mq]
55 secret = True
56 secret = True
56
57
57 You will by default be managing a patch queue named "patches". You can create
58 You will by default be managing a patch queue named "patches". You can create
58 other, independent patch queues with the "hg qqueue" command.
59 other, independent patch queues with the "hg qqueue" command.
59
60
60 If the working directory contains uncommitted files, qpush, qpop and qgoto
61 If the working directory contains uncommitted files, qpush, qpop and qgoto
61 abort immediately. If -f/--force is used, the changes are discarded. Setting:
62 abort immediately. If -f/--force is used, the changes are discarded. Setting:
62
63
63 [mq]
64 [mq]
64 keepchanges = True
65 keepchanges = True
65
66
66 make them behave as if --keep-changes were passed, and non-conflicting local
67 make them behave as if --keep-changes were passed, and non-conflicting local
67 changes will be tolerated and preserved. If incompatible options such as
68 changes will be tolerated and preserved. If incompatible options such as
68 -f/--force or --exact are passed, this setting is ignored.
69 -f/--force or --exact are passed, this setting is ignored.
69
70
70 This extension used to provide a strip command. This command now lives in the
71 This extension used to provide a strip command. This command now lives in the
71 strip extension.
72 strip extension.
72
73
73 list of commands:
74 list of commands:
74
75
75 qapplied print the patches already applied
76 qapplied print the patches already applied
76 qclone clone main and patch repository at same time
77 qclone clone main and patch repository at same time
77 qdelete remove patches from queue
78 qdelete remove patches from queue
78 qdiff diff of the current patch and subsequent modifications
79 qdiff diff of the current patch and subsequent modifications
79 qfinish move applied patches into repository history
80 qfinish move applied patches into repository history
80 qfold fold the named patches into the current patch
81 qfold fold the named patches into the current patch
81 qgoto push or pop patches until named patch is at top of stack
82 qgoto push or pop patches until named patch is at top of stack
82 qguard set or print guards for a patch
83 qguard set or print guards for a patch
83 qheader print the header of the topmost or specified patch
84 qheader print the header of the topmost or specified patch
84 qimport import a patch or existing changeset
85 qimport import a patch or existing changeset
85 qnew create a new patch
86 qnew create a new patch
86 qnext print the name of the next pushable patch
87 qnext print the name of the next pushable patch
87 qpop pop the current patch off the stack
88 qpop pop the current patch off the stack
88 qprev print the name of the preceding applied patch
89 qprev print the name of the preceding applied patch
89 qpush push the next patch onto the stack
90 qpush push the next patch onto the stack
90 qqueue manage multiple patch queues
91 qqueue manage multiple patch queues
91 qrefresh update the current patch
92 qrefresh update the current patch
92 qrename rename a patch
93 qrename rename a patch
93 qselect set or print guarded patches to push
94 qselect set or print guarded patches to push
94 qseries print the entire series file
95 qseries print the entire series file
95 qtop print the name of the current patch
96 qtop print the name of the current patch
96 qunapplied print the patches not yet applied
97 qunapplied print the patches not yet applied
97
98
98 (use "hg help -v mq" to show built-in aliases and global options)
99 (use "hg help -v mq" to show built-in aliases and global options)
99
100
100 $ hg init a
101 $ hg init a
101 $ cd a
102 $ cd a
102 $ echo a > a
103 $ echo a > a
103 $ hg ci -Ama
104 $ hg ci -Ama
104 adding a
105 adding a
105
106
106 $ hg clone . ../k
107 $ hg clone . ../k
107 updating to branch default
108 updating to branch default
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109
110
110 $ mkdir b
111 $ mkdir b
111 $ echo z > b/z
112 $ echo z > b/z
112 $ hg ci -Ama
113 $ hg ci -Ama
113 adding b/z
114 adding b/z
114
115
115
116
116 qinit
117 qinit
117
118
118 $ hg qinit
119 $ hg qinit
119
120
120 $ cd ..
121 $ cd ..
121 $ hg init b
122 $ hg init b
122
123
123
124
124 -R qinit
125 -R qinit
125
126
126 $ hg -R b qinit
127 $ hg -R b qinit
127
128
128 $ hg init c
129 $ hg init c
129
130
130
131
131 qinit -c
132 qinit -c
132
133
133 $ hg --cwd c qinit -c
134 $ hg --cwd c qinit -c
134 $ hg -R c/.hg/patches st
135 $ hg -R c/.hg/patches st
135 A .hgignore
136 A .hgignore
136 A series
137 A series
137
138
138
139
139 qinit; qinit -c
140 qinit; qinit -c
140
141
141 $ hg init d
142 $ hg init d
142 $ cd d
143 $ cd d
143 $ hg qinit
144 $ hg qinit
144 $ hg qinit -c
145 $ hg qinit -c
145
146
146 qinit -c should create both files if they don't exist
147 qinit -c should create both files if they don't exist
147
148
148 $ cat .hg/patches/.hgignore
149 $ cat .hg/patches/.hgignore
149 ^\.hg
150 ^\.hg
150 ^\.mq
151 ^\.mq
151 syntax: glob
152 syntax: glob
152 status
153 status
153 guards
154 guards
154 $ cat .hg/patches/series
155 $ cat .hg/patches/series
155 $ hg qinit -c
156 $ hg qinit -c
156 abort: repository $TESTTMP/d/.hg/patches already exists! (glob)
157 abort: repository $TESTTMP/d/.hg/patches already exists! (glob)
157 [255]
158 [255]
158 $ cd ..
159 $ cd ..
159
160
160 $ echo '% qinit; <stuff>; qinit -c'
161 $ echo '% qinit; <stuff>; qinit -c'
161 % qinit; <stuff>; qinit -c
162 % qinit; <stuff>; qinit -c
162 $ hg init e
163 $ hg init e
163 $ cd e
164 $ cd e
164 $ hg qnew A
165 $ hg qnew A
165 $ checkundo qnew
166 $ checkundo qnew
166 $ echo foo > foo
167 $ echo foo > foo
167 $ hg phase -r qbase
168 $ hg phase -r qbase
168 0: draft
169 0: draft
169 $ hg add foo
170 $ hg add foo
170 $ hg qrefresh
171 $ hg qrefresh
171 $ hg phase -r qbase
172 $ hg phase -r qbase
172 0: draft
173 0: draft
173 $ hg qnew B
174 $ hg qnew B
174 $ echo >> foo
175 $ echo >> foo
175 $ hg qrefresh
176 $ hg qrefresh
176 $ echo status >> .hg/patches/.hgignore
177 $ echo status >> .hg/patches/.hgignore
177 $ echo bleh >> .hg/patches/.hgignore
178 $ echo bleh >> .hg/patches/.hgignore
178 $ hg qinit -c
179 $ hg qinit -c
179 adding .hg/patches/A (glob)
180 adding .hg/patches/A (glob)
180 adding .hg/patches/B (glob)
181 adding .hg/patches/B (glob)
181 $ hg -R .hg/patches status
182 $ hg -R .hg/patches status
182 A .hgignore
183 A .hgignore
183 A A
184 A A
184 A B
185 A B
185 A series
186 A series
186
187
187 qinit -c shouldn't touch these files if they already exist
188 qinit -c shouldn't touch these files if they already exist
188
189
189 $ cat .hg/patches/.hgignore
190 $ cat .hg/patches/.hgignore
190 status
191 status
191 bleh
192 bleh
192 $ cat .hg/patches/series
193 $ cat .hg/patches/series
193 A
194 A
194 B
195 B
195
196
196 add an untracked file
197 add an untracked file
197
198
198 $ echo >> .hg/patches/flaf
199 $ echo >> .hg/patches/flaf
199
200
200 status --mq with color (issue2096)
201 status --mq with color (issue2096)
201
202
202 $ hg status --mq --config extensions.color= --config color.mode=ansi --color=always
203 $ hg status --mq --config extensions.color= --config color.mode=ansi --color=always
203 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1m.hgignore\x1b[0m (esc)
204 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1m.hgignore\x1b[0m (esc)
204 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mA\x1b[0m (esc)
205 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mA\x1b[0m (esc)
205 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mB\x1b[0m (esc)
206 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mB\x1b[0m (esc)
206 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mseries\x1b[0m (esc)
207 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mseries\x1b[0m (esc)
207 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mflaf\x1b[0m (esc)
208 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mflaf\x1b[0m (esc)
208
209
209 try the --mq option on a command provided by an extension
210 try the --mq option on a command provided by an extension
210
211
211 $ hg purge --mq --verbose --config extensions.purge=
212 $ hg purge --mq --verbose --config extensions.purge=
212 removing file flaf
213 removing file flaf
213
214
214 $ cd ..
215 $ cd ..
215
216
216 #if no-outer-repo
217 #if no-outer-repo
217
218
218 init --mq without repo
219 init --mq without repo
219
220
220 $ mkdir f
221 $ mkdir f
221 $ cd f
222 $ cd f
222 $ hg init --mq
223 $ hg init --mq
223 abort: there is no Mercurial repository here (.hg not found)
224 abort: there is no Mercurial repository here (.hg not found)
224 [255]
225 [255]
225 $ cd ..
226 $ cd ..
226
227
227 #endif
228 #endif
228
229
229 init --mq with repo path
230 init --mq with repo path
230
231
231 $ hg init g
232 $ hg init g
232 $ hg init --mq g
233 $ hg init --mq g
233 $ test -d g/.hg/patches/.hg
234 $ test -d g/.hg/patches/.hg
234
235
235 init --mq with nonexistent directory
236 init --mq with nonexistent directory
236
237
237 $ hg init --mq nonexistentdir
238 $ hg init --mq nonexistentdir
238 abort: repository nonexistentdir not found!
239 abort: repository nonexistentdir not found!
239 [255]
240 [255]
240
241
241
242
242 init --mq with bundle (non "local")
243 init --mq with bundle (non "local")
243
244
244 $ hg -R a bundle --all a.bundle >/dev/null
245 $ hg -R a bundle --all a.bundle >/dev/null
245 $ hg init --mq a.bundle
246 $ hg init --mq a.bundle
246 abort: only a local queue repository may be initialized
247 abort: only a local queue repository may be initialized
247 [255]
248 [255]
248
249
249 $ cd a
250 $ cd a
250
251
251 $ hg qnew -m 'foo bar' test.patch
252 $ hg qnew -m 'foo bar' test.patch
252
253
253 $ echo '# comment' > .hg/patches/series.tmp
254 $ echo '# comment' > .hg/patches/series.tmp
254 $ echo >> .hg/patches/series.tmp # empty line
255 $ echo >> .hg/patches/series.tmp # empty line
255 $ cat .hg/patches/series >> .hg/patches/series.tmp
256 $ cat .hg/patches/series >> .hg/patches/series.tmp
256 $ mv .hg/patches/series.tmp .hg/patches/series
257 $ mv .hg/patches/series.tmp .hg/patches/series
257
258
258
259
259 qrefresh
260 qrefresh
260
261
261 $ echo a >> a
262 $ echo a >> a
262 $ hg qrefresh
263 $ hg qrefresh
263 $ cat .hg/patches/test.patch
264 $ cat .hg/patches/test.patch
264 foo bar
265 foo bar
265
266
266 diff -r [a-f0-9]* a (re)
267 diff -r [a-f0-9]* a (re)
267 --- a/a\t(?P<date>.*) (re)
268 --- a/a\t(?P<date>.*) (re)
268 \+\+\+ b/a\t(?P<date2>.*) (re)
269 \+\+\+ b/a\t(?P<date2>.*) (re)
269 @@ -1,1 +1,2 @@
270 @@ -1,1 +1,2 @@
270 a
271 a
271 +a
272 +a
272
273
273 empty qrefresh
274 empty qrefresh
274
275
275 $ hg qrefresh -X a
276 $ hg qrefresh -X a
276
277
277 revision:
278 revision:
278
279
279 $ hg diff -r -2 -r -1
280 $ hg diff -r -2 -r -1
280
281
281 patch:
282 patch:
282
283
283 $ cat .hg/patches/test.patch
284 $ cat .hg/patches/test.patch
284 foo bar
285 foo bar
285
286
286
287
287 working dir diff:
288 working dir diff:
288
289
289 $ hg diff --nodates -q
290 $ hg diff --nodates -q
290 --- a/a
291 --- a/a
291 +++ b/a
292 +++ b/a
292 @@ -1,1 +1,2 @@
293 @@ -1,1 +1,2 @@
293 a
294 a
294 +a
295 +a
295
296
296 restore things
297 restore things
297
298
298 $ hg qrefresh
299 $ hg qrefresh
299 $ checkundo qrefresh
300 $ checkundo qrefresh
300
301
301
302
302 qpop
303 qpop
303
304
304 $ hg qpop
305 $ hg qpop
305 popping test.patch
306 popping test.patch
306 patch queue now empty
307 patch queue now empty
307 $ checkundo qpop
308 $ checkundo qpop
308
309
309
310
310 qpush with dump of tag cache
311 qpush with dump of tag cache
311 Dump the tag cache to ensure that it has exactly one head after qpush.
312 Dump the tag cache to ensure that it has exactly one head after qpush.
312
313
313 $ rm -f .hg/cache/tags
314 $ rm -f .hg/cache/tags
314 $ hg tags > /dev/null
315 $ hg tags > /dev/null
315
316
316 .hg/cache/tags (pre qpush):
317 .hg/cache/tags (pre qpush):
317
318
318 $ cat .hg/cache/tags
319 $ cat .hg/cache/tags
319 1 [\da-f]{40} (re)
320 1 [\da-f]{40} (re)
320
321
321 $ hg qpush
322 $ hg qpush
322 applying test.patch
323 applying test.patch
323 now at: test.patch
324 now at: test.patch
324 $ hg phase -r qbase
325 $ hg phase -r qbase
325 2: draft
326 2: draft
326 $ hg tags > /dev/null
327 $ hg tags > /dev/null
327
328
328 .hg/cache/tags (post qpush):
329 .hg/cache/tags (post qpush):
329
330
330 $ cat .hg/cache/tags
331 $ cat .hg/cache/tags
331 2 [\da-f]{40} (re)
332 2 [\da-f]{40} (re)
332
333
333 $ checkundo qpush
334 $ checkundo qpush
334 $ cd ..
335 $ cd ..
335
336
336
337
337 pop/push outside repo
338 pop/push outside repo
338 $ hg -R a qpop
339 $ hg -R a qpop
339 popping test.patch
340 popping test.patch
340 patch queue now empty
341 patch queue now empty
341 $ hg -R a qpush
342 $ hg -R a qpush
342 applying test.patch
343 applying test.patch
343 now at: test.patch
344 now at: test.patch
344
345
345 $ cd a
346 $ cd a
346 $ hg qnew test2.patch
347 $ hg qnew test2.patch
347
348
348 qrefresh in subdir
349 qrefresh in subdir
349
350
350 $ cd b
351 $ cd b
351 $ echo a > a
352 $ echo a > a
352 $ hg add a
353 $ hg add a
353 $ hg qrefresh
354 $ hg qrefresh
354
355
355 pop/push -a in subdir
356 pop/push -a in subdir
356
357
357 $ hg qpop -a
358 $ hg qpop -a
358 popping test2.patch
359 popping test2.patch
359 popping test.patch
360 popping test.patch
360 patch queue now empty
361 patch queue now empty
361 $ hg --traceback qpush -a
362 $ hg --traceback qpush -a
362 applying test.patch
363 applying test.patch
363 applying test2.patch
364 applying test2.patch
364 now at: test2.patch
365 now at: test2.patch
365
366
366
367
367 setting columns & formatted tests truncating (issue1912)
368 setting columns & formatted tests truncating (issue1912)
368
369
369 $ COLUMNS=4 hg qseries --config ui.formatted=true
370 $ COLUMNS=4 hg qseries --config ui.formatted=true
370 test.patch
371 test.patch
371 test2.patch
372 test2.patch
372 $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
373 $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
373 0 A test.patch: f...
374 0 A test.patch: f...
374 1 A test2.patch:
375 1 A test2.patch:
375 $ hg qpop
376 $ hg qpop
376 popping test2.patch
377 popping test2.patch
377 now at: test.patch
378 now at: test.patch
378 $ hg qseries -vs
379 $ hg qseries -vs
379 0 A test.patch: foo bar
380 0 A test.patch: foo bar
380 1 U test2.patch:
381 1 U test2.patch:
381 $ hg sum | grep mq
382 $ hg sum | grep mq
382 mq: 1 applied, 1 unapplied
383 mq: 1 applied, 1 unapplied
383 $ hg qpush
384 $ hg qpush
384 applying test2.patch
385 applying test2.patch
385 now at: test2.patch
386 now at: test2.patch
386 $ hg sum | grep mq
387 $ hg sum | grep mq
387 mq: 2 applied
388 mq: 2 applied
388 $ hg qapplied
389 $ hg qapplied
389 test.patch
390 test.patch
390 test2.patch
391 test2.patch
391 $ hg qtop
392 $ hg qtop
392 test2.patch
393 test2.patch
393
394
394
395
395 prev
396 prev
396
397
397 $ hg qapp -1
398 $ hg qapp -1
398 test.patch
399 test.patch
399
400
400 next
401 next
401
402
402 $ hg qunapp -1
403 $ hg qunapp -1
403 all patches applied
404 all patches applied
404 [1]
405 [1]
405
406
406 $ hg qpop
407 $ hg qpop
407 popping test2.patch
408 popping test2.patch
408 now at: test.patch
409 now at: test.patch
409
410
410 commit should fail
411 commit should fail
411
412
412 $ hg commit
413 $ hg commit
413 abort: cannot commit over an applied mq patch
414 abort: cannot commit over an applied mq patch
414 [255]
415 [255]
415
416
416 push should fail if draft
417 push should fail if draft
417
418
418 $ hg push ../../k
419 $ hg push ../../k
419 pushing to ../../k
420 pushing to ../../k
420 abort: source has mq patches applied
421 abort: source has mq patches applied
421 [255]
422 [255]
422
423
423
424
424 import should fail
425 import should fail
425
426
426 $ hg st .
427 $ hg st .
427 $ echo foo >> ../a
428 $ echo foo >> ../a
428 $ hg diff > ../../import.diff
429 $ hg diff > ../../import.diff
429 $ hg revert --no-backup ../a
430 $ hg revert --no-backup ../a
430 $ hg import ../../import.diff
431 $ hg import ../../import.diff
431 abort: cannot import over an applied patch
432 abort: cannot import over an applied patch
432 [255]
433 [255]
433 $ hg st
434 $ hg st
434
435
435 import --no-commit should succeed
436 import --no-commit should succeed
436
437
437 $ hg import --no-commit ../../import.diff
438 $ hg import --no-commit ../../import.diff
438 applying ../../import.diff
439 applying ../../import.diff
439 $ hg st
440 $ hg st
440 M a
441 M a
441 $ hg revert --no-backup ../a
442 $ hg revert --no-backup ../a
442
443
443
444
444 qunapplied
445 qunapplied
445
446
446 $ hg qunapplied
447 $ hg qunapplied
447 test2.patch
448 test2.patch
448
449
449
450
450 qpush/qpop with index
451 qpush/qpop with index
451
452
452 $ hg qnew test1b.patch
453 $ hg qnew test1b.patch
453 $ echo 1b > 1b
454 $ echo 1b > 1b
454 $ hg add 1b
455 $ hg add 1b
455 $ hg qrefresh
456 $ hg qrefresh
456 $ hg qpush 2
457 $ hg qpush 2
457 applying test2.patch
458 applying test2.patch
458 now at: test2.patch
459 now at: test2.patch
459 $ hg qpop 0
460 $ hg qpop 0
460 popping test2.patch
461 popping test2.patch
461 popping test1b.patch
462 popping test1b.patch
462 now at: test.patch
463 now at: test.patch
463 $ hg qpush test.patch+1
464 $ hg qpush test.patch+1
464 applying test1b.patch
465 applying test1b.patch
465 now at: test1b.patch
466 now at: test1b.patch
466 $ hg qpush test.patch+2
467 $ hg qpush test.patch+2
467 applying test2.patch
468 applying test2.patch
468 now at: test2.patch
469 now at: test2.patch
469 $ hg qpop test2.patch-1
470 $ hg qpop test2.patch-1
470 popping test2.patch
471 popping test2.patch
471 now at: test1b.patch
472 now at: test1b.patch
472 $ hg qpop test2.patch-2
473 $ hg qpop test2.patch-2
473 popping test1b.patch
474 popping test1b.patch
474 now at: test.patch
475 now at: test.patch
475 $ hg qpush test1b.patch+1
476 $ hg qpush test1b.patch+1
476 applying test1b.patch
477 applying test1b.patch
477 applying test2.patch
478 applying test2.patch
478 now at: test2.patch
479 now at: test2.patch
479
480
480
481
481 qpush --move
482 qpush --move
482
483
483 $ hg qpop -a
484 $ hg qpop -a
484 popping test2.patch
485 popping test2.patch
485 popping test1b.patch
486 popping test1b.patch
486 popping test.patch
487 popping test.patch
487 patch queue now empty
488 patch queue now empty
488 $ hg qguard test1b.patch -- -negguard
489 $ hg qguard test1b.patch -- -negguard
489 $ hg qguard test2.patch -- +posguard
490 $ hg qguard test2.patch -- +posguard
490 $ hg qpush --move test2.patch # can't move guarded patch
491 $ hg qpush --move test2.patch # can't move guarded patch
491 cannot push 'test2.patch' - guarded by '+posguard'
492 cannot push 'test2.patch' - guarded by '+posguard'
492 [1]
493 [1]
493 $ hg qselect posguard
494 $ hg qselect posguard
494 number of unguarded, unapplied patches has changed from 2 to 3
495 number of unguarded, unapplied patches has changed from 2 to 3
495 $ hg qpush --move test2.patch # move to front
496 $ hg qpush --move test2.patch # move to front
496 applying test2.patch
497 applying test2.patch
497 now at: test2.patch
498 now at: test2.patch
498 $ hg qpush --move test1b.patch # negative guard unselected
499 $ hg qpush --move test1b.patch # negative guard unselected
499 applying test1b.patch
500 applying test1b.patch
500 now at: test1b.patch
501 now at: test1b.patch
501 $ hg qpush --move test.patch # noop move
502 $ hg qpush --move test.patch # noop move
502 applying test.patch
503 applying test.patch
503 now at: test.patch
504 now at: test.patch
504 $ hg qseries -v
505 $ hg qseries -v
505 0 A test2.patch
506 0 A test2.patch
506 1 A test1b.patch
507 1 A test1b.patch
507 2 A test.patch
508 2 A test.patch
508 $ hg qpop -a
509 $ hg qpop -a
509 popping test.patch
510 popping test.patch
510 popping test1b.patch
511 popping test1b.patch
511 popping test2.patch
512 popping test2.patch
512 patch queue now empty
513 patch queue now empty
513
514
514 cleaning up
515 cleaning up
515
516
516 $ hg qselect --none
517 $ hg qselect --none
517 guards deactivated
518 guards deactivated
518 number of unguarded, unapplied patches has changed from 3 to 2
519 number of unguarded, unapplied patches has changed from 3 to 2
519 $ hg qguard --none test1b.patch
520 $ hg qguard --none test1b.patch
520 $ hg qguard --none test2.patch
521 $ hg qguard --none test2.patch
521 $ hg qpush --move test.patch
522 $ hg qpush --move test.patch
522 applying test.patch
523 applying test.patch
523 now at: test.patch
524 now at: test.patch
524 $ hg qpush --move test1b.patch
525 $ hg qpush --move test1b.patch
525 applying test1b.patch
526 applying test1b.patch
526 now at: test1b.patch
527 now at: test1b.patch
527 $ hg qpush --move bogus # nonexistent patch
528 $ hg qpush --move bogus # nonexistent patch
528 abort: patch bogus not in series
529 abort: patch bogus not in series
529 [255]
530 [255]
530 $ hg qpush --move # no patch
531 $ hg qpush --move # no patch
531 abort: please specify the patch to move
532 abort: please specify the patch to move
532 [255]
533 [255]
533 $ hg qpush --move test.patch # already applied
534 $ hg qpush --move test.patch # already applied
534 abort: cannot push to a previous patch: test.patch
535 abort: cannot push to a previous patch: test.patch
535 [255]
536 [255]
536 $ sed '2i\
537 $ sed '2i\
537 > # make qtip index different in series and fullseries
538 > # make qtip index different in series and fullseries
538 > ' `hg root`/.hg/patches/series > $TESTTMP/sedtmp
539 > ' `hg root`/.hg/patches/series > $TESTTMP/sedtmp
539 $ cp $TESTTMP/sedtmp `hg root`/.hg/patches/series
540 $ cp $TESTTMP/sedtmp `hg root`/.hg/patches/series
540 $ cat `hg root`/.hg/patches/series
541 $ cat `hg root`/.hg/patches/series
541 # comment
542 # comment
542 # make qtip index different in series and fullseries
543 # make qtip index different in series and fullseries
543
544
544 test.patch
545 test.patch
545 test1b.patch
546 test1b.patch
546 test2.patch
547 test2.patch
547 $ hg qpush --move test2.patch
548 $ hg qpush --move test2.patch
548 applying test2.patch
549 applying test2.patch
549 now at: test2.patch
550 now at: test2.patch
550
551
551
552
552 series after move
553 series after move
553
554
554 $ cat `hg root`/.hg/patches/series
555 $ cat `hg root`/.hg/patches/series
555 # comment
556 # comment
556 # make qtip index different in series and fullseries
557 # make qtip index different in series and fullseries
557
558
558 test.patch
559 test.patch
559 test1b.patch
560 test1b.patch
560 test2.patch
561 test2.patch
561
562
562
563
563 pop, qapplied, qunapplied
564 pop, qapplied, qunapplied
564
565
565 $ hg qseries -v
566 $ hg qseries -v
566 0 A test.patch
567 0 A test.patch
567 1 A test1b.patch
568 1 A test1b.patch
568 2 A test2.patch
569 2 A test2.patch
569
570
570 qapplied -1 test.patch
571 qapplied -1 test.patch
571
572
572 $ hg qapplied -1 test.patch
573 $ hg qapplied -1 test.patch
573 only one patch applied
574 only one patch applied
574 [1]
575 [1]
575
576
576 qapplied -1 test1b.patch
577 qapplied -1 test1b.patch
577
578
578 $ hg qapplied -1 test1b.patch
579 $ hg qapplied -1 test1b.patch
579 test.patch
580 test.patch
580
581
581 qapplied -1 test2.patch
582 qapplied -1 test2.patch
582
583
583 $ hg qapplied -1 test2.patch
584 $ hg qapplied -1 test2.patch
584 test1b.patch
585 test1b.patch
585
586
586 qapplied -1
587 qapplied -1
587
588
588 $ hg qapplied -1
589 $ hg qapplied -1
589 test1b.patch
590 test1b.patch
590
591
591 qapplied
592 qapplied
592
593
593 $ hg qapplied
594 $ hg qapplied
594 test.patch
595 test.patch
595 test1b.patch
596 test1b.patch
596 test2.patch
597 test2.patch
597
598
598 qapplied test1b.patch
599 qapplied test1b.patch
599
600
600 $ hg qapplied test1b.patch
601 $ hg qapplied test1b.patch
601 test.patch
602 test.patch
602 test1b.patch
603 test1b.patch
603
604
604 qunapplied -1
605 qunapplied -1
605
606
606 $ hg qunapplied -1
607 $ hg qunapplied -1
607 all patches applied
608 all patches applied
608 [1]
609 [1]
609
610
610 qunapplied
611 qunapplied
611
612
612 $ hg qunapplied
613 $ hg qunapplied
613
614
614 popping
615 popping
615
616
616 $ hg qpop
617 $ hg qpop
617 popping test2.patch
618 popping test2.patch
618 now at: test1b.patch
619 now at: test1b.patch
619
620
620 qunapplied -1
621 qunapplied -1
621
622
622 $ hg qunapplied -1
623 $ hg qunapplied -1
623 test2.patch
624 test2.patch
624
625
625 qunapplied
626 qunapplied
626
627
627 $ hg qunapplied
628 $ hg qunapplied
628 test2.patch
629 test2.patch
629
630
630 qunapplied test2.patch
631 qunapplied test2.patch
631
632
632 $ hg qunapplied test2.patch
633 $ hg qunapplied test2.patch
633
634
634 qunapplied -1 test2.patch
635 qunapplied -1 test2.patch
635
636
636 $ hg qunapplied -1 test2.patch
637 $ hg qunapplied -1 test2.patch
637 all patches applied
638 all patches applied
638 [1]
639 [1]
639
640
640 popping -a
641 popping -a
641
642
642 $ hg qpop -a
643 $ hg qpop -a
643 popping test1b.patch
644 popping test1b.patch
644 popping test.patch
645 popping test.patch
645 patch queue now empty
646 patch queue now empty
646
647
647 qapplied
648 qapplied
648
649
649 $ hg qapplied
650 $ hg qapplied
650
651
651 qapplied -1
652 qapplied -1
652
653
653 $ hg qapplied -1
654 $ hg qapplied -1
654 no patches applied
655 no patches applied
655 [1]
656 [1]
656 $ hg qpush
657 $ hg qpush
657 applying test.patch
658 applying test.patch
658 now at: test.patch
659 now at: test.patch
659
660
660
661
661 push should succeed
662 push should succeed
662
663
663 $ hg qpop -a
664 $ hg qpop -a
664 popping test.patch
665 popping test.patch
665 patch queue now empty
666 patch queue now empty
666 $ hg push ../../k
667 $ hg push ../../k
667 pushing to ../../k
668 pushing to ../../k
668 searching for changes
669 searching for changes
669 adding changesets
670 adding changesets
670 adding manifests
671 adding manifests
671 adding file changes
672 adding file changes
672 added 1 changesets with 1 changes to 1 files
673 added 1 changesets with 1 changes to 1 files
673
674
674
675
675 we want to start with some patches applied
676 we want to start with some patches applied
676
677
677 $ hg qpush -a
678 $ hg qpush -a
678 applying test.patch
679 applying test.patch
679 applying test1b.patch
680 applying test1b.patch
680 applying test2.patch
681 applying test2.patch
681 now at: test2.patch
682 now at: test2.patch
682
683
683 % pops all patches and succeeds
684 % pops all patches and succeeds
684
685
685 $ hg qpop -a
686 $ hg qpop -a
686 popping test2.patch
687 popping test2.patch
687 popping test1b.patch
688 popping test1b.patch
688 popping test.patch
689 popping test.patch
689 patch queue now empty
690 patch queue now empty
690
691
691 % does nothing and succeeds
692 % does nothing and succeeds
692
693
693 $ hg qpop -a
694 $ hg qpop -a
694 no patches applied
695 no patches applied
695
696
696 % fails - nothing else to pop
697 % fails - nothing else to pop
697
698
698 $ hg qpop
699 $ hg qpop
699 no patches applied
700 no patches applied
700 [1]
701 [1]
701
702
702 % pushes a patch and succeeds
703 % pushes a patch and succeeds
703
704
704 $ hg qpush
705 $ hg qpush
705 applying test.patch
706 applying test.patch
706 now at: test.patch
707 now at: test.patch
707
708
708 % pops a patch and succeeds
709 % pops a patch and succeeds
709
710
710 $ hg qpop
711 $ hg qpop
711 popping test.patch
712 popping test.patch
712 patch queue now empty
713 patch queue now empty
713
714
714 % pushes up to test1b.patch and succeeds
715 % pushes up to test1b.patch and succeeds
715
716
716 $ hg qpush test1b.patch
717 $ hg qpush test1b.patch
717 applying test.patch
718 applying test.patch
718 applying test1b.patch
719 applying test1b.patch
719 now at: test1b.patch
720 now at: test1b.patch
720
721
721 % does nothing and succeeds
722 % does nothing and succeeds
722
723
723 $ hg qpush test1b.patch
724 $ hg qpush test1b.patch
724 qpush: test1b.patch is already at the top
725 qpush: test1b.patch is already at the top
725
726
726 % does nothing and succeeds
727 % does nothing and succeeds
727
728
728 $ hg qpop test1b.patch
729 $ hg qpop test1b.patch
729 qpop: test1b.patch is already at the top
730 qpop: test1b.patch is already at the top
730
731
731 % fails - can't push to this patch
732 % fails - can't push to this patch
732
733
733 $ hg qpush test.patch
734 $ hg qpush test.patch
734 abort: cannot push to a previous patch: test.patch
735 abort: cannot push to a previous patch: test.patch
735 [255]
736 [255]
736
737
737 % fails - can't pop to this patch
738 % fails - can't pop to this patch
738
739
739 $ hg qpop test2.patch
740 $ hg qpop test2.patch
740 abort: patch test2.patch is not applied
741 abort: patch test2.patch is not applied
741 [255]
742 [255]
742
743
743 % pops up to test.patch and succeeds
744 % pops up to test.patch and succeeds
744
745
745 $ hg qpop test.patch
746 $ hg qpop test.patch
746 popping test1b.patch
747 popping test1b.patch
747 now at: test.patch
748 now at: test.patch
748
749
749 % pushes all patches and succeeds
750 % pushes all patches and succeeds
750
751
751 $ hg qpush -a
752 $ hg qpush -a
752 applying test1b.patch
753 applying test1b.patch
753 applying test2.patch
754 applying test2.patch
754 now at: test2.patch
755 now at: test2.patch
755
756
756 % does nothing and succeeds
757 % does nothing and succeeds
757
758
758 $ hg qpush -a
759 $ hg qpush -a
759 all patches are currently applied
760 all patches are currently applied
760
761
761 % fails - nothing else to push
762 % fails - nothing else to push
762
763
763 $ hg qpush
764 $ hg qpush
764 patch series already fully applied
765 patch series already fully applied
765 [1]
766 [1]
766
767
767 % does nothing and succeeds
768 % does nothing and succeeds
768
769
769 $ hg qpush test2.patch
770 $ hg qpush test2.patch
770 qpush: test2.patch is already at the top
771 qpush: test2.patch is already at the top
771
772
772 strip
773 strip
773
774
774 $ cd ../../b
775 $ cd ../../b
775 $ echo x>x
776 $ echo x>x
776 $ hg ci -Ama
777 $ hg ci -Ama
777 adding x
778 adding x
778 $ hg strip tip
779 $ hg strip tip
779 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
780 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
780 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
781 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
781 $ hg unbundle .hg/strip-backup/*
782 $ hg unbundle .hg/strip-backup/*
782 adding changesets
783 adding changesets
783 adding manifests
784 adding manifests
784 adding file changes
785 adding file changes
785 added 1 changesets with 1 changes to 1 files
786 added 1 changesets with 1 changes to 1 files
786 (run 'hg update' to get a working copy)
787 (run 'hg update' to get a working copy)
787
788
788
789
789 strip with local changes, should complain
790 strip with local changes, should complain
790
791
791 $ hg up
792 $ hg up
792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 $ echo y>y
794 $ echo y>y
794 $ hg add y
795 $ hg add y
795 $ hg strip tip
796 $ hg strip tip
796 abort: local changes found
797 abort: local changes found
797 [255]
798 [255]
798
799
799 --force strip with local changes
800 --force strip with local changes
800
801
801 $ hg strip -f tip
802 $ hg strip -f tip
802 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
803 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
803 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
804 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
804 $ cd ..
805 $ cd ..
805
806
806
807
807 cd b; hg qrefresh
808 cd b; hg qrefresh
808
809
809 $ hg init refresh
810 $ hg init refresh
810 $ cd refresh
811 $ cd refresh
811 $ echo a > a
812 $ echo a > a
812 $ hg ci -Ama
813 $ hg ci -Ama
813 adding a
814 adding a
814 $ hg qnew -mfoo foo
815 $ hg qnew -mfoo foo
815 $ echo a >> a
816 $ echo a >> a
816 $ hg qrefresh
817 $ hg qrefresh
817 $ mkdir b
818 $ mkdir b
818 $ cd b
819 $ cd b
819 $ echo f > f
820 $ echo f > f
820 $ hg add f
821 $ hg add f
821 $ hg qrefresh
822 $ hg qrefresh
822 $ cat ../.hg/patches/foo
823 $ cat ../.hg/patches/foo
823 foo
824 foo
824
825
825 diff -r cb9a9f314b8b a
826 diff -r cb9a9f314b8b a
826 --- a/a\t(?P<date>.*) (re)
827 --- a/a\t(?P<date>.*) (re)
827 \+\+\+ b/a\t(?P<date>.*) (re)
828 \+\+\+ b/a\t(?P<date>.*) (re)
828 @@ -1,1 +1,2 @@
829 @@ -1,1 +1,2 @@
829 a
830 a
830 +a
831 +a
831 diff -r cb9a9f314b8b b/f
832 diff -r cb9a9f314b8b b/f
832 --- /dev/null\t(?P<date>.*) (re)
833 --- /dev/null\t(?P<date>.*) (re)
833 \+\+\+ b/b/f\t(?P<date>.*) (re)
834 \+\+\+ b/b/f\t(?P<date>.*) (re)
834 @@ -0,0 +1,1 @@
835 @@ -0,0 +1,1 @@
835 +f
836 +f
836
837
837 hg qrefresh .
838 hg qrefresh .
838
839
839 $ hg qrefresh .
840 $ hg qrefresh .
840 $ cat ../.hg/patches/foo
841 $ cat ../.hg/patches/foo
841 foo
842 foo
842
843
843 diff -r cb9a9f314b8b b/f
844 diff -r cb9a9f314b8b b/f
844 --- /dev/null\t(?P<date>.*) (re)
845 --- /dev/null\t(?P<date>.*) (re)
845 \+\+\+ b/b/f\t(?P<date>.*) (re)
846 \+\+\+ b/b/f\t(?P<date>.*) (re)
846 @@ -0,0 +1,1 @@
847 @@ -0,0 +1,1 @@
847 +f
848 +f
848 $ hg status
849 $ hg status
849 M a
850 M a
850
851
851
852
852 qpush failure
853 qpush failure
853
854
854 $ cd ..
855 $ cd ..
855 $ hg qrefresh
856 $ hg qrefresh
856 $ hg qnew -mbar bar
857 $ hg qnew -mbar bar
857 $ echo foo > foo
858 $ echo foo > foo
858 $ echo bar > bar
859 $ echo bar > bar
859 $ hg add foo bar
860 $ hg add foo bar
860 $ hg qrefresh
861 $ hg qrefresh
861 $ hg qpop -a
862 $ hg qpop -a
862 popping bar
863 popping bar
863 popping foo
864 popping foo
864 patch queue now empty
865 patch queue now empty
865 $ echo bar > foo
866 $ echo bar > foo
866 $ hg qpush -a
867 $ hg qpush -a
867 applying foo
868 applying foo
868 applying bar
869 applying bar
869 file foo already exists
870 file foo already exists
870 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
871 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
871 patch failed, unable to continue (try -v)
872 patch failed, unable to continue (try -v)
872 patch failed, rejects left in working dir
873 patch failed, rejects left in working dir
873 errors during apply, please fix and refresh bar
874 errors during apply, please fix and refresh bar
874 [2]
875 [2]
875 $ hg st
876 $ hg st
876 ? foo
877 ? foo
877 ? foo.rej
878 ? foo.rej
878
879
879
880
880 mq tags
881 mq tags
881
882
882 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
883 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
883 0 qparent
884 0 qparent
884 1 foo qbase
885 1 foo qbase
885 2 bar qtip tip
886 2 bar qtip tip
886
887
887 mq revset
888 mq revset
888
889
889 $ hg log -r 'mq()' --template '{rev}\n'
890 $ hg log -r 'mq()' --template '{rev}\n'
890 1
891 1
891 2
892 2
892 $ hg help revsets | grep -i mq
893 $ hg help revsets | grep -i mq
893 "mq()"
894 "mq()"
894 Changesets managed by MQ.
895 Changesets managed by MQ.
895
896
896 bad node in status
897 bad node in status
897
898
898 $ hg qpop
899 $ hg qpop
899 popping bar
900 popping bar
900 now at: foo
901 now at: foo
901 $ hg strip -qn tip
902 $ hg strip -qn tip
902 $ hg tip
903 $ hg tip
903 changeset: 0:cb9a9f314b8b
904 changeset: 0:cb9a9f314b8b
904 tag: tip
905 tag: tip
905 user: test
906 user: test
906 date: Thu Jan 01 00:00:00 1970 +0000
907 date: Thu Jan 01 00:00:00 1970 +0000
907 summary: a
908 summary: a
908
909
909 $ hg branches
910 $ hg branches
910 default 0:cb9a9f314b8b
911 default 0:cb9a9f314b8b
911 $ hg qpop
912 $ hg qpop
912 no patches applied
913 no patches applied
913 [1]
914 [1]
914
915
915 $ cd ..
916 $ cd ..
916
917
917
918
918 git patches
919 git patches
919
920
920 $ cat >>$HGRCPATH <<EOF
921 $ cat >>$HGRCPATH <<EOF
921 > [diff]
922 > [diff]
922 > git = True
923 > git = True
923 > EOF
924 > EOF
924 $ hg init git
925 $ hg init git
925 $ cd git
926 $ cd git
926 $ hg qinit
927 $ hg qinit
927
928
928 $ hg qnew -m'new file' new
929 $ hg qnew -m'new file' new
929 $ echo foo > new
930 $ echo foo > new
930 #if execbit
931 #if execbit
931 $ chmod +x new
932 $ chmod +x new
932 #endif
933 #endif
933 $ hg add new
934 $ hg add new
934 $ hg qrefresh
935 $ hg qrefresh
935 #if execbit
936 #if execbit
936 $ cat .hg/patches/new
937 $ cat .hg/patches/new
937 new file
938 new file
938
939
939 diff --git a/new b/new
940 diff --git a/new b/new
940 new file mode 100755
941 new file mode 100755
941 --- /dev/null
942 --- /dev/null
942 +++ b/new
943 +++ b/new
943 @@ -0,0 +1,1 @@
944 @@ -0,0 +1,1 @@
944 +foo
945 +foo
945 #else
946 #else
946 $ cat .hg/patches/new
947 $ cat .hg/patches/new
947 new file
948 new file
948
949
949 diff --git a/new b/new
950 diff --git a/new b/new
950 new file mode 100644
951 new file mode 100644
951 --- /dev/null
952 --- /dev/null
952 +++ b/new
953 +++ b/new
953 @@ -0,0 +1,1 @@
954 @@ -0,0 +1,1 @@
954 +foo
955 +foo
955 #endif
956 #endif
956
957
957 $ hg qnew -m'copy file' copy
958 $ hg qnew -m'copy file' copy
958 $ hg cp new copy
959 $ hg cp new copy
959 $ hg qrefresh
960 $ hg qrefresh
960 $ cat .hg/patches/copy
961 $ cat .hg/patches/copy
961 copy file
962 copy file
962
963
963 diff --git a/new b/copy
964 diff --git a/new b/copy
964 copy from new
965 copy from new
965 copy to copy
966 copy to copy
966
967
967 $ hg qpop
968 $ hg qpop
968 popping copy
969 popping copy
969 now at: new
970 now at: new
970 $ hg qpush
971 $ hg qpush
971 applying copy
972 applying copy
972 now at: copy
973 now at: copy
973 $ hg qdiff
974 $ hg qdiff
974 diff --git a/new b/copy
975 diff --git a/new b/copy
975 copy from new
976 copy from new
976 copy to copy
977 copy to copy
977 $ cat >>$HGRCPATH <<EOF
978 $ cat >>$HGRCPATH <<EOF
978 > [diff]
979 > [diff]
979 > git = False
980 > git = False
980 > EOF
981 > EOF
981 $ hg qdiff --git
982 $ hg qdiff --git
982 diff --git a/new b/copy
983 diff --git a/new b/copy
983 copy from new
984 copy from new
984 copy to copy
985 copy to copy
985 $ cd ..
986 $ cd ..
986
987
987 empty lines in status
988 empty lines in status
988
989
989 $ hg init emptystatus
990 $ hg init emptystatus
990 $ cd emptystatus
991 $ cd emptystatus
991 $ hg qinit
992 $ hg qinit
992 $ printf '\n\n' > .hg/patches/status
993 $ printf '\n\n' > .hg/patches/status
993 $ hg qser
994 $ hg qser
994 $ cd ..
995 $ cd ..
995
996
996 bad line in status (without ":")
997 bad line in status (without ":")
997
998
998 $ hg init badstatus
999 $ hg init badstatus
999 $ cd badstatus
1000 $ cd badstatus
1000 $ hg qinit
1001 $ hg qinit
1001 $ printf 'babar has no colon in this line\n' > .hg/patches/status
1002 $ printf 'babar has no colon in this line\n' > .hg/patches/status
1002 $ hg qser
1003 $ hg qser
1003 malformated mq status line: ['babar has no colon in this line']
1004 malformated mq status line: ['babar has no colon in this line']
1004 $ cd ..
1005 $ cd ..
1005
1006
1006
1007
1007 test file addition in slow path
1008 test file addition in slow path
1008
1009
1009 $ hg init slow
1010 $ hg init slow
1010 $ cd slow
1011 $ cd slow
1011 $ hg qinit
1012 $ hg qinit
1012 $ echo foo > foo
1013 $ echo foo > foo
1013 $ hg add foo
1014 $ hg add foo
1014 $ hg ci -m 'add foo'
1015 $ hg ci -m 'add foo'
1015 $ hg qnew bar
1016 $ hg qnew bar
1016 $ echo bar > bar
1017 $ echo bar > bar
1017 $ hg add bar
1018 $ hg add bar
1018 $ hg mv foo baz
1019 $ hg mv foo baz
1019 $ hg qrefresh --git
1020 $ hg qrefresh --git
1020 $ hg up -C 0
1021 $ hg up -C 0
1021 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1022 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1022 $ echo >> foo
1023 $ echo >> foo
1023 $ hg ci -m 'change foo'
1024 $ hg ci -m 'change foo'
1024 created new head
1025 created new head
1025 $ hg up -C 1
1026 $ hg up -C 1
1026 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1027 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1027 $ hg qrefresh --git
1028 $ hg qrefresh --git
1028 $ cat .hg/patches/bar
1029 $ cat .hg/patches/bar
1029 diff --git a/bar b/bar
1030 diff --git a/bar b/bar
1030 new file mode 100644
1031 new file mode 100644
1031 --- /dev/null
1032 --- /dev/null
1032 +++ b/bar
1033 +++ b/bar
1033 @@ -0,0 +1,1 @@
1034 @@ -0,0 +1,1 @@
1034 +bar
1035 +bar
1035 diff --git a/foo b/baz
1036 diff --git a/foo b/baz
1036 rename from foo
1037 rename from foo
1037 rename to baz
1038 rename to baz
1038 $ hg log -v --template '{rev} {file_copies}\n' -r .
1039 $ hg log -v --template '{rev} {file_copies}\n' -r .
1039 2 baz (foo)
1040 2 baz (foo)
1040 $ hg qrefresh --git
1041 $ hg qrefresh --git
1041 $ cat .hg/patches/bar
1042 $ cat .hg/patches/bar
1042 diff --git a/bar b/bar
1043 diff --git a/bar b/bar
1043 new file mode 100644
1044 new file mode 100644
1044 --- /dev/null
1045 --- /dev/null
1045 +++ b/bar
1046 +++ b/bar
1046 @@ -0,0 +1,1 @@
1047 @@ -0,0 +1,1 @@
1047 +bar
1048 +bar
1048 diff --git a/foo b/baz
1049 diff --git a/foo b/baz
1049 rename from foo
1050 rename from foo
1050 rename to baz
1051 rename to baz
1051 $ hg log -v --template '{rev} {file_copies}\n' -r .
1052 $ hg log -v --template '{rev} {file_copies}\n' -r .
1052 2 baz (foo)
1053 2 baz (foo)
1053 $ hg qrefresh
1054 $ hg qrefresh
1054 $ grep 'diff --git' .hg/patches/bar
1055 $ grep 'diff --git' .hg/patches/bar
1055 diff --git a/bar b/bar
1056 diff --git a/bar b/bar
1056 diff --git a/foo b/baz
1057 diff --git a/foo b/baz
1057
1058
1058
1059
1059 test file move chains in the slow path
1060 test file move chains in the slow path
1060
1061
1061 $ hg up -C 1
1062 $ hg up -C 1
1062 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1063 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1063 $ echo >> foo
1064 $ echo >> foo
1064 $ hg ci -m 'change foo again'
1065 $ hg ci -m 'change foo again'
1065 $ hg up -C 2
1066 $ hg up -C 2
1066 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1067 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1067 $ hg mv bar quux
1068 $ hg mv bar quux
1068 $ hg mv baz bleh
1069 $ hg mv baz bleh
1069 $ hg qrefresh --git
1070 $ hg qrefresh --git
1070 $ cat .hg/patches/bar
1071 $ cat .hg/patches/bar
1071 diff --git a/foo b/bleh
1072 diff --git a/foo b/bleh
1072 rename from foo
1073 rename from foo
1073 rename to bleh
1074 rename to bleh
1074 diff --git a/quux b/quux
1075 diff --git a/quux b/quux
1075 new file mode 100644
1076 new file mode 100644
1076 --- /dev/null
1077 --- /dev/null
1077 +++ b/quux
1078 +++ b/quux
1078 @@ -0,0 +1,1 @@
1079 @@ -0,0 +1,1 @@
1079 +bar
1080 +bar
1080 $ hg log -v --template '{rev} {file_copies}\n' -r .
1081 $ hg log -v --template '{rev} {file_copies}\n' -r .
1081 3 bleh (foo)
1082 3 bleh (foo)
1082 $ hg mv quux fred
1083 $ hg mv quux fred
1083 $ hg mv bleh barney
1084 $ hg mv bleh barney
1084 $ hg qrefresh --git
1085 $ hg qrefresh --git
1085 $ cat .hg/patches/bar
1086 $ cat .hg/patches/bar
1086 diff --git a/foo b/barney
1087 diff --git a/foo b/barney
1087 rename from foo
1088 rename from foo
1088 rename to barney
1089 rename to barney
1089 diff --git a/fred b/fred
1090 diff --git a/fred b/fred
1090 new file mode 100644
1091 new file mode 100644
1091 --- /dev/null
1092 --- /dev/null
1092 +++ b/fred
1093 +++ b/fred
1093 @@ -0,0 +1,1 @@
1094 @@ -0,0 +1,1 @@
1094 +bar
1095 +bar
1095 $ hg log -v --template '{rev} {file_copies}\n' -r .
1096 $ hg log -v --template '{rev} {file_copies}\n' -r .
1096 3 barney (foo)
1097 3 barney (foo)
1097
1098
1098
1099
1099 refresh omitting an added file
1100 refresh omitting an added file
1100
1101
1101 $ hg qnew baz
1102 $ hg qnew baz
1102 $ echo newfile > newfile
1103 $ echo newfile > newfile
1103 $ hg add newfile
1104 $ hg add newfile
1104 $ hg qrefresh
1105 $ hg qrefresh
1105 $ hg st -A newfile
1106 $ hg st -A newfile
1106 C newfile
1107 C newfile
1107 $ hg qrefresh -X newfile
1108 $ hg qrefresh -X newfile
1108 $ hg st -A newfile
1109 $ hg st -A newfile
1109 A newfile
1110 A newfile
1110 $ hg revert newfile
1111 $ hg revert newfile
1111 $ rm newfile
1112 $ rm newfile
1112 $ hg qpop
1113 $ hg qpop
1113 popping baz
1114 popping baz
1114 now at: bar
1115 now at: bar
1115
1116
1116 test qdel/qrm
1117 test qdel/qrm
1117
1118
1118 $ hg qdel baz
1119 $ hg qdel baz
1119 $ echo p >> .hg/patches/series
1120 $ echo p >> .hg/patches/series
1120 $ hg qrm p
1121 $ hg qrm p
1121 $ hg qser
1122 $ hg qser
1122 bar
1123 bar
1123
1124
1124 create a git patch
1125 create a git patch
1125
1126
1126 $ echo a > alexander
1127 $ echo a > alexander
1127 $ hg add alexander
1128 $ hg add alexander
1128 $ hg qnew -f --git addalexander
1129 $ hg qnew -f --git addalexander
1129 $ grep diff .hg/patches/addalexander
1130 $ grep diff .hg/patches/addalexander
1130 diff --git a/alexander b/alexander
1131 diff --git a/alexander b/alexander
1131
1132
1132
1133
1133 create a git binary patch
1134 create a git binary patch
1134
1135
1135 $ cat > writebin.py <<EOF
1136 $ cat > writebin.py <<EOF
1136 > import sys
1137 > import sys
1137 > path = sys.argv[1]
1138 > path = sys.argv[1]
1138 > open(path, 'wb').write('BIN\x00ARY')
1139 > open(path, 'wb').write('BIN\x00ARY')
1139 > EOF
1140 > EOF
1140 $ python writebin.py bucephalus
1141 $ python writebin.py bucephalus
1141
1142
1142 $ python "$TESTDIR/md5sum.py" bucephalus
1143 $ python "$TESTDIR/md5sum.py" bucephalus
1143 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1144 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1144 $ hg add bucephalus
1145 $ hg add bucephalus
1145 $ hg qnew -f --git addbucephalus
1146 $ hg qnew -f --git addbucephalus
1146 $ grep diff .hg/patches/addbucephalus
1147 $ grep diff .hg/patches/addbucephalus
1147 diff --git a/bucephalus b/bucephalus
1148 diff --git a/bucephalus b/bucephalus
1148
1149
1149
1150
1150 check binary patches can be popped and pushed
1151 check binary patches can be popped and pushed
1151
1152
1152 $ hg qpop
1153 $ hg qpop
1153 popping addbucephalus
1154 popping addbucephalus
1154 now at: addalexander
1155 now at: addalexander
1155 $ test -f bucephalus && echo % bucephalus should not be there
1156 $ test -f bucephalus && echo % bucephalus should not be there
1156 [1]
1157 [1]
1157 $ hg qpush
1158 $ hg qpush
1158 applying addbucephalus
1159 applying addbucephalus
1159 now at: addbucephalus
1160 now at: addbucephalus
1160 $ test -f bucephalus
1161 $ test -f bucephalus
1161 $ python "$TESTDIR/md5sum.py" bucephalus
1162 $ python "$TESTDIR/md5sum.py" bucephalus
1162 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1163 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1163
1164
1164
1165
1165
1166
1166 strip again
1167 strip again
1167
1168
1168 $ cd ..
1169 $ cd ..
1169 $ hg init strip
1170 $ hg init strip
1170 $ cd strip
1171 $ cd strip
1171 $ touch foo
1172 $ touch foo
1172 $ hg add foo
1173 $ hg add foo
1173 $ hg ci -m 'add foo'
1174 $ hg ci -m 'add foo'
1174 $ echo >> foo
1175 $ echo >> foo
1175 $ hg ci -m 'change foo 1'
1176 $ hg ci -m 'change foo 1'
1176 $ hg up -C 0
1177 $ hg up -C 0
1177 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1178 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1178 $ echo 1 >> foo
1179 $ echo 1 >> foo
1179 $ hg ci -m 'change foo 2'
1180 $ hg ci -m 'change foo 2'
1180 created new head
1181 created new head
1181 $ HGMERGE=true hg merge
1182 $ HGMERGE=true hg merge
1182 merging foo
1183 merging foo
1183 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1184 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1184 (branch merge, don't forget to commit)
1185 (branch merge, don't forget to commit)
1185 $ hg ci -m merge
1186 $ hg ci -m merge
1186 $ hg log
1187 $ hg log
1187 changeset: 3:99615015637b
1188 changeset: 3:99615015637b
1188 tag: tip
1189 tag: tip
1189 parent: 2:20cbbe65cff7
1190 parent: 2:20cbbe65cff7
1190 parent: 1:d2871fc282d4
1191 parent: 1:d2871fc282d4
1191 user: test
1192 user: test
1192 date: Thu Jan 01 00:00:00 1970 +0000
1193 date: Thu Jan 01 00:00:00 1970 +0000
1193 summary: merge
1194 summary: merge
1194
1195
1195 changeset: 2:20cbbe65cff7
1196 changeset: 2:20cbbe65cff7
1196 parent: 0:53245c60e682
1197 parent: 0:53245c60e682
1197 user: test
1198 user: test
1198 date: Thu Jan 01 00:00:00 1970 +0000
1199 date: Thu Jan 01 00:00:00 1970 +0000
1199 summary: change foo 2
1200 summary: change foo 2
1200
1201
1201 changeset: 1:d2871fc282d4
1202 changeset: 1:d2871fc282d4
1202 user: test
1203 user: test
1203 date: Thu Jan 01 00:00:00 1970 +0000
1204 date: Thu Jan 01 00:00:00 1970 +0000
1204 summary: change foo 1
1205 summary: change foo 1
1205
1206
1206 changeset: 0:53245c60e682
1207 changeset: 0:53245c60e682
1207 user: test
1208 user: test
1208 date: Thu Jan 01 00:00:00 1970 +0000
1209 date: Thu Jan 01 00:00:00 1970 +0000
1209 summary: add foo
1210 summary: add foo
1210
1211
1211 $ hg strip 1
1212 $ hg strip 1
1212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1213 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1213 saved backup bundle to $TESTTMP/strip/.hg/strip-backup/*-backup.hg (glob)
1214 saved backup bundle to $TESTTMP/strip/.hg/strip-backup/*-backup.hg (glob)
1214 $ checkundo strip
1215 $ checkundo strip
1215 $ hg log
1216 $ hg log
1216 changeset: 1:20cbbe65cff7
1217 changeset: 1:20cbbe65cff7
1217 tag: tip
1218 tag: tip
1218 user: test
1219 user: test
1219 date: Thu Jan 01 00:00:00 1970 +0000
1220 date: Thu Jan 01 00:00:00 1970 +0000
1220 summary: change foo 2
1221 summary: change foo 2
1221
1222
1222 changeset: 0:53245c60e682
1223 changeset: 0:53245c60e682
1223 user: test
1224 user: test
1224 date: Thu Jan 01 00:00:00 1970 +0000
1225 date: Thu Jan 01 00:00:00 1970 +0000
1225 summary: add foo
1226 summary: add foo
1226
1227
1227 $ cd ..
1228 $ cd ..
1228
1229
1229
1230
1230 qclone
1231 qclone
1231
1232
1232 $ qlog()
1233 $ qlog()
1233 > {
1234 > {
1234 > echo 'main repo:'
1235 > echo 'main repo:'
1235 > hg log --template ' rev {rev}: {desc}\n'
1236 > hg log --template ' rev {rev}: {desc}\n'
1236 > echo 'patch repo:'
1237 > echo 'patch repo:'
1237 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1238 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1238 > }
1239 > }
1239 $ hg init qclonesource
1240 $ hg init qclonesource
1240 $ cd qclonesource
1241 $ cd qclonesource
1241 $ echo foo > foo
1242 $ echo foo > foo
1242 $ hg add foo
1243 $ hg add foo
1243 $ hg ci -m 'add foo'
1244 $ hg ci -m 'add foo'
1244 $ hg qinit
1245 $ hg qinit
1245 $ hg qnew patch1
1246 $ hg qnew patch1
1246 $ echo bar >> foo
1247 $ echo bar >> foo
1247 $ hg qrefresh -m 'change foo'
1248 $ hg qrefresh -m 'change foo'
1248 $ cd ..
1249 $ cd ..
1249
1250
1250
1251
1251 repo with unversioned patch dir
1252 repo with unversioned patch dir
1252
1253
1253 $ hg qclone qclonesource failure
1254 $ hg qclone qclonesource failure
1254 abort: versioned patch repository not found (see init --mq)
1255 abort: versioned patch repository not found (see init --mq)
1255 [255]
1256 [255]
1256
1257
1257 $ cd qclonesource
1258 $ cd qclonesource
1258 $ hg qinit -c
1259 $ hg qinit -c
1259 adding .hg/patches/patch1 (glob)
1260 adding .hg/patches/patch1 (glob)
1260 $ hg qci -m checkpoint
1261 $ hg qci -m checkpoint
1261 $ qlog
1262 $ qlog
1262 main repo:
1263 main repo:
1263 rev 1: change foo
1264 rev 1: change foo
1264 rev 0: add foo
1265 rev 0: add foo
1265 patch repo:
1266 patch repo:
1266 rev 0: checkpoint
1267 rev 0: checkpoint
1267 $ cd ..
1268 $ cd ..
1268
1269
1269
1270
1270 repo with patches applied
1271 repo with patches applied
1271
1272
1272 $ hg qclone qclonesource qclonedest
1273 $ hg qclone qclonesource qclonedest
1273 updating to branch default
1274 updating to branch default
1274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1275 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1276 $ cd qclonedest
1277 $ cd qclonedest
1277 $ qlog
1278 $ qlog
1278 main repo:
1279 main repo:
1279 rev 0: add foo
1280 rev 0: add foo
1280 patch repo:
1281 patch repo:
1281 rev 0: checkpoint
1282 rev 0: checkpoint
1282 $ cd ..
1283 $ cd ..
1283
1284
1284
1285
1285 repo with patches unapplied
1286 repo with patches unapplied
1286
1287
1287 $ cd qclonesource
1288 $ cd qclonesource
1288 $ hg qpop -a
1289 $ hg qpop -a
1289 popping patch1
1290 popping patch1
1290 patch queue now empty
1291 patch queue now empty
1291 $ qlog
1292 $ qlog
1292 main repo:
1293 main repo:
1293 rev 0: add foo
1294 rev 0: add foo
1294 patch repo:
1295 patch repo:
1295 rev 0: checkpoint
1296 rev 0: checkpoint
1296 $ cd ..
1297 $ cd ..
1297 $ hg qclone qclonesource qclonedest2
1298 $ hg qclone qclonesource qclonedest2
1298 updating to branch default
1299 updating to branch default
1299 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1300 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1300 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1301 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1301 $ cd qclonedest2
1302 $ cd qclonedest2
1302 $ qlog
1303 $ qlog
1303 main repo:
1304 main repo:
1304 rev 0: add foo
1305 rev 0: add foo
1305 patch repo:
1306 patch repo:
1306 rev 0: checkpoint
1307 rev 0: checkpoint
1307 $ cd ..
1308 $ cd ..
1308
1309
1309
1310
1310 Issue1033: test applying on an empty file
1311 Issue1033: test applying on an empty file
1311
1312
1312 $ hg init empty
1313 $ hg init empty
1313 $ cd empty
1314 $ cd empty
1314 $ touch a
1315 $ touch a
1315 $ hg ci -Am addempty
1316 $ hg ci -Am addempty
1316 adding a
1317 adding a
1317 $ echo a > a
1318 $ echo a > a
1318 $ hg qnew -f -e changea
1319 $ hg qnew -f -e changea
1319 $ hg qpop
1320 $ hg qpop
1320 popping changea
1321 popping changea
1321 patch queue now empty
1322 patch queue now empty
1322 $ hg qpush
1323 $ hg qpush
1323 applying changea
1324 applying changea
1324 now at: changea
1325 now at: changea
1325 $ cd ..
1326 $ cd ..
1326
1327
1327 test qpush with --force, issue1087
1328 test qpush with --force, issue1087
1328
1329
1329 $ hg init forcepush
1330 $ hg init forcepush
1330 $ cd forcepush
1331 $ cd forcepush
1331 $ echo hello > hello.txt
1332 $ echo hello > hello.txt
1332 $ echo bye > bye.txt
1333 $ echo bye > bye.txt
1333 $ hg ci -Ama
1334 $ hg ci -Ama
1334 adding bye.txt
1335 adding bye.txt
1335 adding hello.txt
1336 adding hello.txt
1336 $ hg qnew -d '0 0' empty
1337 $ hg qnew -d '0 0' empty
1337 $ hg qpop
1338 $ hg qpop
1338 popping empty
1339 popping empty
1339 patch queue now empty
1340 patch queue now empty
1340 $ echo world >> hello.txt
1341 $ echo world >> hello.txt
1341
1342
1342
1343
1343 qpush should fail, local changes
1344 qpush should fail, local changes
1344
1345
1345 $ hg qpush
1346 $ hg qpush
1346 abort: local changes found
1347 abort: local changes found
1347 [255]
1348 [255]
1348
1349
1349
1350
1350 apply force, should not discard changes with empty patch
1351 apply force, should not discard changes with empty patch
1351
1352
1352 $ hg qpush -f
1353 $ hg qpush -f
1353 applying empty
1354 applying empty
1354 patch empty is empty
1355 patch empty is empty
1355 now at: empty
1356 now at: empty
1356 $ hg diff --config diff.nodates=True
1357 $ hg diff --config diff.nodates=True
1357 diff -r d58265112590 hello.txt
1358 diff -r d58265112590 hello.txt
1358 --- a/hello.txt
1359 --- a/hello.txt
1359 +++ b/hello.txt
1360 +++ b/hello.txt
1360 @@ -1,1 +1,2 @@
1361 @@ -1,1 +1,2 @@
1361 hello
1362 hello
1362 +world
1363 +world
1363 $ hg qdiff --config diff.nodates=True
1364 $ hg qdiff --config diff.nodates=True
1364 diff -r 9ecee4f634e3 hello.txt
1365 diff -r 9ecee4f634e3 hello.txt
1365 --- a/hello.txt
1366 --- a/hello.txt
1366 +++ b/hello.txt
1367 +++ b/hello.txt
1367 @@ -1,1 +1,2 @@
1368 @@ -1,1 +1,2 @@
1368 hello
1369 hello
1369 +world
1370 +world
1370 $ hg log -l1 -p
1371 $ hg log -l1 -p
1371 changeset: 1:d58265112590
1372 changeset: 1:d58265112590
1372 tag: empty
1373 tag: empty
1373 tag: qbase
1374 tag: qbase
1374 tag: qtip
1375 tag: qtip
1375 tag: tip
1376 tag: tip
1376 user: test
1377 user: test
1377 date: Thu Jan 01 00:00:00 1970 +0000
1378 date: Thu Jan 01 00:00:00 1970 +0000
1378 summary: imported patch empty
1379 summary: imported patch empty
1379
1380
1380
1381
1381 $ hg qref -d '0 0'
1382 $ hg qref -d '0 0'
1382 $ hg qpop
1383 $ hg qpop
1383 popping empty
1384 popping empty
1384 patch queue now empty
1385 patch queue now empty
1385 $ echo universe >> hello.txt
1386 $ echo universe >> hello.txt
1386 $ echo universe >> bye.txt
1387 $ echo universe >> bye.txt
1387
1388
1388
1389
1389 qpush should fail, local changes
1390 qpush should fail, local changes
1390
1391
1391 $ hg qpush
1392 $ hg qpush
1392 abort: local changes found
1393 abort: local changes found
1393 [255]
1394 [255]
1394
1395
1395
1396
1396 apply force, should discard changes in hello, but not bye
1397 apply force, should discard changes in hello, but not bye
1397
1398
1398 $ hg qpush -f --verbose
1399 $ hg qpush -f --verbose
1399 applying empty
1400 applying empty
1400 saving current version of hello.txt as hello.txt.orig
1401 saving current version of hello.txt as hello.txt.orig
1401 patching file hello.txt
1402 patching file hello.txt
1402 hello.txt
1403 hello.txt
1403 now at: empty
1404 now at: empty
1404 $ hg st
1405 $ hg st
1405 M bye.txt
1406 M bye.txt
1406 ? hello.txt.orig
1407 ? hello.txt.orig
1407 $ hg diff --config diff.nodates=True
1408 $ hg diff --config diff.nodates=True
1408 diff -r ba252371dbc1 bye.txt
1409 diff -r ba252371dbc1 bye.txt
1409 --- a/bye.txt
1410 --- a/bye.txt
1410 +++ b/bye.txt
1411 +++ b/bye.txt
1411 @@ -1,1 +1,2 @@
1412 @@ -1,1 +1,2 @@
1412 bye
1413 bye
1413 +universe
1414 +universe
1414 $ hg qdiff --config diff.nodates=True
1415 $ hg qdiff --config diff.nodates=True
1415 diff -r 9ecee4f634e3 bye.txt
1416 diff -r 9ecee4f634e3 bye.txt
1416 --- a/bye.txt
1417 --- a/bye.txt
1417 +++ b/bye.txt
1418 +++ b/bye.txt
1418 @@ -1,1 +1,2 @@
1419 @@ -1,1 +1,2 @@
1419 bye
1420 bye
1420 +universe
1421 +universe
1421 diff -r 9ecee4f634e3 hello.txt
1422 diff -r 9ecee4f634e3 hello.txt
1422 --- a/hello.txt
1423 --- a/hello.txt
1423 +++ b/hello.txt
1424 +++ b/hello.txt
1424 @@ -1,1 +1,3 @@
1425 @@ -1,1 +1,3 @@
1425 hello
1426 hello
1426 +world
1427 +world
1427 +universe
1428 +universe
1428
1429
1429
1430
1430 test popping revisions not in working dir ancestry
1431 test popping revisions not in working dir ancestry
1431
1432
1432 $ hg qseries -v
1433 $ hg qseries -v
1433 0 A empty
1434 0 A empty
1434 $ hg up qparent
1435 $ hg up qparent
1435 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1436 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1436 $ hg qpop
1437 $ hg qpop
1437 popping empty
1438 popping empty
1438 patch queue now empty
1439 patch queue now empty
1439
1440
1440 $ cd ..
1441 $ cd ..
1441 $ hg init deletion-order
1442 $ hg init deletion-order
1442 $ cd deletion-order
1443 $ cd deletion-order
1443
1444
1444 $ touch a
1445 $ touch a
1445 $ hg ci -Aqm0
1446 $ hg ci -Aqm0
1446
1447
1447 $ hg qnew rename-dir
1448 $ hg qnew rename-dir
1448 $ hg rm a
1449 $ hg rm a
1449 $ hg qrefresh
1450 $ hg qrefresh
1450
1451
1451 $ mkdir a b
1452 $ mkdir a b
1452 $ touch a/a b/b
1453 $ touch a/a b/b
1453 $ hg add -q a b
1454 $ hg add -q a b
1454 $ hg qrefresh
1455 $ hg qrefresh
1455
1456
1456
1457
1457 test popping must remove files added in subdirectories first
1458 test popping must remove files added in subdirectories first
1458
1459
1459 $ hg qpop
1460 $ hg qpop
1460 popping rename-dir
1461 popping rename-dir
1461 patch queue now empty
1462 patch queue now empty
1462 $ cd ..
1463 $ cd ..
1463
1464
1464
1465
1465 test case preservation through patch pushing especially on case
1466 test case preservation through patch pushing especially on case
1466 insensitive filesystem
1467 insensitive filesystem
1467
1468
1468 $ hg init casepreserve
1469 $ hg init casepreserve
1469 $ cd casepreserve
1470 $ cd casepreserve
1470
1471
1471 $ hg qnew add-file1
1472 $ hg qnew add-file1
1472 $ echo a > TeXtFiLe.TxT
1473 $ echo a > TeXtFiLe.TxT
1473 $ hg add TeXtFiLe.TxT
1474 $ hg add TeXtFiLe.TxT
1474 $ hg qrefresh
1475 $ hg qrefresh
1475
1476
1476 $ hg qnew add-file2
1477 $ hg qnew add-file2
1477 $ echo b > AnOtHeRFiLe.TxT
1478 $ echo b > AnOtHeRFiLe.TxT
1478 $ hg add AnOtHeRFiLe.TxT
1479 $ hg add AnOtHeRFiLe.TxT
1479 $ hg qrefresh
1480 $ hg qrefresh
1480
1481
1481 $ hg qnew modify-file
1482 $ hg qnew modify-file
1482 $ echo c >> AnOtHeRFiLe.TxT
1483 $ echo c >> AnOtHeRFiLe.TxT
1483 $ hg qrefresh
1484 $ hg qrefresh
1484
1485
1485 $ hg qapplied
1486 $ hg qapplied
1486 add-file1
1487 add-file1
1487 add-file2
1488 add-file2
1488 modify-file
1489 modify-file
1489 $ hg qpop -a
1490 $ hg qpop -a
1490 popping modify-file
1491 popping modify-file
1491 popping add-file2
1492 popping add-file2
1492 popping add-file1
1493 popping add-file1
1493 patch queue now empty
1494 patch queue now empty
1494
1495
1495 this qpush causes problems below, if case preservation on case
1496 this qpush causes problems below, if case preservation on case
1496 insensitive filesystem is not enough:
1497 insensitive filesystem is not enough:
1497 (1) unexpected "adding ..." messages are shown
1498 (1) unexpected "adding ..." messages are shown
1498 (2) patching fails in modification of (1) files
1499 (2) patching fails in modification of (1) files
1499
1500
1500 $ hg qpush -a
1501 $ hg qpush -a
1501 applying add-file1
1502 applying add-file1
1502 applying add-file2
1503 applying add-file2
1503 applying modify-file
1504 applying modify-file
1504 now at: modify-file
1505 now at: modify-file
1505
1506
1506 Proper phase default with mq:
1507 Proper phase default with mq:
1507
1508
1508 1. mq.secret=false
1509 1. mq.secret=false
1509
1510
1510 $ rm .hg/store/phaseroots
1511 $ rm .hg/store/phaseroots
1511 $ hg phase 'qparent::'
1512 $ hg phase 'qparent::'
1512 -1: public
1513 -1: public
1513 0: draft
1514 0: draft
1514 1: draft
1515 1: draft
1515 2: draft
1516 2: draft
1516 $ echo '[mq]' >> $HGRCPATH
1517 $ echo '[mq]' >> $HGRCPATH
1517 $ echo 'secret=true' >> $HGRCPATH
1518 $ echo 'secret=true' >> $HGRCPATH
1518 $ rm -f .hg/store/phaseroots
1519 $ rm -f .hg/store/phaseroots
1519 $ hg phase 'qparent::'
1520 $ hg phase 'qparent::'
1520 -1: public
1521 -1: public
1521 0: secret
1522 0: secret
1522 1: secret
1523 1: secret
1523 2: secret
1524 2: secret
1524
1525
1525 Test that qfinish change phase when mq.secret=true
1526 Test that qfinish change phase when mq.secret=true
1526
1527
1527 $ hg qfinish qbase
1528 $ hg qfinish qbase
1528 patch add-file1 finalized without changeset message
1529 patch add-file1 finalized without changeset message
1529 $ hg phase 'all()'
1530 $ hg phase 'all()'
1530 0: draft
1531 0: draft
1531 1: secret
1532 1: secret
1532 2: secret
1533 2: secret
1533
1534
1534 Test that qfinish respect phases.new-commit setting
1535 Test that qfinish respect phases.new-commit setting
1535
1536
1536 $ echo '[phases]' >> $HGRCPATH
1537 $ echo '[phases]' >> $HGRCPATH
1537 $ echo 'new-commit=secret' >> $HGRCPATH
1538 $ echo 'new-commit=secret' >> $HGRCPATH
1538 $ hg qfinish qbase
1539 $ hg qfinish qbase
1539 patch add-file2 finalized without changeset message
1540 patch add-file2 finalized without changeset message
1540 $ hg phase 'all()'
1541 $ hg phase 'all()'
1541 0: draft
1542 0: draft
1542 1: secret
1543 1: secret
1543 2: secret
1544 2: secret
1544
1545
1545 (restore env for next test)
1546 (restore env for next test)
1546
1547
1547 $ sed -e 's/new-commit=secret//' $HGRCPATH > $TESTTMP/sedtmp
1548 $ sed -e 's/new-commit=secret//' $HGRCPATH > $TESTTMP/sedtmp
1548 $ cp $TESTTMP/sedtmp $HGRCPATH
1549 $ cp $TESTTMP/sedtmp $HGRCPATH
1549 $ hg qimport -r 1 --name add-file2
1550 $ hg qimport -r 1 --name add-file2
1550
1551
1551 Test that qfinish preserve phase when mq.secret=false
1552 Test that qfinish preserve phase when mq.secret=false
1552
1553
1553 $ sed -e 's/secret=true/secret=false/' $HGRCPATH > $TESTTMP/sedtmp
1554 $ sed -e 's/secret=true/secret=false/' $HGRCPATH > $TESTTMP/sedtmp
1554 $ cp $TESTTMP/sedtmp $HGRCPATH
1555 $ cp $TESTTMP/sedtmp $HGRCPATH
1555 $ hg qfinish qbase
1556 $ hg qfinish qbase
1556 patch add-file2 finalized without changeset message
1557 patch add-file2 finalized without changeset message
1557 $ hg phase 'all()'
1558 $ hg phase 'all()'
1558 0: draft
1559 0: draft
1559 1: secret
1560 1: secret
1560 2: secret
1561 2: secret
1561
1562
1562 Test that secret mq patch does not break hgweb
1563 Test that secret mq patch does not break hgweb
1563
1564
1564 $ cat > hgweb.cgi <<HGWEB
1565 $ cat > hgweb.cgi <<HGWEB
1565 > from mercurial import demandimport; demandimport.enable()
1566 > from mercurial import demandimport; demandimport.enable()
1566 > from mercurial.hgweb import hgweb
1567 > from mercurial.hgweb import hgweb
1567 > from mercurial.hgweb import wsgicgi
1568 > from mercurial.hgweb import wsgicgi
1568 > import cgitb
1569 > import cgitb
1569 > cgitb.enable()
1570 > cgitb.enable()
1570 > app = hgweb('.', 'test')
1571 > app = hgweb('.', 'test')
1571 > wsgicgi.launch(app)
1572 > wsgicgi.launch(app)
1572 > HGWEB
1573 > HGWEB
1573 $ . "$TESTDIR/cgienv"
1574 $ . "$TESTDIR/cgienv"
1574 #if msys
1575 #if msys
1575 $ PATH_INFO=//tags; export PATH_INFO
1576 $ PATH_INFO=//tags; export PATH_INFO
1576 #else
1577 #else
1577 $ PATH_INFO=/tags; export PATH_INFO
1578 $ PATH_INFO=/tags; export PATH_INFO
1578 #endif
1579 #endif
1579 $ QUERY_STRING='style=raw'
1580 $ QUERY_STRING='style=raw'
1580 $ python hgweb.cgi | grep '^tip'
1581 $ python hgweb.cgi | grep '^tip'
1581 tip [0-9a-f]{40} (re)
1582 tip [0-9a-f]{40} (re)
1582
1583
1583 $ cd ..
1584 $ cd ..
1584
1585
1585 Test interaction with revset (issue4426)
1586 Test interaction with revset (issue4426)
1586
1587
1587 $ hg init issue4426
1588 $ hg init issue4426
1588 $ cd issue4426
1589 $ cd issue4426
1589
1590
1590 $ echo a > a
1591 $ echo a > a
1591 $ hg ci -Am a
1592 $ hg ci -Am a
1592 adding a
1593 adding a
1593 $ echo a >> a
1594 $ echo a >> a
1594 $ hg ci -m a
1595 $ hg ci -m a
1595 $ echo a >> a
1596 $ echo a >> a
1596 $ hg ci -m a
1597 $ hg ci -m a
1597 $ hg qimport -r 0::
1598 $ hg qimport -r 0::
1598
1599
1599 reimport things
1600 reimport things
1600
1601
1601 $ hg qimport -r 1::
1602 $ hg qimport -r 1::
1602 abort: revision 2 is already managed
1603 abort: revision 2 is already managed
1603 [255]
1604 [255]
1604
1605
1605
1606
1606 $ cd ..
1607 $ cd ..
@@ -1,1377 +1,1379 b''
1 Set up a repo
1 Set up a repo
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 $ echo "interactive=true" >> $HGRCPATH
4 > [ui]
5 $ echo "[extensions]" >> $HGRCPATH
5 > interactive = true
6 $ echo "record=" >> $HGRCPATH
6 > [extensions]
7 > record =
8 > EOF
7
9
8 $ hg init a
10 $ hg init a
9 $ cd a
11 $ cd a
10
12
11 Select no files
13 Select no files
12
14
13 $ touch empty-rw
15 $ touch empty-rw
14 $ hg add empty-rw
16 $ hg add empty-rw
15
17
16 $ hg record empty-rw<<EOF
18 $ hg record empty-rw<<EOF
17 > n
19 > n
18 > EOF
20 > EOF
19 diff --git a/empty-rw b/empty-rw
21 diff --git a/empty-rw b/empty-rw
20 new file mode 100644
22 new file mode 100644
21 examine changes to 'empty-rw'? [Ynesfdaq?] n
23 examine changes to 'empty-rw'? [Ynesfdaq?] n
22
24
23 no changes to record
25 no changes to record
24
26
25 $ hg tip -p
27 $ hg tip -p
26 changeset: -1:000000000000
28 changeset: -1:000000000000
27 tag: tip
29 tag: tip
28 user:
30 user:
29 date: Thu Jan 01 00:00:00 1970 +0000
31 date: Thu Jan 01 00:00:00 1970 +0000
30
32
31
33
32
34
33 Select files but no hunks
35 Select files but no hunks
34
36
35 $ hg record empty-rw<<EOF
37 $ hg record empty-rw<<EOF
36 > y
38 > y
37 > n
39 > n
38 > EOF
40 > EOF
39 diff --git a/empty-rw b/empty-rw
41 diff --git a/empty-rw b/empty-rw
40 new file mode 100644
42 new file mode 100644
41 examine changes to 'empty-rw'? [Ynesfdaq?] y
43 examine changes to 'empty-rw'? [Ynesfdaq?] y
42
44
43 abort: empty commit message
45 abort: empty commit message
44 [255]
46 [255]
45
47
46 $ hg tip -p
48 $ hg tip -p
47 changeset: -1:000000000000
49 changeset: -1:000000000000
48 tag: tip
50 tag: tip
49 user:
51 user:
50 date: Thu Jan 01 00:00:00 1970 +0000
52 date: Thu Jan 01 00:00:00 1970 +0000
51
53
52
54
53
55
54 Record empty file
56 Record empty file
55
57
56 $ hg record -d '0 0' -m empty empty-rw<<EOF
58 $ hg record -d '0 0' -m empty empty-rw<<EOF
57 > y
59 > y
58 > y
60 > y
59 > EOF
61 > EOF
60 diff --git a/empty-rw b/empty-rw
62 diff --git a/empty-rw b/empty-rw
61 new file mode 100644
63 new file mode 100644
62 examine changes to 'empty-rw'? [Ynesfdaq?] y
64 examine changes to 'empty-rw'? [Ynesfdaq?] y
63
65
64
66
65 $ hg tip -p
67 $ hg tip -p
66 changeset: 0:c0708cf4e46e
68 changeset: 0:c0708cf4e46e
67 tag: tip
69 tag: tip
68 user: test
70 user: test
69 date: Thu Jan 01 00:00:00 1970 +0000
71 date: Thu Jan 01 00:00:00 1970 +0000
70 summary: empty
72 summary: empty
71
73
72
74
73
75
74 Summary shows we updated to the new cset
76 Summary shows we updated to the new cset
75
77
76 $ hg summary
78 $ hg summary
77 parent: 0:c0708cf4e46e tip
79 parent: 0:c0708cf4e46e tip
78 empty
80 empty
79 branch: default
81 branch: default
80 commit: (clean)
82 commit: (clean)
81 update: (current)
83 update: (current)
82
84
83 Rename empty file
85 Rename empty file
84
86
85 $ hg mv empty-rw empty-rename
87 $ hg mv empty-rw empty-rename
86 $ hg record -d '1 0' -m rename<<EOF
88 $ hg record -d '1 0' -m rename<<EOF
87 > y
89 > y
88 > EOF
90 > EOF
89 diff --git a/empty-rw b/empty-rename
91 diff --git a/empty-rw b/empty-rename
90 rename from empty-rw
92 rename from empty-rw
91 rename to empty-rename
93 rename to empty-rename
92 examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y
94 examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y
93
95
94
96
95 $ hg tip -p
97 $ hg tip -p
96 changeset: 1:d695e8dcb197
98 changeset: 1:d695e8dcb197
97 tag: tip
99 tag: tip
98 user: test
100 user: test
99 date: Thu Jan 01 00:00:01 1970 +0000
101 date: Thu Jan 01 00:00:01 1970 +0000
100 summary: rename
102 summary: rename
101
103
102
104
103
105
104 Copy empty file
106 Copy empty file
105
107
106 $ hg cp empty-rename empty-copy
108 $ hg cp empty-rename empty-copy
107 $ hg record -d '2 0' -m copy<<EOF
109 $ hg record -d '2 0' -m copy<<EOF
108 > y
110 > y
109 > EOF
111 > EOF
110 diff --git a/empty-rename b/empty-copy
112 diff --git a/empty-rename b/empty-copy
111 copy from empty-rename
113 copy from empty-rename
112 copy to empty-copy
114 copy to empty-copy
113 examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y
115 examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y
114
116
115
117
116 $ hg tip -p
118 $ hg tip -p
117 changeset: 2:1d4b90bea524
119 changeset: 2:1d4b90bea524
118 tag: tip
120 tag: tip
119 user: test
121 user: test
120 date: Thu Jan 01 00:00:02 1970 +0000
122 date: Thu Jan 01 00:00:02 1970 +0000
121 summary: copy
123 summary: copy
122
124
123
125
124
126
125 Delete empty file
127 Delete empty file
126
128
127 $ hg rm empty-copy
129 $ hg rm empty-copy
128 $ hg record -d '3 0' -m delete<<EOF
130 $ hg record -d '3 0' -m delete<<EOF
129 > y
131 > y
130 > EOF
132 > EOF
131 diff --git a/empty-copy b/empty-copy
133 diff --git a/empty-copy b/empty-copy
132 deleted file mode 100644
134 deleted file mode 100644
133 examine changes to 'empty-copy'? [Ynesfdaq?] y
135 examine changes to 'empty-copy'? [Ynesfdaq?] y
134
136
135
137
136 $ hg tip -p
138 $ hg tip -p
137 changeset: 3:b39a238f01a1
139 changeset: 3:b39a238f01a1
138 tag: tip
140 tag: tip
139 user: test
141 user: test
140 date: Thu Jan 01 00:00:03 1970 +0000
142 date: Thu Jan 01 00:00:03 1970 +0000
141 summary: delete
143 summary: delete
142
144
143
145
144
146
145 Add binary file
147 Add binary file
146
148
147 $ hg bundle --base -2 tip.bundle
149 $ hg bundle --base -2 tip.bundle
148 1 changesets found
150 1 changesets found
149 $ hg add tip.bundle
151 $ hg add tip.bundle
150 $ hg record -d '4 0' -m binary<<EOF
152 $ hg record -d '4 0' -m binary<<EOF
151 > y
153 > y
152 > EOF
154 > EOF
153 diff --git a/tip.bundle b/tip.bundle
155 diff --git a/tip.bundle b/tip.bundle
154 new file mode 100644
156 new file mode 100644
155 this is a binary file
157 this is a binary file
156 examine changes to 'tip.bundle'? [Ynesfdaq?] y
158 examine changes to 'tip.bundle'? [Ynesfdaq?] y
157
159
158
160
159 $ hg tip -p
161 $ hg tip -p
160 changeset: 4:ad816da3711e
162 changeset: 4:ad816da3711e
161 tag: tip
163 tag: tip
162 user: test
164 user: test
163 date: Thu Jan 01 00:00:04 1970 +0000
165 date: Thu Jan 01 00:00:04 1970 +0000
164 summary: binary
166 summary: binary
165
167
166 diff -r b39a238f01a1 -r ad816da3711e tip.bundle
168 diff -r b39a238f01a1 -r ad816da3711e tip.bundle
167 Binary file tip.bundle has changed
169 Binary file tip.bundle has changed
168
170
169
171
170 Change binary file
172 Change binary file
171
173
172 $ hg bundle --base -2 tip.bundle
174 $ hg bundle --base -2 tip.bundle
173 1 changesets found
175 1 changesets found
174 $ hg record -d '5 0' -m binary-change<<EOF
176 $ hg record -d '5 0' -m binary-change<<EOF
175 > y
177 > y
176 > EOF
178 > EOF
177 diff --git a/tip.bundle b/tip.bundle
179 diff --git a/tip.bundle b/tip.bundle
178 this modifies a binary file (all or nothing)
180 this modifies a binary file (all or nothing)
179 examine changes to 'tip.bundle'? [Ynesfdaq?] y
181 examine changes to 'tip.bundle'? [Ynesfdaq?] y
180
182
181
183
182 $ hg tip -p
184 $ hg tip -p
183 changeset: 5:dccd6f3eb485
185 changeset: 5:dccd6f3eb485
184 tag: tip
186 tag: tip
185 user: test
187 user: test
186 date: Thu Jan 01 00:00:05 1970 +0000
188 date: Thu Jan 01 00:00:05 1970 +0000
187 summary: binary-change
189 summary: binary-change
188
190
189 diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
191 diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
190 Binary file tip.bundle has changed
192 Binary file tip.bundle has changed
191
193
192
194
193 Rename and change binary file
195 Rename and change binary file
194
196
195 $ hg mv tip.bundle top.bundle
197 $ hg mv tip.bundle top.bundle
196 $ hg bundle --base -2 top.bundle
198 $ hg bundle --base -2 top.bundle
197 1 changesets found
199 1 changesets found
198 $ hg record -d '6 0' -m binary-change-rename<<EOF
200 $ hg record -d '6 0' -m binary-change-rename<<EOF
199 > y
201 > y
200 > EOF
202 > EOF
201 diff --git a/tip.bundle b/top.bundle
203 diff --git a/tip.bundle b/top.bundle
202 rename from tip.bundle
204 rename from tip.bundle
203 rename to top.bundle
205 rename to top.bundle
204 this modifies a binary file (all or nothing)
206 this modifies a binary file (all or nothing)
205 examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y
207 examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y
206
208
207
209
208 $ hg tip -p
210 $ hg tip -p
209 changeset: 6:7fa44105f5b3
211 changeset: 6:7fa44105f5b3
210 tag: tip
212 tag: tip
211 user: test
213 user: test
212 date: Thu Jan 01 00:00:06 1970 +0000
214 date: Thu Jan 01 00:00:06 1970 +0000
213 summary: binary-change-rename
215 summary: binary-change-rename
214
216
215 diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
217 diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
216 Binary file tip.bundle has changed
218 Binary file tip.bundle has changed
217 diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
219 diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
218 Binary file top.bundle has changed
220 Binary file top.bundle has changed
219
221
220
222
221 Add plain file
223 Add plain file
222
224
223 $ for i in 1 2 3 4 5 6 7 8 9 10; do
225 $ for i in 1 2 3 4 5 6 7 8 9 10; do
224 > echo $i >> plain
226 > echo $i >> plain
225 > done
227 > done
226
228
227 $ hg add plain
229 $ hg add plain
228 $ hg record -d '7 0' -m plain plain<<EOF
230 $ hg record -d '7 0' -m plain plain<<EOF
229 > y
231 > y
230 > y
232 > y
231 > EOF
233 > EOF
232 diff --git a/plain b/plain
234 diff --git a/plain b/plain
233 new file mode 100644
235 new file mode 100644
234 examine changes to 'plain'? [Ynesfdaq?] y
236 examine changes to 'plain'? [Ynesfdaq?] y
235
237
236
238
237 $ hg tip -p
239 $ hg tip -p
238 changeset: 7:11fb457c1be4
240 changeset: 7:11fb457c1be4
239 tag: tip
241 tag: tip
240 user: test
242 user: test
241 date: Thu Jan 01 00:00:07 1970 +0000
243 date: Thu Jan 01 00:00:07 1970 +0000
242 summary: plain
244 summary: plain
243
245
244 diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
246 diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
245 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
247 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
246 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
248 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
247 @@ -0,0 +1,10 @@
249 @@ -0,0 +1,10 @@
248 +1
250 +1
249 +2
251 +2
250 +3
252 +3
251 +4
253 +4
252 +5
254 +5
253 +6
255 +6
254 +7
256 +7
255 +8
257 +8
256 +9
258 +9
257 +10
259 +10
258
260
259 Modify end of plain file with username unset
261 Modify end of plain file with username unset
260
262
261 $ echo 11 >> plain
263 $ echo 11 >> plain
262 $ unset HGUSER
264 $ unset HGUSER
263 $ hg record --config ui.username= -d '8 0' -m end plain
265 $ hg record --config ui.username= -d '8 0' -m end plain
264 abort: no username supplied
266 abort: no username supplied
265 (use "hg config --edit" to set your username)
267 (use "hg config --edit" to set your username)
266 [255]
268 [255]
267
269
268
270
269 Modify end of plain file, also test that diffopts are accounted for
271 Modify end of plain file, also test that diffopts are accounted for
270
272
271 $ HGUSER="test"
273 $ HGUSER="test"
272 $ export HGUSER
274 $ export HGUSER
273 $ hg record --config diff.showfunc=true -d '8 0' -m end plain <<EOF
275 $ hg record --config diff.showfunc=true -d '8 0' -m end plain <<EOF
274 > y
276 > y
275 > y
277 > y
276 > EOF
278 > EOF
277 diff --git a/plain b/plain
279 diff --git a/plain b/plain
278 1 hunks, 1 lines changed
280 1 hunks, 1 lines changed
279 examine changes to 'plain'? [Ynesfdaq?] y
281 examine changes to 'plain'? [Ynesfdaq?] y
280
282
281 @@ -8,3 +8,4 @@ 7
283 @@ -8,3 +8,4 @@ 7
282 8
284 8
283 9
285 9
284 10
286 10
285 +11
287 +11
286 record this change to 'plain'? [Ynesfdaq?] y
288 record this change to 'plain'? [Ynesfdaq?] y
287
289
288
290
289 Modify end of plain file, no EOL
291 Modify end of plain file, no EOL
290
292
291 $ hg tip --template '{node}' >> plain
293 $ hg tip --template '{node}' >> plain
292 $ hg record -d '9 0' -m noeol plain <<EOF
294 $ hg record -d '9 0' -m noeol plain <<EOF
293 > y
295 > y
294 > y
296 > y
295 > EOF
297 > EOF
296 diff --git a/plain b/plain
298 diff --git a/plain b/plain
297 1 hunks, 1 lines changed
299 1 hunks, 1 lines changed
298 examine changes to 'plain'? [Ynesfdaq?] y
300 examine changes to 'plain'? [Ynesfdaq?] y
299
301
300 @@ -9,3 +9,4 @@
302 @@ -9,3 +9,4 @@
301 9
303 9
302 10
304 10
303 11
305 11
304 +7264f99c5f5ff3261504828afa4fb4d406c3af54
306 +7264f99c5f5ff3261504828afa4fb4d406c3af54
305 \ No newline at end of file
307 \ No newline at end of file
306 record this change to 'plain'? [Ynesfdaq?] y
308 record this change to 'plain'? [Ynesfdaq?] y
307
309
308
310
309 Modify end of plain file, add EOL
311 Modify end of plain file, add EOL
310
312
311 $ echo >> plain
313 $ echo >> plain
312 $ echo 1 > plain2
314 $ echo 1 > plain2
313 $ hg add plain2
315 $ hg add plain2
314 $ hg record -d '10 0' -m eol plain plain2 <<EOF
316 $ hg record -d '10 0' -m eol plain plain2 <<EOF
315 > y
317 > y
316 > y
318 > y
317 > y
319 > y
318 > EOF
320 > EOF
319 diff --git a/plain b/plain
321 diff --git a/plain b/plain
320 1 hunks, 1 lines changed
322 1 hunks, 1 lines changed
321 examine changes to 'plain'? [Ynesfdaq?] y
323 examine changes to 'plain'? [Ynesfdaq?] y
322
324
323 @@ -9,4 +9,4 @@
325 @@ -9,4 +9,4 @@
324 9
326 9
325 10
327 10
326 11
328 11
327 -7264f99c5f5ff3261504828afa4fb4d406c3af54
329 -7264f99c5f5ff3261504828afa4fb4d406c3af54
328 \ No newline at end of file
330 \ No newline at end of file
329 +7264f99c5f5ff3261504828afa4fb4d406c3af54
331 +7264f99c5f5ff3261504828afa4fb4d406c3af54
330 record change 1/2 to 'plain'? [Ynesfdaq?] y
332 record change 1/2 to 'plain'? [Ynesfdaq?] y
331
333
332 diff --git a/plain2 b/plain2
334 diff --git a/plain2 b/plain2
333 new file mode 100644
335 new file mode 100644
334 examine changes to 'plain2'? [Ynesfdaq?] y
336 examine changes to 'plain2'? [Ynesfdaq?] y
335
337
336
338
337 Modify beginning, trim end, record both, add another file to test
339 Modify beginning, trim end, record both, add another file to test
338 changes numbering
340 changes numbering
339
341
340 $ rm plain
342 $ rm plain
341 $ for i in 2 2 3 4 5 6 7 8 9 10; do
343 $ for i in 2 2 3 4 5 6 7 8 9 10; do
342 > echo $i >> plain
344 > echo $i >> plain
343 > done
345 > done
344 $ echo 2 >> plain2
346 $ echo 2 >> plain2
345
347
346 $ hg record -d '10 0' -m begin-and-end plain plain2 <<EOF
348 $ hg record -d '10 0' -m begin-and-end plain plain2 <<EOF
347 > y
349 > y
348 > y
350 > y
349 > y
351 > y
350 > y
352 > y
351 > y
353 > y
352 > EOF
354 > EOF
353 diff --git a/plain b/plain
355 diff --git a/plain b/plain
354 2 hunks, 3 lines changed
356 2 hunks, 3 lines changed
355 examine changes to 'plain'? [Ynesfdaq?] y
357 examine changes to 'plain'? [Ynesfdaq?] y
356
358
357 @@ -1,4 +1,4 @@
359 @@ -1,4 +1,4 @@
358 -1
360 -1
359 +2
361 +2
360 2
362 2
361 3
363 3
362 4
364 4
363 record change 1/3 to 'plain'? [Ynesfdaq?] y
365 record change 1/3 to 'plain'? [Ynesfdaq?] y
364
366
365 @@ -8,5 +8,3 @@
367 @@ -8,5 +8,3 @@
366 8
368 8
367 9
369 9
368 10
370 10
369 -11
371 -11
370 -7264f99c5f5ff3261504828afa4fb4d406c3af54
372 -7264f99c5f5ff3261504828afa4fb4d406c3af54
371 record change 2/3 to 'plain'? [Ynesfdaq?] y
373 record change 2/3 to 'plain'? [Ynesfdaq?] y
372
374
373 diff --git a/plain2 b/plain2
375 diff --git a/plain2 b/plain2
374 1 hunks, 1 lines changed
376 1 hunks, 1 lines changed
375 examine changes to 'plain2'? [Ynesfdaq?] y
377 examine changes to 'plain2'? [Ynesfdaq?] y
376
378
377 @@ -1,1 +1,2 @@
379 @@ -1,1 +1,2 @@
378 1
380 1
379 +2
381 +2
380 record change 3/3 to 'plain2'? [Ynesfdaq?] y
382 record change 3/3 to 'plain2'? [Ynesfdaq?] y
381
383
382
384
383 $ hg tip -p
385 $ hg tip -p
384 changeset: 11:21df83db12b8
386 changeset: 11:21df83db12b8
385 tag: tip
387 tag: tip
386 user: test
388 user: test
387 date: Thu Jan 01 00:00:10 1970 +0000
389 date: Thu Jan 01 00:00:10 1970 +0000
388 summary: begin-and-end
390 summary: begin-and-end
389
391
390 diff -r ddb8b281c3ff -r 21df83db12b8 plain
392 diff -r ddb8b281c3ff -r 21df83db12b8 plain
391 --- a/plain Thu Jan 01 00:00:10 1970 +0000
393 --- a/plain Thu Jan 01 00:00:10 1970 +0000
392 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
394 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
393 @@ -1,4 +1,4 @@
395 @@ -1,4 +1,4 @@
394 -1
396 -1
395 +2
397 +2
396 2
398 2
397 3
399 3
398 4
400 4
399 @@ -8,5 +8,3 @@
401 @@ -8,5 +8,3 @@
400 8
402 8
401 9
403 9
402 10
404 10
403 -11
405 -11
404 -7264f99c5f5ff3261504828afa4fb4d406c3af54
406 -7264f99c5f5ff3261504828afa4fb4d406c3af54
405 diff -r ddb8b281c3ff -r 21df83db12b8 plain2
407 diff -r ddb8b281c3ff -r 21df83db12b8 plain2
406 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
408 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
407 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
409 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
408 @@ -1,1 +1,2 @@
410 @@ -1,1 +1,2 @@
409 1
411 1
410 +2
412 +2
411
413
412
414
413 Trim beginning, modify end
415 Trim beginning, modify end
414
416
415 $ rm plain
417 $ rm plain
416 > for i in 4 5 6 7 8 9 10.new; do
418 > for i in 4 5 6 7 8 9 10.new; do
417 > echo $i >> plain
419 > echo $i >> plain
418 > done
420 > done
419
421
420 Record end
422 Record end
421
423
422 $ hg record -d '11 0' -m end-only plain <<EOF
424 $ hg record -d '11 0' -m end-only plain <<EOF
423 > y
425 > y
424 > n
426 > n
425 > y
427 > y
426 > EOF
428 > EOF
427 diff --git a/plain b/plain
429 diff --git a/plain b/plain
428 2 hunks, 4 lines changed
430 2 hunks, 4 lines changed
429 examine changes to 'plain'? [Ynesfdaq?] y
431 examine changes to 'plain'? [Ynesfdaq?] y
430
432
431 @@ -1,9 +1,6 @@
433 @@ -1,9 +1,6 @@
432 -2
434 -2
433 -2
435 -2
434 -3
436 -3
435 4
437 4
436 5
438 5
437 6
439 6
438 7
440 7
439 8
441 8
440 9
442 9
441 record change 1/2 to 'plain'? [Ynesfdaq?] n
443 record change 1/2 to 'plain'? [Ynesfdaq?] n
442
444
443 @@ -4,7 +1,7 @@
445 @@ -4,7 +1,7 @@
444 4
446 4
445 5
447 5
446 6
448 6
447 7
449 7
448 8
450 8
449 9
451 9
450 -10
452 -10
451 +10.new
453 +10.new
452 record change 2/2 to 'plain'? [Ynesfdaq?] y
454 record change 2/2 to 'plain'? [Ynesfdaq?] y
453
455
454
456
455 $ hg tip -p
457 $ hg tip -p
456 changeset: 12:99337501826f
458 changeset: 12:99337501826f
457 tag: tip
459 tag: tip
458 user: test
460 user: test
459 date: Thu Jan 01 00:00:11 1970 +0000
461 date: Thu Jan 01 00:00:11 1970 +0000
460 summary: end-only
462 summary: end-only
461
463
462 diff -r 21df83db12b8 -r 99337501826f plain
464 diff -r 21df83db12b8 -r 99337501826f plain
463 --- a/plain Thu Jan 01 00:00:10 1970 +0000
465 --- a/plain Thu Jan 01 00:00:10 1970 +0000
464 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
466 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
465 @@ -7,4 +7,4 @@
467 @@ -7,4 +7,4 @@
466 7
468 7
467 8
469 8
468 9
470 9
469 -10
471 -10
470 +10.new
472 +10.new
471
473
472
474
473 Record beginning
475 Record beginning
474
476
475 $ hg record -d '12 0' -m begin-only plain <<EOF
477 $ hg record -d '12 0' -m begin-only plain <<EOF
476 > y
478 > y
477 > y
479 > y
478 > EOF
480 > EOF
479 diff --git a/plain b/plain
481 diff --git a/plain b/plain
480 1 hunks, 3 lines changed
482 1 hunks, 3 lines changed
481 examine changes to 'plain'? [Ynesfdaq?] y
483 examine changes to 'plain'? [Ynesfdaq?] y
482
484
483 @@ -1,6 +1,3 @@
485 @@ -1,6 +1,3 @@
484 -2
486 -2
485 -2
487 -2
486 -3
488 -3
487 4
489 4
488 5
490 5
489 6
491 6
490 record this change to 'plain'? [Ynesfdaq?] y
492 record this change to 'plain'? [Ynesfdaq?] y
491
493
492
494
493 $ hg tip -p
495 $ hg tip -p
494 changeset: 13:bbd45465d540
496 changeset: 13:bbd45465d540
495 tag: tip
497 tag: tip
496 user: test
498 user: test
497 date: Thu Jan 01 00:00:12 1970 +0000
499 date: Thu Jan 01 00:00:12 1970 +0000
498 summary: begin-only
500 summary: begin-only
499
501
500 diff -r 99337501826f -r bbd45465d540 plain
502 diff -r 99337501826f -r bbd45465d540 plain
501 --- a/plain Thu Jan 01 00:00:11 1970 +0000
503 --- a/plain Thu Jan 01 00:00:11 1970 +0000
502 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
504 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
503 @@ -1,6 +1,3 @@
505 @@ -1,6 +1,3 @@
504 -2
506 -2
505 -2
507 -2
506 -3
508 -3
507 4
509 4
508 5
510 5
509 6
511 6
510
512
511
513
512 Add to beginning, trim from end
514 Add to beginning, trim from end
513
515
514 $ rm plain
516 $ rm plain
515 $ for i in 1 2 3 4 5 6 7 8 9; do
517 $ for i in 1 2 3 4 5 6 7 8 9; do
516 > echo $i >> plain
518 > echo $i >> plain
517 > done
519 > done
518
520
519 Record end
521 Record end
520
522
521 $ hg record --traceback -d '13 0' -m end-again plain<<EOF
523 $ hg record --traceback -d '13 0' -m end-again plain<<EOF
522 > y
524 > y
523 > n
525 > n
524 > y
526 > y
525 > EOF
527 > EOF
526 diff --git a/plain b/plain
528 diff --git a/plain b/plain
527 2 hunks, 4 lines changed
529 2 hunks, 4 lines changed
528 examine changes to 'plain'? [Ynesfdaq?] y
530 examine changes to 'plain'? [Ynesfdaq?] y
529
531
530 @@ -1,6 +1,9 @@
532 @@ -1,6 +1,9 @@
531 +1
533 +1
532 +2
534 +2
533 +3
535 +3
534 4
536 4
535 5
537 5
536 6
538 6
537 7
539 7
538 8
540 8
539 9
541 9
540 record change 1/2 to 'plain'? [Ynesfdaq?] n
542 record change 1/2 to 'plain'? [Ynesfdaq?] n
541
543
542 @@ -1,7 +4,6 @@
544 @@ -1,7 +4,6 @@
543 4
545 4
544 5
546 5
545 6
547 6
546 7
548 7
547 8
549 8
548 9
550 9
549 -10.new
551 -10.new
550 record change 2/2 to 'plain'? [Ynesfdaq?] y
552 record change 2/2 to 'plain'? [Ynesfdaq?] y
551
553
552
554
553 Add to beginning, middle, end
555 Add to beginning, middle, end
554
556
555 $ rm plain
557 $ rm plain
556 $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
558 $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
557 > echo $i >> plain
559 > echo $i >> plain
558 > done
560 > done
559
561
560 Record beginning, middle
562 Record beginning, middle
561
563
562 $ hg record -d '14 0' -m middle-only plain <<EOF
564 $ hg record -d '14 0' -m middle-only plain <<EOF
563 > y
565 > y
564 > y
566 > y
565 > y
567 > y
566 > n
568 > n
567 > EOF
569 > EOF
568 diff --git a/plain b/plain
570 diff --git a/plain b/plain
569 3 hunks, 7 lines changed
571 3 hunks, 7 lines changed
570 examine changes to 'plain'? [Ynesfdaq?] y
572 examine changes to 'plain'? [Ynesfdaq?] y
571
573
572 @@ -1,2 +1,5 @@
574 @@ -1,2 +1,5 @@
573 +1
575 +1
574 +2
576 +2
575 +3
577 +3
576 4
578 4
577 5
579 5
578 record change 1/3 to 'plain'? [Ynesfdaq?] y
580 record change 1/3 to 'plain'? [Ynesfdaq?] y
579
581
580 @@ -1,6 +4,8 @@
582 @@ -1,6 +4,8 @@
581 4
583 4
582 5
584 5
583 +5.new
585 +5.new
584 +5.reallynew
586 +5.reallynew
585 6
587 6
586 7
588 7
587 8
589 8
588 9
590 9
589 record change 2/3 to 'plain'? [Ynesfdaq?] y
591 record change 2/3 to 'plain'? [Ynesfdaq?] y
590
592
591 @@ -3,4 +8,6 @@
593 @@ -3,4 +8,6 @@
592 6
594 6
593 7
595 7
594 8
596 8
595 9
597 9
596 +10
598 +10
597 +11
599 +11
598 record change 3/3 to 'plain'? [Ynesfdaq?] n
600 record change 3/3 to 'plain'? [Ynesfdaq?] n
599
601
600
602
601 $ hg tip -p
603 $ hg tip -p
602 changeset: 15:f34a7937ec33
604 changeset: 15:f34a7937ec33
603 tag: tip
605 tag: tip
604 user: test
606 user: test
605 date: Thu Jan 01 00:00:14 1970 +0000
607 date: Thu Jan 01 00:00:14 1970 +0000
606 summary: middle-only
608 summary: middle-only
607
609
608 diff -r 82c065d0b850 -r f34a7937ec33 plain
610 diff -r 82c065d0b850 -r f34a7937ec33 plain
609 --- a/plain Thu Jan 01 00:00:13 1970 +0000
611 --- a/plain Thu Jan 01 00:00:13 1970 +0000
610 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
612 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
611 @@ -1,5 +1,10 @@
613 @@ -1,5 +1,10 @@
612 +1
614 +1
613 +2
615 +2
614 +3
616 +3
615 4
617 4
616 5
618 5
617 +5.new
619 +5.new
618 +5.reallynew
620 +5.reallynew
619 6
621 6
620 7
622 7
621 8
623 8
622
624
623
625
624 Record end
626 Record end
625
627
626 $ hg record -d '15 0' -m end-only plain <<EOF
628 $ hg record -d '15 0' -m end-only plain <<EOF
627 > y
629 > y
628 > y
630 > y
629 > EOF
631 > EOF
630 diff --git a/plain b/plain
632 diff --git a/plain b/plain
631 1 hunks, 2 lines changed
633 1 hunks, 2 lines changed
632 examine changes to 'plain'? [Ynesfdaq?] y
634 examine changes to 'plain'? [Ynesfdaq?] y
633
635
634 @@ -9,3 +9,5 @@
636 @@ -9,3 +9,5 @@
635 7
637 7
636 8
638 8
637 9
639 9
638 +10
640 +10
639 +11
641 +11
640 record this change to 'plain'? [Ynesfdaq?] y
642 record this change to 'plain'? [Ynesfdaq?] y
641
643
642
644
643 $ hg tip -p
645 $ hg tip -p
644 changeset: 16:f9900b71a04c
646 changeset: 16:f9900b71a04c
645 tag: tip
647 tag: tip
646 user: test
648 user: test
647 date: Thu Jan 01 00:00:15 1970 +0000
649 date: Thu Jan 01 00:00:15 1970 +0000
648 summary: end-only
650 summary: end-only
649
651
650 diff -r f34a7937ec33 -r f9900b71a04c plain
652 diff -r f34a7937ec33 -r f9900b71a04c plain
651 --- a/plain Thu Jan 01 00:00:14 1970 +0000
653 --- a/plain Thu Jan 01 00:00:14 1970 +0000
652 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
654 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
653 @@ -9,3 +9,5 @@
655 @@ -9,3 +9,5 @@
654 7
656 7
655 8
657 8
656 9
658 9
657 +10
659 +10
658 +11
660 +11
659
661
660
662
661 $ mkdir subdir
663 $ mkdir subdir
662 $ cd subdir
664 $ cd subdir
663 $ echo a > a
665 $ echo a > a
664 $ hg ci -d '16 0' -Amsubdir
666 $ hg ci -d '16 0' -Amsubdir
665 adding subdir/a
667 adding subdir/a
666
668
667 $ echo a >> a
669 $ echo a >> a
668 $ hg record -d '16 0' -m subdir-change a <<EOF
670 $ hg record -d '16 0' -m subdir-change a <<EOF
669 > y
671 > y
670 > y
672 > y
671 > EOF
673 > EOF
672 diff --git a/subdir/a b/subdir/a
674 diff --git a/subdir/a b/subdir/a
673 1 hunks, 1 lines changed
675 1 hunks, 1 lines changed
674 examine changes to 'subdir/a'? [Ynesfdaq?] y
676 examine changes to 'subdir/a'? [Ynesfdaq?] y
675
677
676 @@ -1,1 +1,2 @@
678 @@ -1,1 +1,2 @@
677 a
679 a
678 +a
680 +a
679 record this change to 'subdir/a'? [Ynesfdaq?] y
681 record this change to 'subdir/a'? [Ynesfdaq?] y
680
682
681
683
682 $ hg tip -p
684 $ hg tip -p
683 changeset: 18:61be427a9deb
685 changeset: 18:61be427a9deb
684 tag: tip
686 tag: tip
685 user: test
687 user: test
686 date: Thu Jan 01 00:00:16 1970 +0000
688 date: Thu Jan 01 00:00:16 1970 +0000
687 summary: subdir-change
689 summary: subdir-change
688
690
689 diff -r a7ffae4d61cb -r 61be427a9deb subdir/a
691 diff -r a7ffae4d61cb -r 61be427a9deb subdir/a
690 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
692 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
691 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
693 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
692 @@ -1,1 +1,2 @@
694 @@ -1,1 +1,2 @@
693 a
695 a
694 +a
696 +a
695
697
696
698
697 $ echo a > f1
699 $ echo a > f1
698 $ echo b > f2
700 $ echo b > f2
699 $ hg add f1 f2
701 $ hg add f1 f2
700
702
701 $ hg ci -mz -d '17 0'
703 $ hg ci -mz -d '17 0'
702
704
703 $ echo a >> f1
705 $ echo a >> f1
704 $ echo b >> f2
706 $ echo b >> f2
705
707
706 Help, quit
708 Help, quit
707
709
708 $ hg record <<EOF
710 $ hg record <<EOF
709 > ?
711 > ?
710 > q
712 > q
711 > EOF
713 > EOF
712 diff --git a/subdir/f1 b/subdir/f1
714 diff --git a/subdir/f1 b/subdir/f1
713 1 hunks, 1 lines changed
715 1 hunks, 1 lines changed
714 examine changes to 'subdir/f1'? [Ynesfdaq?] ?
716 examine changes to 'subdir/f1'? [Ynesfdaq?] ?
715
717
716 y - yes, record this change
718 y - yes, record this change
717 n - no, skip this change
719 n - no, skip this change
718 e - edit this change manually
720 e - edit this change manually
719 s - skip remaining changes to this file
721 s - skip remaining changes to this file
720 f - record remaining changes to this file
722 f - record remaining changes to this file
721 d - done, skip remaining changes and files
723 d - done, skip remaining changes and files
722 a - record all changes to all remaining files
724 a - record all changes to all remaining files
723 q - quit, recording no changes
725 q - quit, recording no changes
724 ? - ? (display help)
726 ? - ? (display help)
725 examine changes to 'subdir/f1'? [Ynesfdaq?] q
727 examine changes to 'subdir/f1'? [Ynesfdaq?] q
726
728
727 abort: user quit
729 abort: user quit
728 [255]
730 [255]
729
731
730 Skip
732 Skip
731
733
732 $ hg record <<EOF
734 $ hg record <<EOF
733 > s
735 > s
734 > EOF
736 > EOF
735 diff --git a/subdir/f1 b/subdir/f1
737 diff --git a/subdir/f1 b/subdir/f1
736 1 hunks, 1 lines changed
738 1 hunks, 1 lines changed
737 examine changes to 'subdir/f1'? [Ynesfdaq?] s
739 examine changes to 'subdir/f1'? [Ynesfdaq?] s
738
740
739 diff --git a/subdir/f2 b/subdir/f2
741 diff --git a/subdir/f2 b/subdir/f2
740 1 hunks, 1 lines changed
742 1 hunks, 1 lines changed
741 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
743 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
742 [255]
744 [255]
743
745
744 No
746 No
745
747
746 $ hg record <<EOF
748 $ hg record <<EOF
747 > n
749 > n
748 > EOF
750 > EOF
749 diff --git a/subdir/f1 b/subdir/f1
751 diff --git a/subdir/f1 b/subdir/f1
750 1 hunks, 1 lines changed
752 1 hunks, 1 lines changed
751 examine changes to 'subdir/f1'? [Ynesfdaq?] n
753 examine changes to 'subdir/f1'? [Ynesfdaq?] n
752
754
753 diff --git a/subdir/f2 b/subdir/f2
755 diff --git a/subdir/f2 b/subdir/f2
754 1 hunks, 1 lines changed
756 1 hunks, 1 lines changed
755 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
757 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
756 [255]
758 [255]
757
759
758 f, quit
760 f, quit
759
761
760 $ hg record <<EOF
762 $ hg record <<EOF
761 > f
763 > f
762 > q
764 > q
763 > EOF
765 > EOF
764 diff --git a/subdir/f1 b/subdir/f1
766 diff --git a/subdir/f1 b/subdir/f1
765 1 hunks, 1 lines changed
767 1 hunks, 1 lines changed
766 examine changes to 'subdir/f1'? [Ynesfdaq?] f
768 examine changes to 'subdir/f1'? [Ynesfdaq?] f
767
769
768 diff --git a/subdir/f2 b/subdir/f2
770 diff --git a/subdir/f2 b/subdir/f2
769 1 hunks, 1 lines changed
771 1 hunks, 1 lines changed
770 examine changes to 'subdir/f2'? [Ynesfdaq?] q
772 examine changes to 'subdir/f2'? [Ynesfdaq?] q
771
773
772 abort: user quit
774 abort: user quit
773 [255]
775 [255]
774
776
775 s, all
777 s, all
776
778
777 $ hg record -d '18 0' -mx <<EOF
779 $ hg record -d '18 0' -mx <<EOF
778 > s
780 > s
779 > a
781 > a
780 > EOF
782 > EOF
781 diff --git a/subdir/f1 b/subdir/f1
783 diff --git a/subdir/f1 b/subdir/f1
782 1 hunks, 1 lines changed
784 1 hunks, 1 lines changed
783 examine changes to 'subdir/f1'? [Ynesfdaq?] s
785 examine changes to 'subdir/f1'? [Ynesfdaq?] s
784
786
785 diff --git a/subdir/f2 b/subdir/f2
787 diff --git a/subdir/f2 b/subdir/f2
786 1 hunks, 1 lines changed
788 1 hunks, 1 lines changed
787 examine changes to 'subdir/f2'? [Ynesfdaq?] a
789 examine changes to 'subdir/f2'? [Ynesfdaq?] a
788
790
789
791
790 $ hg tip -p
792 $ hg tip -p
791 changeset: 20:b3df3dda369a
793 changeset: 20:b3df3dda369a
792 tag: tip
794 tag: tip
793 user: test
795 user: test
794 date: Thu Jan 01 00:00:18 1970 +0000
796 date: Thu Jan 01 00:00:18 1970 +0000
795 summary: x
797 summary: x
796
798
797 diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2
799 diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2
798 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
800 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
799 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
801 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
800 @@ -1,1 +1,2 @@
802 @@ -1,1 +1,2 @@
801 b
803 b
802 +b
804 +b
803
805
804
806
805 f
807 f
806
808
807 $ hg record -d '19 0' -my <<EOF
809 $ hg record -d '19 0' -my <<EOF
808 > f
810 > f
809 > EOF
811 > EOF
810 diff --git a/subdir/f1 b/subdir/f1
812 diff --git a/subdir/f1 b/subdir/f1
811 1 hunks, 1 lines changed
813 1 hunks, 1 lines changed
812 examine changes to 'subdir/f1'? [Ynesfdaq?] f
814 examine changes to 'subdir/f1'? [Ynesfdaq?] f
813
815
814
816
815 $ hg tip -p
817 $ hg tip -p
816 changeset: 21:38ec577f126b
818 changeset: 21:38ec577f126b
817 tag: tip
819 tag: tip
818 user: test
820 user: test
819 date: Thu Jan 01 00:00:19 1970 +0000
821 date: Thu Jan 01 00:00:19 1970 +0000
820 summary: y
822 summary: y
821
823
822 diff -r b3df3dda369a -r 38ec577f126b subdir/f1
824 diff -r b3df3dda369a -r 38ec577f126b subdir/f1
823 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
825 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
824 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
826 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
825 @@ -1,1 +1,2 @@
827 @@ -1,1 +1,2 @@
826 a
828 a
827 +a
829 +a
828
830
829
831
830 #if execbit
832 #if execbit
831
833
832 Preserve chmod +x
834 Preserve chmod +x
833
835
834 $ chmod +x f1
836 $ chmod +x f1
835 $ echo a >> f1
837 $ echo a >> f1
836 $ hg record -d '20 0' -mz <<EOF
838 $ hg record -d '20 0' -mz <<EOF
837 > y
839 > y
838 > y
840 > y
839 > y
841 > y
840 > EOF
842 > EOF
841 diff --git a/subdir/f1 b/subdir/f1
843 diff --git a/subdir/f1 b/subdir/f1
842 old mode 100644
844 old mode 100644
843 new mode 100755
845 new mode 100755
844 1 hunks, 1 lines changed
846 1 hunks, 1 lines changed
845 examine changes to 'subdir/f1'? [Ynesfdaq?] y
847 examine changes to 'subdir/f1'? [Ynesfdaq?] y
846
848
847 @@ -1,2 +1,3 @@
849 @@ -1,2 +1,3 @@
848 a
850 a
849 a
851 a
850 +a
852 +a
851 record this change to 'subdir/f1'? [Ynesfdaq?] y
853 record this change to 'subdir/f1'? [Ynesfdaq?] y
852
854
853
855
854 $ hg tip --config diff.git=True -p
856 $ hg tip --config diff.git=True -p
855 changeset: 22:3261adceb075
857 changeset: 22:3261adceb075
856 tag: tip
858 tag: tip
857 user: test
859 user: test
858 date: Thu Jan 01 00:00:20 1970 +0000
860 date: Thu Jan 01 00:00:20 1970 +0000
859 summary: z
861 summary: z
860
862
861 diff --git a/subdir/f1 b/subdir/f1
863 diff --git a/subdir/f1 b/subdir/f1
862 old mode 100644
864 old mode 100644
863 new mode 100755
865 new mode 100755
864 --- a/subdir/f1
866 --- a/subdir/f1
865 +++ b/subdir/f1
867 +++ b/subdir/f1
866 @@ -1,2 +1,3 @@
868 @@ -1,2 +1,3 @@
867 a
869 a
868 a
870 a
869 +a
871 +a
870
872
871
873
872 Preserve execute permission on original
874 Preserve execute permission on original
873
875
874 $ echo b >> f1
876 $ echo b >> f1
875 $ hg record -d '21 0' -maa <<EOF
877 $ hg record -d '21 0' -maa <<EOF
876 > y
878 > y
877 > y
879 > y
878 > y
880 > y
879 > EOF
881 > EOF
880 diff --git a/subdir/f1 b/subdir/f1
882 diff --git a/subdir/f1 b/subdir/f1
881 1 hunks, 1 lines changed
883 1 hunks, 1 lines changed
882 examine changes to 'subdir/f1'? [Ynesfdaq?] y
884 examine changes to 'subdir/f1'? [Ynesfdaq?] y
883
885
884 @@ -1,3 +1,4 @@
886 @@ -1,3 +1,4 @@
885 a
887 a
886 a
888 a
887 a
889 a
888 +b
890 +b
889 record this change to 'subdir/f1'? [Ynesfdaq?] y
891 record this change to 'subdir/f1'? [Ynesfdaq?] y
890
892
891
893
892 $ hg tip --config diff.git=True -p
894 $ hg tip --config diff.git=True -p
893 changeset: 23:b429867550db
895 changeset: 23:b429867550db
894 tag: tip
896 tag: tip
895 user: test
897 user: test
896 date: Thu Jan 01 00:00:21 1970 +0000
898 date: Thu Jan 01 00:00:21 1970 +0000
897 summary: aa
899 summary: aa
898
900
899 diff --git a/subdir/f1 b/subdir/f1
901 diff --git a/subdir/f1 b/subdir/f1
900 --- a/subdir/f1
902 --- a/subdir/f1
901 +++ b/subdir/f1
903 +++ b/subdir/f1
902 @@ -1,3 +1,4 @@
904 @@ -1,3 +1,4 @@
903 a
905 a
904 a
906 a
905 a
907 a
906 +b
908 +b
907
909
908
910
909 Preserve chmod -x
911 Preserve chmod -x
910
912
911 $ chmod -x f1
913 $ chmod -x f1
912 $ echo c >> f1
914 $ echo c >> f1
913 $ hg record -d '22 0' -mab <<EOF
915 $ hg record -d '22 0' -mab <<EOF
914 > y
916 > y
915 > y
917 > y
916 > y
918 > y
917 > EOF
919 > EOF
918 diff --git a/subdir/f1 b/subdir/f1
920 diff --git a/subdir/f1 b/subdir/f1
919 old mode 100755
921 old mode 100755
920 new mode 100644
922 new mode 100644
921 1 hunks, 1 lines changed
923 1 hunks, 1 lines changed
922 examine changes to 'subdir/f1'? [Ynesfdaq?] y
924 examine changes to 'subdir/f1'? [Ynesfdaq?] y
923
925
924 @@ -2,3 +2,4 @@
926 @@ -2,3 +2,4 @@
925 a
927 a
926 a
928 a
927 b
929 b
928 +c
930 +c
929 record this change to 'subdir/f1'? [Ynesfdaq?] y
931 record this change to 'subdir/f1'? [Ynesfdaq?] y
930
932
931
933
932 $ hg tip --config diff.git=True -p
934 $ hg tip --config diff.git=True -p
933 changeset: 24:0b082130c20a
935 changeset: 24:0b082130c20a
934 tag: tip
936 tag: tip
935 user: test
937 user: test
936 date: Thu Jan 01 00:00:22 1970 +0000
938 date: Thu Jan 01 00:00:22 1970 +0000
937 summary: ab
939 summary: ab
938
940
939 diff --git a/subdir/f1 b/subdir/f1
941 diff --git a/subdir/f1 b/subdir/f1
940 old mode 100755
942 old mode 100755
941 new mode 100644
943 new mode 100644
942 --- a/subdir/f1
944 --- a/subdir/f1
943 +++ b/subdir/f1
945 +++ b/subdir/f1
944 @@ -2,3 +2,4 @@
946 @@ -2,3 +2,4 @@
945 a
947 a
946 a
948 a
947 b
949 b
948 +c
950 +c
949
951
950
952
951 #else
953 #else
952
954
953 Slightly bogus tests to get almost same repo structure as when x bit is used
955 Slightly bogus tests to get almost same repo structure as when x bit is used
954 - but with different hashes.
956 - but with different hashes.
955
957
956 Mock "Preserve chmod +x"
958 Mock "Preserve chmod +x"
957
959
958 $ echo a >> f1
960 $ echo a >> f1
959 $ hg record -d '20 0' -mz <<EOF
961 $ hg record -d '20 0' -mz <<EOF
960 > y
962 > y
961 > y
963 > y
962 > y
964 > y
963 > EOF
965 > EOF
964 diff --git a/subdir/f1 b/subdir/f1
966 diff --git a/subdir/f1 b/subdir/f1
965 1 hunks, 1 lines changed
967 1 hunks, 1 lines changed
966 examine changes to 'subdir/f1'? [Ynesfdaq?] y
968 examine changes to 'subdir/f1'? [Ynesfdaq?] y
967
969
968 @@ -1,2 +1,3 @@
970 @@ -1,2 +1,3 @@
969 a
971 a
970 a
972 a
971 +a
973 +a
972 record this change to 'subdir/f1'? [Ynesfdaq?] y
974 record this change to 'subdir/f1'? [Ynesfdaq?] y
973
975
974
976
975 $ hg tip --config diff.git=True -p
977 $ hg tip --config diff.git=True -p
976 changeset: 22:0d463bd428f5
978 changeset: 22:0d463bd428f5
977 tag: tip
979 tag: tip
978 user: test
980 user: test
979 date: Thu Jan 01 00:00:20 1970 +0000
981 date: Thu Jan 01 00:00:20 1970 +0000
980 summary: z
982 summary: z
981
983
982 diff --git a/subdir/f1 b/subdir/f1
984 diff --git a/subdir/f1 b/subdir/f1
983 --- a/subdir/f1
985 --- a/subdir/f1
984 +++ b/subdir/f1
986 +++ b/subdir/f1
985 @@ -1,2 +1,3 @@
987 @@ -1,2 +1,3 @@
986 a
988 a
987 a
989 a
988 +a
990 +a
989
991
990
992
991 Mock "Preserve execute permission on original"
993 Mock "Preserve execute permission on original"
992
994
993 $ echo b >> f1
995 $ echo b >> f1
994 $ hg record -d '21 0' -maa <<EOF
996 $ hg record -d '21 0' -maa <<EOF
995 > y
997 > y
996 > y
998 > y
997 > y
999 > y
998 > EOF
1000 > EOF
999 diff --git a/subdir/f1 b/subdir/f1
1001 diff --git a/subdir/f1 b/subdir/f1
1000 1 hunks, 1 lines changed
1002 1 hunks, 1 lines changed
1001 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1003 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1002
1004
1003 @@ -1,3 +1,4 @@
1005 @@ -1,3 +1,4 @@
1004 a
1006 a
1005 a
1007 a
1006 a
1008 a
1007 +b
1009 +b
1008 record this change to 'subdir/f1'? [Ynesfdaq?] y
1010 record this change to 'subdir/f1'? [Ynesfdaq?] y
1009
1011
1010
1012
1011 $ hg tip --config diff.git=True -p
1013 $ hg tip --config diff.git=True -p
1012 changeset: 23:0eab41a3e524
1014 changeset: 23:0eab41a3e524
1013 tag: tip
1015 tag: tip
1014 user: test
1016 user: test
1015 date: Thu Jan 01 00:00:21 1970 +0000
1017 date: Thu Jan 01 00:00:21 1970 +0000
1016 summary: aa
1018 summary: aa
1017
1019
1018 diff --git a/subdir/f1 b/subdir/f1
1020 diff --git a/subdir/f1 b/subdir/f1
1019 --- a/subdir/f1
1021 --- a/subdir/f1
1020 +++ b/subdir/f1
1022 +++ b/subdir/f1
1021 @@ -1,3 +1,4 @@
1023 @@ -1,3 +1,4 @@
1022 a
1024 a
1023 a
1025 a
1024 a
1026 a
1025 +b
1027 +b
1026
1028
1027
1029
1028 Mock "Preserve chmod -x"
1030 Mock "Preserve chmod -x"
1029
1031
1030 $ chmod -x f1
1032 $ chmod -x f1
1031 $ echo c >> f1
1033 $ echo c >> f1
1032 $ hg record -d '22 0' -mab <<EOF
1034 $ hg record -d '22 0' -mab <<EOF
1033 > y
1035 > y
1034 > y
1036 > y
1035 > y
1037 > y
1036 > EOF
1038 > EOF
1037 diff --git a/subdir/f1 b/subdir/f1
1039 diff --git a/subdir/f1 b/subdir/f1
1038 1 hunks, 1 lines changed
1040 1 hunks, 1 lines changed
1039 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1041 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1040
1042
1041 @@ -2,3 +2,4 @@
1043 @@ -2,3 +2,4 @@
1042 a
1044 a
1043 a
1045 a
1044 b
1046 b
1045 +c
1047 +c
1046 record this change to 'subdir/f1'? [Ynesfdaq?] y
1048 record this change to 'subdir/f1'? [Ynesfdaq?] y
1047
1049
1048
1050
1049 $ hg tip --config diff.git=True -p
1051 $ hg tip --config diff.git=True -p
1050 changeset: 24:f4f718f27b7c
1052 changeset: 24:f4f718f27b7c
1051 tag: tip
1053 tag: tip
1052 user: test
1054 user: test
1053 date: Thu Jan 01 00:00:22 1970 +0000
1055 date: Thu Jan 01 00:00:22 1970 +0000
1054 summary: ab
1056 summary: ab
1055
1057
1056 diff --git a/subdir/f1 b/subdir/f1
1058 diff --git a/subdir/f1 b/subdir/f1
1057 --- a/subdir/f1
1059 --- a/subdir/f1
1058 +++ b/subdir/f1
1060 +++ b/subdir/f1
1059 @@ -2,3 +2,4 @@
1061 @@ -2,3 +2,4 @@
1060 a
1062 a
1061 a
1063 a
1062 b
1064 b
1063 +c
1065 +c
1064
1066
1065
1067
1066 #endif
1068 #endif
1067
1069
1068 $ cd ..
1070 $ cd ..
1069
1071
1070
1072
1071 Abort early when a merge is in progress
1073 Abort early when a merge is in progress
1072
1074
1073 $ hg up 4
1075 $ hg up 4
1074 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
1076 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
1075
1077
1076 $ touch iwillmergethat
1078 $ touch iwillmergethat
1077 $ hg add iwillmergethat
1079 $ hg add iwillmergethat
1078
1080
1079 $ hg branch thatbranch
1081 $ hg branch thatbranch
1080 marked working directory as branch thatbranch
1082 marked working directory as branch thatbranch
1081 (branches are permanent and global, did you want a bookmark?)
1083 (branches are permanent and global, did you want a bookmark?)
1082
1084
1083 $ hg ci -m'new head'
1085 $ hg ci -m'new head'
1084
1086
1085 $ hg up default
1087 $ hg up default
1086 6 files updated, 0 files merged, 2 files removed, 0 files unresolved
1088 6 files updated, 0 files merged, 2 files removed, 0 files unresolved
1087
1089
1088 $ hg merge thatbranch
1090 $ hg merge thatbranch
1089 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1091 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1090 (branch merge, don't forget to commit)
1092 (branch merge, don't forget to commit)
1091
1093
1092 $ hg record -m'will abort'
1094 $ hg record -m'will abort'
1093 abort: cannot partially commit a merge (use "hg commit" instead)
1095 abort: cannot partially commit a merge (use "hg commit" instead)
1094 [255]
1096 [255]
1095
1097
1096 $ hg up -C
1098 $ hg up -C
1097 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1099 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1098
1100
1099 Editing patch (and ignoring trailing text)
1101 Editing patch (and ignoring trailing text)
1100
1102
1101 $ cat > editor.sh << '__EOF__'
1103 $ cat > editor.sh << '__EOF__'
1102 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
1104 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
1103 > trailing\nditto' "$1" > tmp
1105 > trailing\nditto' "$1" > tmp
1104 > mv tmp "$1"
1106 > mv tmp "$1"
1105 > __EOF__
1107 > __EOF__
1106 $ cat > editedfile << '__EOF__'
1108 $ cat > editedfile << '__EOF__'
1107 > This is the first line
1109 > This is the first line
1108 > This is the second line
1110 > This is the second line
1109 > This is the third line
1111 > This is the third line
1110 > __EOF__
1112 > __EOF__
1111 $ hg add editedfile
1113 $ hg add editedfile
1112 $ hg commit -medit-patch-1
1114 $ hg commit -medit-patch-1
1113 $ cat > editedfile << '__EOF__'
1115 $ cat > editedfile << '__EOF__'
1114 > This line has changed
1116 > This line has changed
1115 > This change will be committed
1117 > This change will be committed
1116 > This is the third line
1118 > This is the third line
1117 > __EOF__
1119 > __EOF__
1118 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record -d '23 0' -medit-patch-2 <<EOF
1120 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record -d '23 0' -medit-patch-2 <<EOF
1119 > y
1121 > y
1120 > e
1122 > e
1121 > EOF
1123 > EOF
1122 diff --git a/editedfile b/editedfile
1124 diff --git a/editedfile b/editedfile
1123 1 hunks, 2 lines changed
1125 1 hunks, 2 lines changed
1124 examine changes to 'editedfile'? [Ynesfdaq?] y
1126 examine changes to 'editedfile'? [Ynesfdaq?] y
1125
1127
1126 @@ -1,3 +1,3 @@
1128 @@ -1,3 +1,3 @@
1127 -This is the first line
1129 -This is the first line
1128 -This is the second line
1130 -This is the second line
1129 +This line has changed
1131 +This line has changed
1130 +This change will be committed
1132 +This change will be committed
1131 This is the third line
1133 This is the third line
1132 record this change to 'editedfile'? [Ynesfdaq?] e
1134 record this change to 'editedfile'? [Ynesfdaq?] e
1133
1135
1134 $ cat editedfile
1136 $ cat editedfile
1135 This line has changed
1137 This line has changed
1136 This change will be committed
1138 This change will be committed
1137 This is the third line
1139 This is the third line
1138 $ hg cat -r tip editedfile
1140 $ hg cat -r tip editedfile
1139 This is the first line
1141 This is the first line
1140 This change will be committed
1142 This change will be committed
1141 This is the third line
1143 This is the third line
1142 $ hg revert editedfile
1144 $ hg revert editedfile
1143
1145
1144 Trying to edit patch for whole file
1146 Trying to edit patch for whole file
1145
1147
1146 $ echo "This is the fourth line" >> editedfile
1148 $ echo "This is the fourth line" >> editedfile
1147 $ hg record <<EOF
1149 $ hg record <<EOF
1148 > e
1150 > e
1149 > q
1151 > q
1150 > EOF
1152 > EOF
1151 diff --git a/editedfile b/editedfile
1153 diff --git a/editedfile b/editedfile
1152 1 hunks, 1 lines changed
1154 1 hunks, 1 lines changed
1153 examine changes to 'editedfile'? [Ynesfdaq?] e
1155 examine changes to 'editedfile'? [Ynesfdaq?] e
1154
1156
1155 cannot edit patch for whole file
1157 cannot edit patch for whole file
1156 examine changes to 'editedfile'? [Ynesfdaq?] q
1158 examine changes to 'editedfile'? [Ynesfdaq?] q
1157
1159
1158 abort: user quit
1160 abort: user quit
1159 [255]
1161 [255]
1160 $ hg revert editedfile
1162 $ hg revert editedfile
1161
1163
1162 Removing changes from patch
1164 Removing changes from patch
1163
1165
1164 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1166 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1165 $ mv tmp editedfile
1167 $ mv tmp editedfile
1166 $ echo "This line has been added" >> editedfile
1168 $ echo "This line has been added" >> editedfile
1167 $ cat > editor.sh << '__EOF__'
1169 $ cat > editor.sh << '__EOF__'
1168 > sed -e 's/^[-+]/ /' "$1" > tmp
1170 > sed -e 's/^[-+]/ /' "$1" > tmp
1169 > mv tmp "$1"
1171 > mv tmp "$1"
1170 > __EOF__
1172 > __EOF__
1171 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1173 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1172 > y
1174 > y
1173 > e
1175 > e
1174 > EOF
1176 > EOF
1175 diff --git a/editedfile b/editedfile
1177 diff --git a/editedfile b/editedfile
1176 1 hunks, 3 lines changed
1178 1 hunks, 3 lines changed
1177 examine changes to 'editedfile'? [Ynesfdaq?] y
1179 examine changes to 'editedfile'? [Ynesfdaq?] y
1178
1180
1179 @@ -1,3 +1,3 @@
1181 @@ -1,3 +1,3 @@
1180 -This is the first line
1182 -This is the first line
1181 -This change will be committed
1183 -This change will be committed
1182 -This is the third line
1184 -This is the third line
1183 +This change will not be committed
1185 +This change will not be committed
1184 +This is the second line
1186 +This is the second line
1185 +This line has been added
1187 +This line has been added
1186 record this change to 'editedfile'? [Ynesfdaq?] e
1188 record this change to 'editedfile'? [Ynesfdaq?] e
1187
1189
1188 no changes to record
1190 no changes to record
1189 $ cat editedfile
1191 $ cat editedfile
1190 This change will not be committed
1192 This change will not be committed
1191 This is the second line
1193 This is the second line
1192 This line has been added
1194 This line has been added
1193 $ hg cat -r tip editedfile
1195 $ hg cat -r tip editedfile
1194 This is the first line
1196 This is the first line
1195 This change will be committed
1197 This change will be committed
1196 This is the third line
1198 This is the third line
1197 $ hg revert editedfile
1199 $ hg revert editedfile
1198
1200
1199 Invalid patch
1201 Invalid patch
1200
1202
1201 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1203 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1202 $ mv tmp editedfile
1204 $ mv tmp editedfile
1203 $ echo "This line has been added" >> editedfile
1205 $ echo "This line has been added" >> editedfile
1204 $ cat > editor.sh << '__EOF__'
1206 $ cat > editor.sh << '__EOF__'
1205 > sed s/This/That/ "$1" > tmp
1207 > sed s/This/That/ "$1" > tmp
1206 > mv tmp "$1"
1208 > mv tmp "$1"
1207 > __EOF__
1209 > __EOF__
1208 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1210 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1209 > y
1211 > y
1210 > e
1212 > e
1211 > EOF
1213 > EOF
1212 diff --git a/editedfile b/editedfile
1214 diff --git a/editedfile b/editedfile
1213 1 hunks, 3 lines changed
1215 1 hunks, 3 lines changed
1214 examine changes to 'editedfile'? [Ynesfdaq?] y
1216 examine changes to 'editedfile'? [Ynesfdaq?] y
1215
1217
1216 @@ -1,3 +1,3 @@
1218 @@ -1,3 +1,3 @@
1217 -This is the first line
1219 -This is the first line
1218 -This change will be committed
1220 -This change will be committed
1219 -This is the third line
1221 -This is the third line
1220 +This change will not be committed
1222 +This change will not be committed
1221 +This is the second line
1223 +This is the second line
1222 +This line has been added
1224 +This line has been added
1223 record this change to 'editedfile'? [Ynesfdaq?] e
1225 record this change to 'editedfile'? [Ynesfdaq?] e
1224
1226
1225 patching file editedfile
1227 patching file editedfile
1226 Hunk #1 FAILED at 0
1228 Hunk #1 FAILED at 0
1227 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
1229 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
1228 abort: patch failed to apply
1230 abort: patch failed to apply
1229 [255]
1231 [255]
1230 $ cat editedfile
1232 $ cat editedfile
1231 This change will not be committed
1233 This change will not be committed
1232 This is the second line
1234 This is the second line
1233 This line has been added
1235 This line has been added
1234 $ hg cat -r tip editedfile
1236 $ hg cat -r tip editedfile
1235 This is the first line
1237 This is the first line
1236 This change will be committed
1238 This change will be committed
1237 This is the third line
1239 This is the third line
1238 $ cat editedfile.rej
1240 $ cat editedfile.rej
1239 --- editedfile
1241 --- editedfile
1240 +++ editedfile
1242 +++ editedfile
1241 @@ -1,3 +1,3 @@
1243 @@ -1,3 +1,3 @@
1242 -That is the first line
1244 -That is the first line
1243 -That change will be committed
1245 -That change will be committed
1244 -That is the third line
1246 -That is the third line
1245 +That change will not be committed
1247 +That change will not be committed
1246 +That is the second line
1248 +That is the second line
1247 +That line has been added
1249 +That line has been added
1248
1250
1249 Malformed patch - error handling
1251 Malformed patch - error handling
1250
1252
1251 $ cat > editor.sh << '__EOF__'
1253 $ cat > editor.sh << '__EOF__'
1252 > sed -e '/^@/p' "$1" > tmp
1254 > sed -e '/^@/p' "$1" > tmp
1253 > mv tmp "$1"
1255 > mv tmp "$1"
1254 > __EOF__
1256 > __EOF__
1255 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1257 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1256 > y
1258 > y
1257 > e
1259 > e
1258 > EOF
1260 > EOF
1259 diff --git a/editedfile b/editedfile
1261 diff --git a/editedfile b/editedfile
1260 1 hunks, 3 lines changed
1262 1 hunks, 3 lines changed
1261 examine changes to 'editedfile'? [Ynesfdaq?] y
1263 examine changes to 'editedfile'? [Ynesfdaq?] y
1262
1264
1263 @@ -1,3 +1,3 @@
1265 @@ -1,3 +1,3 @@
1264 -This is the first line
1266 -This is the first line
1265 -This change will be committed
1267 -This change will be committed
1266 -This is the third line
1268 -This is the third line
1267 +This change will not be committed
1269 +This change will not be committed
1268 +This is the second line
1270 +This is the second line
1269 +This line has been added
1271 +This line has been added
1270 record this change to 'editedfile'? [Ynesfdaq?] e
1272 record this change to 'editedfile'? [Ynesfdaq?] e
1271
1273
1272 abort: error parsing patch: unhandled transition: range -> range
1274 abort: error parsing patch: unhandled transition: range -> range
1273 [255]
1275 [255]
1274
1276
1275 random text in random positions is still an error
1277 random text in random positions is still an error
1276
1278
1277 $ cat > editor.sh << '__EOF__'
1279 $ cat > editor.sh << '__EOF__'
1278 > sed -e '/^@/i\
1280 > sed -e '/^@/i\
1279 > other' "$1" > tmp
1281 > other' "$1" > tmp
1280 > mv tmp "$1"
1282 > mv tmp "$1"
1281 > __EOF__
1283 > __EOF__
1282 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1284 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1283 > y
1285 > y
1284 > e
1286 > e
1285 > EOF
1287 > EOF
1286 diff --git a/editedfile b/editedfile
1288 diff --git a/editedfile b/editedfile
1287 1 hunks, 3 lines changed
1289 1 hunks, 3 lines changed
1288 examine changes to 'editedfile'? [Ynesfdaq?] y
1290 examine changes to 'editedfile'? [Ynesfdaq?] y
1289
1291
1290 @@ -1,3 +1,3 @@
1292 @@ -1,3 +1,3 @@
1291 -This is the first line
1293 -This is the first line
1292 -This change will be committed
1294 -This change will be committed
1293 -This is the third line
1295 -This is the third line
1294 +This change will not be committed
1296 +This change will not be committed
1295 +This is the second line
1297 +This is the second line
1296 +This line has been added
1298 +This line has been added
1297 record this change to 'editedfile'? [Ynesfdaq?] e
1299 record this change to 'editedfile'? [Ynesfdaq?] e
1298
1300
1299 abort: error parsing patch: unhandled transition: file -> other
1301 abort: error parsing patch: unhandled transition: file -> other
1300 [255]
1302 [255]
1301
1303
1302 $ hg up -C
1304 $ hg up -C
1303 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1305 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1304
1306
1305 With win32text
1307 With win32text
1306
1308
1307 $ echo '[extensions]' >> .hg/hgrc
1309 $ echo '[extensions]' >> .hg/hgrc
1308 $ echo 'win32text = ' >> .hg/hgrc
1310 $ echo 'win32text = ' >> .hg/hgrc
1309 $ echo '[decode]' >> .hg/hgrc
1311 $ echo '[decode]' >> .hg/hgrc
1310 $ echo '** = cleverdecode:' >> .hg/hgrc
1312 $ echo '** = cleverdecode:' >> .hg/hgrc
1311 $ echo '[encode]' >> .hg/hgrc
1313 $ echo '[encode]' >> .hg/hgrc
1312 $ echo '** = cleverencode:' >> .hg/hgrc
1314 $ echo '** = cleverencode:' >> .hg/hgrc
1313 $ echo '[patch]' >> .hg/hgrc
1315 $ echo '[patch]' >> .hg/hgrc
1314 $ echo 'eol = crlf' >> .hg/hgrc
1316 $ echo 'eol = crlf' >> .hg/hgrc
1315
1317
1316 Ignore win32text deprecation warning for now:
1318 Ignore win32text deprecation warning for now:
1317
1319
1318 $ echo '[win32text]' >> .hg/hgrc
1320 $ echo '[win32text]' >> .hg/hgrc
1319 $ echo 'warn = no' >> .hg/hgrc
1321 $ echo 'warn = no' >> .hg/hgrc
1320
1322
1321 $ echo d >> subdir/f1
1323 $ echo d >> subdir/f1
1322 $ hg record -d '24 0' -mw1 <<EOF
1324 $ hg record -d '24 0' -mw1 <<EOF
1323 > y
1325 > y
1324 > y
1326 > y
1325 > EOF
1327 > EOF
1326 diff --git a/subdir/f1 b/subdir/f1
1328 diff --git a/subdir/f1 b/subdir/f1
1327 1 hunks, 1 lines changed
1329 1 hunks, 1 lines changed
1328 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1330 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1329
1331
1330 @@ -3,3 +3,4 @@
1332 @@ -3,3 +3,4 @@
1331 a
1333 a
1332 b
1334 b
1333 c
1335 c
1334 +d
1336 +d
1335 record this change to 'subdir/f1'? [Ynesfdaq?] y
1337 record this change to 'subdir/f1'? [Ynesfdaq?] y
1336
1338
1337
1339
1338 $ hg tip -p
1340 $ hg tip -p
1339 changeset: 28:* (glob)
1341 changeset: 28:* (glob)
1340 tag: tip
1342 tag: tip
1341 user: test
1343 user: test
1342 date: Thu Jan 01 00:00:24 1970 +0000
1344 date: Thu Jan 01 00:00:24 1970 +0000
1343 summary: w1
1345 summary: w1
1344
1346
1345 diff -r ???????????? -r ???????????? subdir/f1 (glob)
1347 diff -r ???????????? -r ???????????? subdir/f1 (glob)
1346 --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
1348 --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
1347 +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
1349 +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
1348 @@ -3,3 +3,4 @@
1350 @@ -3,3 +3,4 @@
1349 a
1351 a
1350 b
1352 b
1351 c
1353 c
1352 +d
1354 +d
1353
1355
1354 Test --user when ui.username not set
1356 Test --user when ui.username not set
1355 $ unset HGUSER
1357 $ unset HGUSER
1356 $ echo e >> subdir/f1
1358 $ echo e >> subdir/f1
1357 $ hg record --config ui.username= -d '8 0' --user xyz -m "user flag" <<EOF
1359 $ hg record --config ui.username= -d '8 0' --user xyz -m "user flag" <<EOF
1358 > y
1360 > y
1359 > y
1361 > y
1360 > EOF
1362 > EOF
1361 diff --git a/subdir/f1 b/subdir/f1
1363 diff --git a/subdir/f1 b/subdir/f1
1362 1 hunks, 1 lines changed
1364 1 hunks, 1 lines changed
1363 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1365 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1364
1366
1365 @@ -4,3 +4,4 @@
1367 @@ -4,3 +4,4 @@
1366 b
1368 b
1367 c
1369 c
1368 d
1370 d
1369 +e
1371 +e
1370 record this change to 'subdir/f1'? [Ynesfdaq?] y
1372 record this change to 'subdir/f1'? [Ynesfdaq?] y
1371
1373
1372 $ hg log --template '{author}\n' -l 1
1374 $ hg log --template '{author}\n' -l 1
1373 xyz
1375 xyz
1374 $ HGUSER="test"
1376 $ HGUSER="test"
1375 $ export HGUSER
1377 $ export HGUSER
1376
1378
1377 $ cd ..
1379 $ cd ..
@@ -1,732 +1,734 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
2 > [extensions]
3 $ echo "shelve=" >> $HGRCPATH
3 > mq =
4 $ echo "[defaults]" >> $HGRCPATH
4 > shelve =
5 $ echo "diff = --nodates --git" >> $HGRCPATH
5 > [defaults]
6 $ echo "qnew = --date '0 0'" >> $HGRCPATH
6 > diff = --nodates --git
7 > qnew = --date '0 0'
8 > EOF
7
9
8 $ hg init repo
10 $ hg init repo
9 $ cd repo
11 $ cd repo
10 $ mkdir a b
12 $ mkdir a b
11 $ echo a > a/a
13 $ echo a > a/a
12 $ echo b > b/b
14 $ echo b > b/b
13 $ echo c > c
15 $ echo c > c
14 $ echo d > d
16 $ echo d > d
15 $ echo x > x
17 $ echo x > x
16 $ hg addremove -q
18 $ hg addremove -q
17
19
18 shelving in an empty repo should be possible
20 shelving in an empty repo should be possible
19 (this tests also that editor is not invoked, if '--edit' is not
21 (this tests also that editor is not invoked, if '--edit' is not
20 specified)
22 specified)
21
23
22 $ HGEDITOR=cat hg shelve
24 $ HGEDITOR=cat hg shelve
23 shelved as default
25 shelved as default
24 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
26 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
25
27
26 $ hg unshelve
28 $ hg unshelve
27 unshelving change 'default'
29 unshelving change 'default'
28
30
29 $ hg commit -q -m 'initial commit'
31 $ hg commit -q -m 'initial commit'
30
32
31 $ hg shelve
33 $ hg shelve
32 nothing changed
34 nothing changed
33 [1]
35 [1]
34
36
35 create an mq patch - shelving should work fine with a patch applied
37 create an mq patch - shelving should work fine with a patch applied
36
38
37 $ echo n > n
39 $ echo n > n
38 $ hg add n
40 $ hg add n
39 $ hg commit n -m second
41 $ hg commit n -m second
40 $ hg qnew second.patch
42 $ hg qnew second.patch
41
43
42 shelve a change that we will delete later
44 shelve a change that we will delete later
43
45
44 $ echo a >> a/a
46 $ echo a >> a/a
45 $ hg shelve
47 $ hg shelve
46 shelved as default
48 shelved as default
47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48
50
49 set up some more complex changes to shelve
51 set up some more complex changes to shelve
50
52
51 $ echo a >> a/a
53 $ echo a >> a/a
52 $ hg mv b b.rename
54 $ hg mv b b.rename
53 moving b/b to b.rename/b (glob)
55 moving b/b to b.rename/b (glob)
54 $ hg cp c c.copy
56 $ hg cp c c.copy
55 $ hg status -C
57 $ hg status -C
56 M a/a
58 M a/a
57 A b.rename/b
59 A b.rename/b
58 b/b
60 b/b
59 A c.copy
61 A c.copy
60 c
62 c
61 R b/b
63 R b/b
62
64
63 prevent some foot-shooting
65 prevent some foot-shooting
64
66
65 $ hg shelve -n foo/bar
67 $ hg shelve -n foo/bar
66 abort: shelved change names may not contain slashes
68 abort: shelved change names may not contain slashes
67 [255]
69 [255]
68 $ hg shelve -n .baz
70 $ hg shelve -n .baz
69 abort: shelved change names may not start with '.'
71 abort: shelved change names may not start with '.'
70 [255]
72 [255]
71
73
72 the common case - no options or filenames
74 the common case - no options or filenames
73
75
74 $ hg shelve
76 $ hg shelve
75 shelved as default-01
77 shelved as default-01
76 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
78 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
77 $ hg status -C
79 $ hg status -C
78
80
79 ensure that our shelved changes exist
81 ensure that our shelved changes exist
80
82
81 $ hg shelve -l
83 $ hg shelve -l
82 default-01 (*) changes to '[mq]: second.patch' (glob)
84 default-01 (*) changes to '[mq]: second.patch' (glob)
83 default (*) changes to '[mq]: second.patch' (glob)
85 default (*) changes to '[mq]: second.patch' (glob)
84
86
85 $ hg shelve -l -p default
87 $ hg shelve -l -p default
86 default (*) changes to '[mq]: second.patch' (glob)
88 default (*) changes to '[mq]: second.patch' (glob)
87
89
88 diff --git a/a/a b/a/a
90 diff --git a/a/a b/a/a
89 --- a/a/a
91 --- a/a/a
90 +++ b/a/a
92 +++ b/a/a
91 @@ -1,1 +1,2 @@
93 @@ -1,1 +1,2 @@
92 a
94 a
93 +a
95 +a
94
96
95 $ hg shelve --list --addremove
97 $ hg shelve --list --addremove
96 abort: options '--list' and '--addremove' may not be used together
98 abort: options '--list' and '--addremove' may not be used together
97 [255]
99 [255]
98
100
99 delete our older shelved change
101 delete our older shelved change
100
102
101 $ hg shelve -d default
103 $ hg shelve -d default
102 $ hg qfinish -a -q
104 $ hg qfinish -a -q
103
105
104 local edits should not prevent a shelved change from applying
106 local edits should not prevent a shelved change from applying
105
107
106 $ printf "z\na\n" > a/a
108 $ printf "z\na\n" > a/a
107 $ hg unshelve --keep
109 $ hg unshelve --keep
108 unshelving change 'default-01'
110 unshelving change 'default-01'
109 temporarily committing pending changes (restore with 'hg unshelve --abort')
111 temporarily committing pending changes (restore with 'hg unshelve --abort')
110 rebasing shelved changes
112 rebasing shelved changes
111 merging a/a
113 merging a/a
112
114
113 $ hg revert --all -q
115 $ hg revert --all -q
114 $ rm a/a.orig b.rename/b c.copy
116 $ rm a/a.orig b.rename/b c.copy
115
117
116 apply it and make sure our state is as expected
118 apply it and make sure our state is as expected
117
119
118 $ hg unshelve
120 $ hg unshelve
119 unshelving change 'default-01'
121 unshelving change 'default-01'
120 $ hg status -C
122 $ hg status -C
121 M a/a
123 M a/a
122 A b.rename/b
124 A b.rename/b
123 b/b
125 b/b
124 A c.copy
126 A c.copy
125 c
127 c
126 R b/b
128 R b/b
127 $ hg shelve -l
129 $ hg shelve -l
128
130
129 $ hg unshelve
131 $ hg unshelve
130 abort: no shelved changes to apply!
132 abort: no shelved changes to apply!
131 [255]
133 [255]
132 $ hg unshelve foo
134 $ hg unshelve foo
133 abort: shelved change 'foo' not found
135 abort: shelved change 'foo' not found
134 [255]
136 [255]
135
137
136 named shelves, specific filenames, and "commit messages" should all work
138 named shelves, specific filenames, and "commit messages" should all work
137 (this tests also that editor is invoked, if '--edit' is specified)
139 (this tests also that editor is invoked, if '--edit' is specified)
138
140
139 $ hg status -C
141 $ hg status -C
140 M a/a
142 M a/a
141 A b.rename/b
143 A b.rename/b
142 b/b
144 b/b
143 A c.copy
145 A c.copy
144 c
146 c
145 R b/b
147 R b/b
146 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
148 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
147 wat
149 wat
148
150
149
151
150 HG: Enter commit message. Lines beginning with 'HG:' are removed.
152 HG: Enter commit message. Lines beginning with 'HG:' are removed.
151 HG: Leave message empty to abort commit.
153 HG: Leave message empty to abort commit.
152 HG: --
154 HG: --
153 HG: user: shelve@localhost
155 HG: user: shelve@localhost
154 HG: branch 'default'
156 HG: branch 'default'
155 HG: changed a/a
157 HG: changed a/a
156
158
157 expect "a" to no longer be present, but status otherwise unchanged
159 expect "a" to no longer be present, but status otherwise unchanged
158
160
159 $ hg status -C
161 $ hg status -C
160 A b.rename/b
162 A b.rename/b
161 b/b
163 b/b
162 A c.copy
164 A c.copy
163 c
165 c
164 R b/b
166 R b/b
165 $ hg shelve -l --stat
167 $ hg shelve -l --stat
166 wibble (*) wat (glob)
168 wibble (*) wat (glob)
167 a/a | 1 +
169 a/a | 1 +
168 1 files changed, 1 insertions(+), 0 deletions(-)
170 1 files changed, 1 insertions(+), 0 deletions(-)
169
171
170 and now "a/a" should reappear
172 and now "a/a" should reappear
171
173
172 $ cd a
174 $ cd a
173 $ hg unshelve -q wibble
175 $ hg unshelve -q wibble
174 $ cd ..
176 $ cd ..
175 $ hg status -C
177 $ hg status -C
176 M a/a
178 M a/a
177 A b.rename/b
179 A b.rename/b
178 b/b
180 b/b
179 A c.copy
181 A c.copy
180 c
182 c
181 R b/b
183 R b/b
182
184
183 cause unshelving to result in a merge with 'a' conflicting
185 cause unshelving to result in a merge with 'a' conflicting
184
186
185 $ hg shelve -q
187 $ hg shelve -q
186 $ echo c>>a/a
188 $ echo c>>a/a
187 $ hg commit -m second
189 $ hg commit -m second
188 $ hg tip --template '{files}\n'
190 $ hg tip --template '{files}\n'
189 a/a
191 a/a
190
192
191 add an unrelated change that should be preserved
193 add an unrelated change that should be preserved
192
194
193 $ mkdir foo
195 $ mkdir foo
194 $ echo foo > foo/foo
196 $ echo foo > foo/foo
195 $ hg add foo/foo
197 $ hg add foo/foo
196
198
197 force a conflicted merge to occur
199 force a conflicted merge to occur
198
200
199 $ hg unshelve
201 $ hg unshelve
200 unshelving change 'default'
202 unshelving change 'default'
201 temporarily committing pending changes (restore with 'hg unshelve --abort')
203 temporarily committing pending changes (restore with 'hg unshelve --abort')
202 rebasing shelved changes
204 rebasing shelved changes
203 merging a/a
205 merging a/a
204 warning: conflicts during merge.
206 warning: conflicts during merge.
205 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
207 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
206 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
208 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
207 [1]
209 [1]
208
210
209 ensure that we have a merge with unresolved conflicts
211 ensure that we have a merge with unresolved conflicts
210
212
211 $ hg heads -q --template '{rev}\n'
213 $ hg heads -q --template '{rev}\n'
212 5
214 5
213 4
215 4
214 $ hg parents -q --template '{rev}\n'
216 $ hg parents -q --template '{rev}\n'
215 4
217 4
216 5
218 5
217 $ hg status
219 $ hg status
218 M a/a
220 M a/a
219 M b.rename/b
221 M b.rename/b
220 M c.copy
222 M c.copy
221 R b/b
223 R b/b
222 ? a/a.orig
224 ? a/a.orig
223 $ hg diff
225 $ hg diff
224 diff --git a/a/a b/a/a
226 diff --git a/a/a b/a/a
225 --- a/a/a
227 --- a/a/a
226 +++ b/a/a
228 +++ b/a/a
227 @@ -1,2 +1,6 @@
229 @@ -1,2 +1,6 @@
228 a
230 a
229 +<<<<<<< dest: * - shelve: pending changes temporary commit (glob)
231 +<<<<<<< dest: * - shelve: pending changes temporary commit (glob)
230 c
232 c
231 +=======
233 +=======
232 +a
234 +a
233 +>>>>>>> source: 4702e8911fe0 - shelve: changes to '[mq]: second.patch'
235 +>>>>>>> source: 4702e8911fe0 - shelve: changes to '[mq]: second.patch'
234 diff --git a/b/b b/b.rename/b
236 diff --git a/b/b b/b.rename/b
235 rename from b/b
237 rename from b/b
236 rename to b.rename/b
238 rename to b.rename/b
237 diff --git a/b/b b/b/b
239 diff --git a/b/b b/b/b
238 deleted file mode 100644
240 deleted file mode 100644
239 --- a/b/b
241 --- a/b/b
240 +++ /dev/null
242 +++ /dev/null
241 @@ -1,1 +0,0 @@
243 @@ -1,1 +0,0 @@
242 -b
244 -b
243 diff --git a/c b/c.copy
245 diff --git a/c b/c.copy
244 copy from c
246 copy from c
245 copy to c.copy
247 copy to c.copy
246 $ hg resolve -l
248 $ hg resolve -l
247 U a/a
249 U a/a
248
250
249 $ hg shelve
251 $ hg shelve
250 abort: unshelve already in progress
252 abort: unshelve already in progress
251 (use 'hg unshelve --continue' or 'hg unshelve --abort')
253 (use 'hg unshelve --continue' or 'hg unshelve --abort')
252 [255]
254 [255]
253
255
254 abort the unshelve and be happy
256 abort the unshelve and be happy
255
257
256 $ hg status
258 $ hg status
257 M a/a
259 M a/a
258 M b.rename/b
260 M b.rename/b
259 M c.copy
261 M c.copy
260 R b/b
262 R b/b
261 ? a/a.orig
263 ? a/a.orig
262 $ hg unshelve -a
264 $ hg unshelve -a
263 rebase aborted
265 rebase aborted
264 unshelve of 'default' aborted
266 unshelve of 'default' aborted
265 $ hg heads -q
267 $ hg heads -q
266 3:2e69b451d1ea
268 3:2e69b451d1ea
267 $ hg parents
269 $ hg parents
268 changeset: 3:2e69b451d1ea
270 changeset: 3:2e69b451d1ea
269 tag: tip
271 tag: tip
270 user: test
272 user: test
271 date: Thu Jan 01 00:00:00 1970 +0000
273 date: Thu Jan 01 00:00:00 1970 +0000
272 summary: second
274 summary: second
273
275
274 $ hg resolve -l
276 $ hg resolve -l
275 $ hg status
277 $ hg status
276 A foo/foo
278 A foo/foo
277 ? a/a.orig
279 ? a/a.orig
278
280
279 try to continue with no unshelve underway
281 try to continue with no unshelve underway
280
282
281 $ hg unshelve -c
283 $ hg unshelve -c
282 abort: no unshelve operation underway
284 abort: no unshelve operation underway
283 [255]
285 [255]
284 $ hg status
286 $ hg status
285 A foo/foo
287 A foo/foo
286 ? a/a.orig
288 ? a/a.orig
287
289
288 redo the unshelve to get a conflict
290 redo the unshelve to get a conflict
289
291
290 $ hg unshelve -q
292 $ hg unshelve -q
291 warning: conflicts during merge.
293 warning: conflicts during merge.
292 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
294 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
293 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
295 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
294 [1]
296 [1]
295
297
296 attempt to continue
298 attempt to continue
297
299
298 $ hg unshelve -c
300 $ hg unshelve -c
299 abort: unresolved conflicts, can't continue
301 abort: unresolved conflicts, can't continue
300 (see 'hg resolve', then 'hg unshelve --continue')
302 (see 'hg resolve', then 'hg unshelve --continue')
301 [255]
303 [255]
302
304
303 $ hg revert -r . a/a
305 $ hg revert -r . a/a
304 $ hg resolve -m a/a
306 $ hg resolve -m a/a
305 (no more unresolved files)
307 (no more unresolved files)
306
308
307 $ hg commit -m 'commit while unshelve in progress'
309 $ hg commit -m 'commit while unshelve in progress'
308 abort: unshelve already in progress
310 abort: unshelve already in progress
309 (use 'hg unshelve --continue' or 'hg unshelve --abort')
311 (use 'hg unshelve --continue' or 'hg unshelve --abort')
310 [255]
312 [255]
311
313
312 $ hg unshelve -c
314 $ hg unshelve -c
313 unshelve of 'default' complete
315 unshelve of 'default' complete
314
316
315 ensure the repo is as we hope
317 ensure the repo is as we hope
316
318
317 $ hg parents
319 $ hg parents
318 changeset: 3:2e69b451d1ea
320 changeset: 3:2e69b451d1ea
319 tag: tip
321 tag: tip
320 user: test
322 user: test
321 date: Thu Jan 01 00:00:00 1970 +0000
323 date: Thu Jan 01 00:00:00 1970 +0000
322 summary: second
324 summary: second
323
325
324 $ hg heads -q
326 $ hg heads -q
325 3:2e69b451d1ea
327 3:2e69b451d1ea
326
328
327 $ hg status -C
329 $ hg status -C
328 A b.rename/b
330 A b.rename/b
329 b/b
331 b/b
330 A c.copy
332 A c.copy
331 c
333 c
332 A foo/foo
334 A foo/foo
333 R b/b
335 R b/b
334 ? a/a.orig
336 ? a/a.orig
335
337
336 there should be no shelves left
338 there should be no shelves left
337
339
338 $ hg shelve -l
340 $ hg shelve -l
339
341
340 #if execbit
342 #if execbit
341
343
342 ensure that metadata-only changes are shelved
344 ensure that metadata-only changes are shelved
343
345
344 $ chmod +x a/a
346 $ chmod +x a/a
345 $ hg shelve -q -n execbit a/a
347 $ hg shelve -q -n execbit a/a
346 $ hg status a/a
348 $ hg status a/a
347 $ hg unshelve -q execbit
349 $ hg unshelve -q execbit
348 $ hg status a/a
350 $ hg status a/a
349 M a/a
351 M a/a
350 $ hg revert a/a
352 $ hg revert a/a
351
353
352 #endif
354 #endif
353
355
354 #if symlink
356 #if symlink
355
357
356 $ rm a/a
358 $ rm a/a
357 $ ln -s foo a/a
359 $ ln -s foo a/a
358 $ hg shelve -q -n symlink a/a
360 $ hg shelve -q -n symlink a/a
359 $ hg status a/a
361 $ hg status a/a
360 $ hg unshelve -q symlink
362 $ hg unshelve -q symlink
361 $ hg status a/a
363 $ hg status a/a
362 M a/a
364 M a/a
363 $ hg revert a/a
365 $ hg revert a/a
364
366
365 #endif
367 #endif
366
368
367 set up another conflict between a commit and a shelved change
369 set up another conflict between a commit and a shelved change
368
370
369 $ hg revert -q -C -a
371 $ hg revert -q -C -a
370 $ rm a/a.orig b.rename/b c.copy
372 $ rm a/a.orig b.rename/b c.copy
371 $ echo a >> a/a
373 $ echo a >> a/a
372 $ hg shelve -q
374 $ hg shelve -q
373 $ echo x >> a/a
375 $ echo x >> a/a
374 $ hg ci -m 'create conflict'
376 $ hg ci -m 'create conflict'
375 $ hg add foo/foo
377 $ hg add foo/foo
376
378
377 if we resolve a conflict while unshelving, the unshelve should succeed
379 if we resolve a conflict while unshelving, the unshelve should succeed
378
380
379 $ HGMERGE=true hg unshelve
381 $ HGMERGE=true hg unshelve
380 unshelving change 'default'
382 unshelving change 'default'
381 temporarily committing pending changes (restore with 'hg unshelve --abort')
383 temporarily committing pending changes (restore with 'hg unshelve --abort')
382 rebasing shelved changes
384 rebasing shelved changes
383 merging a/a
385 merging a/a
384 $ hg parents -q
386 $ hg parents -q
385 4:33f7f61e6c5e
387 4:33f7f61e6c5e
386 $ hg shelve -l
388 $ hg shelve -l
387 $ hg status
389 $ hg status
388 A foo/foo
390 A foo/foo
389 $ cat a/a
391 $ cat a/a
390 a
392 a
391 c
393 c
392 x
394 x
393
395
394 test keep and cleanup
396 test keep and cleanup
395
397
396 $ hg shelve
398 $ hg shelve
397 shelved as default
399 shelved as default
398 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
400 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
399 $ hg shelve --list
401 $ hg shelve --list
400 default (*) changes to 'create conflict' (glob)
402 default (*) changes to 'create conflict' (glob)
401 $ hg unshelve --keep
403 $ hg unshelve --keep
402 unshelving change 'default'
404 unshelving change 'default'
403 $ hg shelve --list
405 $ hg shelve --list
404 default (*) changes to 'create conflict' (glob)
406 default (*) changes to 'create conflict' (glob)
405 $ hg shelve --cleanup
407 $ hg shelve --cleanup
406 $ hg shelve --list
408 $ hg shelve --list
407
409
408 $ hg shelve --cleanup --delete
410 $ hg shelve --cleanup --delete
409 abort: options '--cleanup' and '--delete' may not be used together
411 abort: options '--cleanup' and '--delete' may not be used together
410 [255]
412 [255]
411 $ hg shelve --cleanup --patch
413 $ hg shelve --cleanup --patch
412 abort: options '--cleanup' and '--patch' may not be used together
414 abort: options '--cleanup' and '--patch' may not be used together
413 [255]
415 [255]
414 $ hg shelve --cleanup --message MESSAGE
416 $ hg shelve --cleanup --message MESSAGE
415 abort: options '--cleanup' and '--message' may not be used together
417 abort: options '--cleanup' and '--message' may not be used together
416 [255]
418 [255]
417
419
418 test bookmarks
420 test bookmarks
419
421
420 $ hg bookmark test
422 $ hg bookmark test
421 $ hg bookmark
423 $ hg bookmark
422 * test 4:33f7f61e6c5e
424 * test 4:33f7f61e6c5e
423 $ hg shelve
425 $ hg shelve
424 shelved as test
426 shelved as test
425 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
427 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
426 $ hg bookmark
428 $ hg bookmark
427 * test 4:33f7f61e6c5e
429 * test 4:33f7f61e6c5e
428 $ hg unshelve
430 $ hg unshelve
429 unshelving change 'test'
431 unshelving change 'test'
430 $ hg bookmark
432 $ hg bookmark
431 * test 4:33f7f61e6c5e
433 * test 4:33f7f61e6c5e
432
434
433 shelve should still work even if mq is disabled
435 shelve should still work even if mq is disabled
434
436
435 $ hg --config extensions.mq=! shelve
437 $ hg --config extensions.mq=! shelve
436 shelved as test
438 shelved as test
437 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
439 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
438 $ hg --config extensions.mq=! shelve --list
440 $ hg --config extensions.mq=! shelve --list
439 test (*) changes to 'create conflict' (glob)
441 test (*) changes to 'create conflict' (glob)
440 $ hg --config extensions.mq=! unshelve
442 $ hg --config extensions.mq=! unshelve
441 unshelving change 'test'
443 unshelving change 'test'
442
444
443 shelve should leave dirstate clean (issue4055)
445 shelve should leave dirstate clean (issue4055)
444
446
445 $ cd ..
447 $ cd ..
446 $ hg init shelverebase
448 $ hg init shelverebase
447 $ cd shelverebase
449 $ cd shelverebase
448 $ printf 'x\ny\n' > x
450 $ printf 'x\ny\n' > x
449 $ echo z > z
451 $ echo z > z
450 $ hg commit -Aqm xy
452 $ hg commit -Aqm xy
451 $ echo z >> x
453 $ echo z >> x
452 $ hg commit -Aqm z
454 $ hg commit -Aqm z
453 $ hg up 0
455 $ hg up 0
454 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
456 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
455 $ printf 'a\nx\ny\nz\n' > x
457 $ printf 'a\nx\ny\nz\n' > x
456 $ hg commit -Aqm xyz
458 $ hg commit -Aqm xyz
457 $ echo c >> z
459 $ echo c >> z
458 $ hg shelve
460 $ hg shelve
459 shelved as default
461 shelved as default
460 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
461 $ hg rebase -d 1 --config extensions.rebase=
463 $ hg rebase -d 1 --config extensions.rebase=
462 merging x
464 merging x
463 saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-backup.hg (glob)
465 saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-backup.hg (glob)
464 $ hg unshelve
466 $ hg unshelve
465 unshelving change 'default'
467 unshelving change 'default'
466 rebasing shelved changes
468 rebasing shelved changes
467 $ hg status
469 $ hg status
468 M z
470 M z
469
471
470 $ cd ..
472 $ cd ..
471
473
472 shelve should only unshelve pending changes (issue4068)
474 shelve should only unshelve pending changes (issue4068)
473
475
474 $ hg init onlypendingchanges
476 $ hg init onlypendingchanges
475 $ cd onlypendingchanges
477 $ cd onlypendingchanges
476 $ touch a
478 $ touch a
477 $ hg ci -Aqm a
479 $ hg ci -Aqm a
478 $ touch b
480 $ touch b
479 $ hg ci -Aqm b
481 $ hg ci -Aqm b
480 $ hg up -q 0
482 $ hg up -q 0
481 $ touch c
483 $ touch c
482 $ hg ci -Aqm c
484 $ hg ci -Aqm c
483
485
484 $ touch d
486 $ touch d
485 $ hg add d
487 $ hg add d
486 $ hg shelve
488 $ hg shelve
487 shelved as default
489 shelved as default
488 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
490 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
489 $ hg up -q 1
491 $ hg up -q 1
490 $ hg unshelve
492 $ hg unshelve
491 unshelving change 'default'
493 unshelving change 'default'
492 rebasing shelved changes
494 rebasing shelved changes
493 $ hg status
495 $ hg status
494 A d
496 A d
495
497
496 unshelve should work on an ancestor of the original commit
498 unshelve should work on an ancestor of the original commit
497
499
498 $ hg shelve
500 $ hg shelve
499 shelved as default
501 shelved as default
500 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
502 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
501 $ hg up 0
503 $ hg up 0
502 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
504 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
503 $ hg unshelve
505 $ hg unshelve
504 unshelving change 'default'
506 unshelving change 'default'
505 rebasing shelved changes
507 rebasing shelved changes
506 $ hg status
508 $ hg status
507 A d
509 A d
508
510
509 test bug 4073 we need to enable obsolete markers for it
511 test bug 4073 we need to enable obsolete markers for it
510
512
511 $ cat >> $HGRCPATH << EOF
513 $ cat >> $HGRCPATH << EOF
512 > [experimental]
514 > [experimental]
513 > evolution=createmarkers
515 > evolution=createmarkers
514 > EOF
516 > EOF
515 $ hg shelve
517 $ hg shelve
516 shelved as default
518 shelved as default
517 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
519 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
518 $ hg debugobsolete `hg --debug id -i -r 1`
520 $ hg debugobsolete `hg --debug id -i -r 1`
519 $ hg unshelve
521 $ hg unshelve
520 unshelving change 'default'
522 unshelving change 'default'
521
523
522 unshelve should leave unknown files alone (issue4113)
524 unshelve should leave unknown files alone (issue4113)
523
525
524 $ echo e > e
526 $ echo e > e
525 $ hg shelve
527 $ hg shelve
526 shelved as default
528 shelved as default
527 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
529 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
528 $ hg status
530 $ hg status
529 ? e
531 ? e
530 $ hg unshelve
532 $ hg unshelve
531 unshelving change 'default'
533 unshelving change 'default'
532 $ hg status
534 $ hg status
533 A d
535 A d
534 ? e
536 ? e
535 $ cat e
537 $ cat e
536 e
538 e
537
539
538 unshelve should keep a copy of unknown files
540 unshelve should keep a copy of unknown files
539
541
540 $ hg add e
542 $ hg add e
541 $ hg shelve
543 $ hg shelve
542 shelved as default
544 shelved as default
543 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
545 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
544 $ echo z > e
546 $ echo z > e
545 $ hg unshelve
547 $ hg unshelve
546 unshelving change 'default'
548 unshelving change 'default'
547 $ cat e
549 $ cat e
548 e
550 e
549 $ cat e.orig
551 $ cat e.orig
550 z
552 z
551
553
552
554
553 unshelve and conflicts with tracked and untracked files
555 unshelve and conflicts with tracked and untracked files
554
556
555 preparing:
557 preparing:
556
558
557 $ rm *.orig
559 $ rm *.orig
558 $ hg ci -qm 'commit stuff'
560 $ hg ci -qm 'commit stuff'
559 $ hg phase -p null:
561 $ hg phase -p null:
560
562
561 no other changes - no merge:
563 no other changes - no merge:
562
564
563 $ echo f > f
565 $ echo f > f
564 $ hg add f
566 $ hg add f
565 $ hg shelve
567 $ hg shelve
566 shelved as default
568 shelved as default
567 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
569 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
568 $ echo g > f
570 $ echo g > f
569 $ hg unshelve
571 $ hg unshelve
570 unshelving change 'default'
572 unshelving change 'default'
571 $ hg st
573 $ hg st
572 A f
574 A f
573 ? f.orig
575 ? f.orig
574 $ cat f
576 $ cat f
575 f
577 f
576 $ cat f.orig
578 $ cat f.orig
577 g
579 g
578
580
579 other uncommitted changes - merge:
581 other uncommitted changes - merge:
580
582
581 $ hg st
583 $ hg st
582 A f
584 A f
583 ? f.orig
585 ? f.orig
584 $ hg shelve
586 $ hg shelve
585 shelved as default
587 shelved as default
586 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
588 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
587 $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
589 $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
588 o 4 changes to 'commit stuff' shelve@localhost
590 o 4 changes to 'commit stuff' shelve@localhost
589 |
591 |
590 $ hg log -G --template '{rev} {desc|firstline} {author}'
592 $ hg log -G --template '{rev} {desc|firstline} {author}'
591 @ 3 commit stuff test
593 @ 3 commit stuff test
592 |
594 |
593 | o 2 c test
595 | o 2 c test
594 |/
596 |/
595 o 0 a test
597 o 0 a test
596
598
597 $ mv f.orig f
599 $ mv f.orig f
598 $ echo 1 > a
600 $ echo 1 > a
599 $ hg unshelve --date '1073741824 0'
601 $ hg unshelve --date '1073741824 0'
600 unshelving change 'default'
602 unshelving change 'default'
601 temporarily committing pending changes (restore with 'hg unshelve --abort')
603 temporarily committing pending changes (restore with 'hg unshelve --abort')
602 rebasing shelved changes
604 rebasing shelved changes
603 merging f
605 merging f
604 warning: conflicts during merge.
606 warning: conflicts during merge.
605 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
607 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
606 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
608 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
607 [1]
609 [1]
608 $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}'
610 $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}'
609 @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000
611 @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000
610 |
612 |
611 | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000
613 | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000
612 |/
614 |/
613 o 3 commit stuff test 1970-01-01 00:00 +0000
615 o 3 commit stuff test 1970-01-01 00:00 +0000
614 |
616 |
615 | o 2 c test 1970-01-01 00:00 +0000
617 | o 2 c test 1970-01-01 00:00 +0000
616 |/
618 |/
617 o 0 a test 1970-01-01 00:00 +0000
619 o 0 a test 1970-01-01 00:00 +0000
618
620
619 $ hg st
621 $ hg st
620 M f
622 M f
621 ? f.orig
623 ? f.orig
622 $ cat f
624 $ cat f
623 <<<<<<< dest: 5f6b880e719b - shelve: pending changes temporary commit
625 <<<<<<< dest: 5f6b880e719b - shelve: pending changes temporary commit
624 g
626 g
625 =======
627 =======
626 f
628 f
627 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
629 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
628 $ cat f.orig
630 $ cat f.orig
629 g
631 g
630 $ hg unshelve --abort
632 $ hg unshelve --abort
631 rebase aborted
633 rebase aborted
632 unshelve of 'default' aborted
634 unshelve of 'default' aborted
633 $ hg st
635 $ hg st
634 M a
636 M a
635 ? f.orig
637 ? f.orig
636 $ cat f.orig
638 $ cat f.orig
637 g
639 g
638 $ hg unshelve
640 $ hg unshelve
639 unshelving change 'default'
641 unshelving change 'default'
640 temporarily committing pending changes (restore with 'hg unshelve --abort')
642 temporarily committing pending changes (restore with 'hg unshelve --abort')
641 rebasing shelved changes
643 rebasing shelved changes
642 $ hg st
644 $ hg st
643 M a
645 M a
644 A f
646 A f
645 ? f.orig
647 ? f.orig
646
648
647 other committed changes - merge:
649 other committed changes - merge:
648
650
649 $ hg shelve f
651 $ hg shelve f
650 shelved as default
652 shelved as default
651 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
653 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
652 $ hg ci a -m 'intermediate other change'
654 $ hg ci a -m 'intermediate other change'
653 $ mv f.orig f
655 $ mv f.orig f
654 $ hg unshelve
656 $ hg unshelve
655 unshelving change 'default'
657 unshelving change 'default'
656 rebasing shelved changes
658 rebasing shelved changes
657 merging f
659 merging f
658 warning: conflicts during merge.
660 warning: conflicts during merge.
659 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
661 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
660 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
662 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
661 [1]
663 [1]
662 $ hg st
664 $ hg st
663 M f
665 M f
664 ? f.orig
666 ? f.orig
665 $ cat f
667 $ cat f
666 <<<<<<< dest: * - test: intermediate other change (glob)
668 <<<<<<< dest: * - test: intermediate other change (glob)
667 g
669 g
668 =======
670 =======
669 f
671 f
670 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
672 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
671 $ cat f.orig
673 $ cat f.orig
672 g
674 g
673 $ hg unshelve --abort
675 $ hg unshelve --abort
674 rebase aborted
676 rebase aborted
675 unshelve of 'default' aborted
677 unshelve of 'default' aborted
676 $ hg st
678 $ hg st
677 ? f.orig
679 ? f.orig
678 $ cat f.orig
680 $ cat f.orig
679 g
681 g
680 $ hg shelve --delete default
682 $ hg shelve --delete default
681
683
682 Recreate some conflict again
684 Recreate some conflict again
683
685
684 $ cd ../repo
686 $ cd ../repo
685 $ hg up -C -r 3
687 $ hg up -C -r 3
686 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
688 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
687 (leaving bookmark test)
689 (leaving bookmark test)
688 $ echo y >> a/a
690 $ echo y >> a/a
689 $ hg shelve
691 $ hg shelve
690 shelved as default
692 shelved as default
691 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
693 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
692 $ hg up test
694 $ hg up test
693 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
695 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
694 (activating bookmark test)
696 (activating bookmark test)
695 $ hg unshelve
697 $ hg unshelve
696 unshelving change 'default'
698 unshelving change 'default'
697 rebasing shelved changes
699 rebasing shelved changes
698 merging a/a
700 merging a/a
699 warning: conflicts during merge.
701 warning: conflicts during merge.
700 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
702 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
701 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
703 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
702 [1]
704 [1]
703
705
704 Test that resolving all conflicts in one direction (so that the rebase
706 Test that resolving all conflicts in one direction (so that the rebase
705 is a no-op), works (issue4398)
707 is a no-op), works (issue4398)
706
708
707 $ hg revert -a -r .
709 $ hg revert -a -r .
708 reverting a/a (glob)
710 reverting a/a (glob)
709 $ hg resolve -m a/a
711 $ hg resolve -m a/a
710 (no more unresolved files)
712 (no more unresolved files)
711 $ hg unshelve -c
713 $ hg unshelve -c
712 unshelve of 'default' complete
714 unshelve of 'default' complete
713 $ hg diff
715 $ hg diff
714 $ hg status
716 $ hg status
715 ? a/a.orig
717 ? a/a.orig
716 ? foo/foo
718 ? foo/foo
717 $ hg summary
719 $ hg summary
718 parent: 4:33f7f61e6c5e tip
720 parent: 4:33f7f61e6c5e tip
719 create conflict
721 create conflict
720 branch: default
722 branch: default
721 bookmarks: *test
723 bookmarks: *test
722 commit: 2 unknown (clean)
724 commit: 2 unknown (clean)
723 update: (current)
725 update: (current)
724
726
725 $ hg shelve --delete --stat
727 $ hg shelve --delete --stat
726 abort: options '--delete' and '--stat' may not be used together
728 abort: options '--delete' and '--stat' may not be used together
727 [255]
729 [255]
728 $ hg shelve --delete --name NAME
730 $ hg shelve --delete --name NAME
729 abort: options '--delete' and '--name' may not be used together
731 abort: options '--delete' and '--name' may not be used together
730 [255]
732 [255]
731
733
732 $ cd ..
734 $ cd ..
@@ -1,355 +1,357 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 $ echo "color=" >> $HGRCPATH
2 > [extensions]
3 $ echo "[color]" >> $HGRCPATH
3 > color =
4 $ echo "mode=ansi" >> $HGRCPATH
4 > [color]
5 > mode = ansi
6 > EOF
5 Terminfo codes compatibility fix
7 Terminfo codes compatibility fix
6 $ echo "color.none=0" >> $HGRCPATH
8 $ echo "color.none=0" >> $HGRCPATH
7
9
8 $ hg init repo1
10 $ hg init repo1
9 $ cd repo1
11 $ cd repo1
10 $ mkdir a b a/1 b/1 b/2
12 $ mkdir a b a/1 b/1 b/2
11 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
13 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
12
14
13 hg status in repo root:
15 hg status in repo root:
14
16
15 $ hg status --color=always
17 $ hg status --color=always
16 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
18 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
17 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
19 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
18 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
20 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
19 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
21 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
20 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
22 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
21 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
23 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
22
24
23 $ hg status --color=debug
25 $ hg status --color=debug
24 [status.unknown|? ][status.unknown|a/1/in_a_1]
26 [status.unknown|? ][status.unknown|a/1/in_a_1]
25 [status.unknown|? ][status.unknown|a/in_a]
27 [status.unknown|? ][status.unknown|a/in_a]
26 [status.unknown|? ][status.unknown|b/1/in_b_1]
28 [status.unknown|? ][status.unknown|b/1/in_b_1]
27 [status.unknown|? ][status.unknown|b/2/in_b_2]
29 [status.unknown|? ][status.unknown|b/2/in_b_2]
28 [status.unknown|? ][status.unknown|b/in_b]
30 [status.unknown|? ][status.unknown|b/in_b]
29 [status.unknown|? ][status.unknown|in_root]
31 [status.unknown|? ][status.unknown|in_root]
30
32
31 hg status . in repo root:
33 hg status . in repo root:
32
34
33 $ hg status --color=always .
35 $ hg status --color=always .
34 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
36 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
35 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
37 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
36 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
38 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
37 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
39 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
38 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
40 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
39 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
41 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
40
42
41 $ hg status --color=always --cwd a
43 $ hg status --color=always --cwd a
42 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
44 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
43 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
45 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
44 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
46 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
45 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
47 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
46 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
48 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
47 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
49 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
48 $ hg status --color=always --cwd a .
50 $ hg status --color=always --cwd a .
49 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
51 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
50 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
52 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
51 $ hg status --color=always --cwd a ..
53 $ hg status --color=always --cwd a ..
52 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
54 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
53 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
55 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
54 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
56 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
55 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc)
57 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc)
56 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
58 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
57 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
59 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
58
60
59 $ hg status --color=always --cwd b
61 $ hg status --color=always --cwd b
60 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
62 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
62 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
66 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
67 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
66 $ hg status --color=always --cwd b .
68 $ hg status --color=always --cwd b .
67 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
69 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
68 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
70 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
69 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
70 $ hg status --color=always --cwd b ..
72 $ hg status --color=always --cwd b ..
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
72 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
75 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
75 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
77 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
78 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
77
79
78 $ hg status --color=always --cwd a/1
80 $ hg status --color=always --cwd a/1
79 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
81 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
81 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
85 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
86 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
85 $ hg status --color=always --cwd a/1 .
87 $ hg status --color=always --cwd a/1 .
86 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
88 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
87 $ hg status --color=always --cwd a/1 ..
89 $ hg status --color=always --cwd a/1 ..
88 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
90 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
89 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
90
92
91 $ hg status --color=always --cwd b/1
93 $ hg status --color=always --cwd b/1
92 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
93 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
96 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
97 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
96 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
98 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
97 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
98 $ hg status --color=always --cwd b/1 .
100 $ hg status --color=always --cwd b/1 .
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
101 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
100 $ hg status --color=always --cwd b/1 ..
102 $ hg status --color=always --cwd b/1 ..
101 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
102 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
104 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
105 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
104
106
105 $ hg status --color=always --cwd b/2
107 $ hg status --color=always --cwd b/2
106 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
109 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
109 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
111 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
112 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
111 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
113 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
112 $ hg status --color=always --cwd b/2 .
114 $ hg status --color=always --cwd b/2 .
113 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
115 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
114 $ hg status --color=always --cwd b/2 ..
116 $ hg status --color=always --cwd b/2 ..
115 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
117 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
116 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
118 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
117 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
119 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
118
120
119 Make sure --color=never works
121 Make sure --color=never works
120 $ hg status --color=never
122 $ hg status --color=never
121 ? a/1/in_a_1
123 ? a/1/in_a_1
122 ? a/in_a
124 ? a/in_a
123 ? b/1/in_b_1
125 ? b/1/in_b_1
124 ? b/2/in_b_2
126 ? b/2/in_b_2
125 ? b/in_b
127 ? b/in_b
126 ? in_root
128 ? in_root
127
129
128 Make sure ui.formatted=False works
130 Make sure ui.formatted=False works
129 $ hg status --config ui.formatted=False
131 $ hg status --config ui.formatted=False
130 ? a/1/in_a_1
132 ? a/1/in_a_1
131 ? a/in_a
133 ? a/in_a
132 ? b/1/in_b_1
134 ? b/1/in_b_1
133 ? b/2/in_b_2
135 ? b/2/in_b_2
134 ? b/in_b
136 ? b/in_b
135 ? in_root
137 ? in_root
136
138
137 $ cd ..
139 $ cd ..
138
140
139 $ hg init repo2
141 $ hg init repo2
140 $ cd repo2
142 $ cd repo2
141 $ touch modified removed deleted ignored
143 $ touch modified removed deleted ignored
142 $ echo "^ignored$" > .hgignore
144 $ echo "^ignored$" > .hgignore
143 $ hg ci -A -m 'initial checkin'
145 $ hg ci -A -m 'initial checkin'
144 adding .hgignore
146 adding .hgignore
145 adding deleted
147 adding deleted
146 adding modified
148 adding modified
147 adding removed
149 adding removed
148 $ hg log --color=debug
150 $ hg log --color=debug
149 [log.changeset changeset.draft|changeset: 0:389aef86a55e]
151 [log.changeset changeset.draft|changeset: 0:389aef86a55e]
150 [log.tag|tag: tip]
152 [log.tag|tag: tip]
151 [log.user|user: test]
153 [log.user|user: test]
152 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
154 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
153 [log.summary|summary: initial checkin]
155 [log.summary|summary: initial checkin]
154
156
155 Labels on empty strings should not be displayed, labels on custom
157 Labels on empty strings should not be displayed, labels on custom
156 templates should be.
158 templates should be.
157
159
158 $ hg log --color=debug -T '{label("my.label",author)}\n{label("skipped.label","")}'
160 $ hg log --color=debug -T '{label("my.label",author)}\n{label("skipped.label","")}'
159 [my.label|test]
161 [my.label|test]
160 $ touch modified added unknown ignored
162 $ touch modified added unknown ignored
161 $ hg add added
163 $ hg add added
162 $ hg remove removed
164 $ hg remove removed
163 $ rm deleted
165 $ rm deleted
164
166
165 hg status:
167 hg status:
166
168
167 $ hg status --color=always
169 $ hg status --color=always
168 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
170 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
169 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
171 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
170 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
172 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
171 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
173 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
172
174
173 hg status modified added removed deleted unknown never-existed ignored:
175 hg status modified added removed deleted unknown never-existed ignored:
174
176
175 $ hg status --color=always modified added removed deleted unknown never-existed ignored
177 $ hg status --color=always modified added removed deleted unknown never-existed ignored
176 never-existed: * (glob)
178 never-existed: * (glob)
177 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
179 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
178 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
180 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
179 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
181 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
180 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
182 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
181
183
182 $ hg copy modified copied
184 $ hg copy modified copied
183
185
184 hg status -C:
186 hg status -C:
185
187
186 $ hg status --color=always -C
188 $ hg status --color=always -C
187 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
189 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
188 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
190 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
189 \x1b[0;0m modified\x1b[0m (esc)
191 \x1b[0;0m modified\x1b[0m (esc)
190 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
192 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
191 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
193 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
192 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
194 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
193
195
194 hg status -A:
196 hg status -A:
195
197
196 $ hg status --color=always -A
198 $ hg status --color=always -A
197 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
199 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
198 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
200 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
199 \x1b[0;0m modified\x1b[0m (esc)
201 \x1b[0;0m modified\x1b[0m (esc)
200 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
202 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
201 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
203 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
202 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
204 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
203 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
205 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
204 \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
206 \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
205 \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
207 \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
206
208
207
209
208 hg status -A (with terminfo color):
210 hg status -A (with terminfo color):
209
211
210 #if tic
212 #if tic
211
213
212 $ mkdir "$TESTTMP/terminfo"
214 $ mkdir "$TESTTMP/terminfo"
213 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
215 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
214 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --color=always -A
216 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --color=always -A
215 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
217 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
216 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
218 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
217 \x1b[30m\x1b[30m modified\x1b[30m (esc)
219 \x1b[30m\x1b[30m modified\x1b[30m (esc)
218 \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc)
220 \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc)
219 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc)
221 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc)
220 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc)
222 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc)
221 \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc)
223 \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc)
222 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc)
224 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc)
223 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc)
225 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc)
224
226
225 #endif
227 #endif
226
228
227
229
228 $ echo "^ignoreddir$" > .hgignore
230 $ echo "^ignoreddir$" > .hgignore
229 $ mkdir ignoreddir
231 $ mkdir ignoreddir
230 $ touch ignoreddir/file
232 $ touch ignoreddir/file
231
233
232 hg status ignoreddir/file:
234 hg status ignoreddir/file:
233
235
234 $ hg status --color=always ignoreddir/file
236 $ hg status --color=always ignoreddir/file
235
237
236 hg status -i ignoreddir/file:
238 hg status -i ignoreddir/file:
237
239
238 $ hg status --color=always -i ignoreddir/file
240 $ hg status --color=always -i ignoreddir/file
239 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
241 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
240 $ cd ..
242 $ cd ..
241
243
242 check 'status -q' and some combinations
244 check 'status -q' and some combinations
243
245
244 $ hg init repo3
246 $ hg init repo3
245 $ cd repo3
247 $ cd repo3
246 $ touch modified removed deleted ignored
248 $ touch modified removed deleted ignored
247 $ echo "^ignored$" > .hgignore
249 $ echo "^ignored$" > .hgignore
248 $ hg commit -A -m 'initial checkin'
250 $ hg commit -A -m 'initial checkin'
249 adding .hgignore
251 adding .hgignore
250 adding deleted
252 adding deleted
251 adding modified
253 adding modified
252 adding removed
254 adding removed
253 $ touch added unknown ignored
255 $ touch added unknown ignored
254 $ hg add added
256 $ hg add added
255 $ echo "test" >> modified
257 $ echo "test" >> modified
256 $ hg remove removed
258 $ hg remove removed
257 $ rm deleted
259 $ rm deleted
258 $ hg copy modified copied
260 $ hg copy modified copied
259
261
260 test unknown color
262 test unknown color
261
263
262 $ hg --config color.status.modified=periwinkle status --color=always
264 $ hg --config color.status.modified=periwinkle status --color=always
263 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
265 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
264 M modified
266 M modified
265 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
267 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
266 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
268 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
267 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
269 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
268 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
270 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
269 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
271 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
270
272
271 Run status with 2 different flags.
273 Run status with 2 different flags.
272 Check if result is the same or different.
274 Check if result is the same or different.
273 If result is not as expected, raise error
275 If result is not as expected, raise error
274
276
275 $ assert() {
277 $ assert() {
276 > hg status --color=always $1 > ../a
278 > hg status --color=always $1 > ../a
277 > hg status --color=always $2 > ../b
279 > hg status --color=always $2 > ../b
278 > if diff ../a ../b > /dev/null; then
280 > if diff ../a ../b > /dev/null; then
279 > out=0
281 > out=0
280 > else
282 > else
281 > out=1
283 > out=1
282 > fi
284 > fi
283 > if [ $3 -eq 0 ]; then
285 > if [ $3 -eq 0 ]; then
284 > df="same"
286 > df="same"
285 > else
287 > else
286 > df="different"
288 > df="different"
287 > fi
289 > fi
288 > if [ $out -ne $3 ]; then
290 > if [ $out -ne $3 ]; then
289 > echo "Error on $1 and $2, should be $df."
291 > echo "Error on $1 and $2, should be $df."
290 > fi
292 > fi
291 > }
293 > }
292
294
293 assert flag1 flag2 [0-same | 1-different]
295 assert flag1 flag2 [0-same | 1-different]
294
296
295 $ assert "-q" "-mard" 0
297 $ assert "-q" "-mard" 0
296 $ assert "-A" "-marduicC" 0
298 $ assert "-A" "-marduicC" 0
297 $ assert "-qA" "-mardcC" 0
299 $ assert "-qA" "-mardcC" 0
298 $ assert "-qAui" "-A" 0
300 $ assert "-qAui" "-A" 0
299 $ assert "-qAu" "-marducC" 0
301 $ assert "-qAu" "-marducC" 0
300 $ assert "-qAi" "-mardicC" 0
302 $ assert "-qAi" "-mardicC" 0
301 $ assert "-qu" "-u" 0
303 $ assert "-qu" "-u" 0
302 $ assert "-q" "-u" 1
304 $ assert "-q" "-u" 1
303 $ assert "-m" "-a" 1
305 $ assert "-m" "-a" 1
304 $ assert "-r" "-d" 1
306 $ assert "-r" "-d" 1
305 $ cd ..
307 $ cd ..
306
308
307 test 'resolve -l'
309 test 'resolve -l'
308
310
309 $ hg init repo4
311 $ hg init repo4
310 $ cd repo4
312 $ cd repo4
311 $ echo "file a" > a
313 $ echo "file a" > a
312 $ echo "file b" > b
314 $ echo "file b" > b
313 $ hg add a b
315 $ hg add a b
314 $ hg commit -m "initial"
316 $ hg commit -m "initial"
315 $ echo "file a change 1" > a
317 $ echo "file a change 1" > a
316 $ echo "file b change 1" > b
318 $ echo "file b change 1" > b
317 $ hg commit -m "head 1"
319 $ hg commit -m "head 1"
318 $ hg update 0
320 $ hg update 0
319 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
321 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
320 $ echo "file a change 2" > a
322 $ echo "file a change 2" > a
321 $ echo "file b change 2" > b
323 $ echo "file b change 2" > b
322 $ hg commit -m "head 2"
324 $ hg commit -m "head 2"
323 created new head
325 created new head
324 $ hg merge
326 $ hg merge
325 merging a
327 merging a
326 warning: conflicts during merge.
328 warning: conflicts during merge.
327 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
329 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
328 merging b
330 merging b
329 warning: conflicts during merge.
331 warning: conflicts during merge.
330 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
332 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
331 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
333 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
332 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
334 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
333 [1]
335 [1]
334 $ hg resolve -m b
336 $ hg resolve -m b
335
337
336 hg resolve with one unresolved, one resolved:
338 hg resolve with one unresolved, one resolved:
337
339
338 $ hg resolve --color=always -l
340 $ hg resolve --color=always -l
339 \x1b[0;31;1mU a\x1b[0m (esc)
341 \x1b[0;31;1mU a\x1b[0m (esc)
340 \x1b[0;32;1mR b\x1b[0m (esc)
342 \x1b[0;32;1mR b\x1b[0m (esc)
341
343
342 color coding of error message with current availability of curses
344 color coding of error message with current availability of curses
343
345
344 $ hg unknowncommand > /dev/null
346 $ hg unknowncommand > /dev/null
345 hg: unknown command 'unknowncommand'
347 hg: unknown command 'unknowncommand'
346 [255]
348 [255]
347
349
348 color coding of error message without curses
350 color coding of error message without curses
349
351
350 $ echo 'raise ImportError' > curses.py
352 $ echo 'raise ImportError' > curses.py
351 $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null
353 $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null
352 hg: unknown command 'unknowncommand'
354 hg: unknown command 'unknowncommand'
353 [255]
355 [255]
354
356
355 $ cd ..
357 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now