##// END OF EJS Templates
tests: use 'hghave execbit' for tests that manipulate x bit in file system
Mads Kiilerich -
r15442:db0340f4 default
parent child Browse files
Show More
@@ -1,210 +1,210 b''
1 $ "$TESTDIR/hghave" symlink || exit 80
1 $ "$TESTDIR/hghave" symlink execbit || exit 80
2 2
3 3 $ . "$TESTDIR/bzr-definitions"
4 4
5 5 create and rename on the same file in the same step
6 6
7 7 $ mkdir test-createandrename
8 8 $ cd test-createandrename
9 9 $ bzr init -q source
10 10 $ cd source
11 11 $ echo a > a
12 12 $ echo c > c
13 13 $ echo e > e
14 14 $ bzr add -q a c e
15 15 $ bzr commit -q -m 'Initial add: a, c, e'
16 16 $ bzr mv a b
17 17 a => b
18 18 $ bzr mv c d
19 19 c => d
20 20 $ bzr mv e f
21 21 e => f
22 22 $ echo a2 >> a
23 23 $ mkdir e
24 24 $ bzr add -q a e
25 25 $ bzr commit -q -m 'rename a into b, create a, rename c into d'
26 26 $ cd ..
27 27 $ hg convert source source-hg
28 28 initializing destination source-hg repository
29 29 scanning source...
30 30 sorting...
31 31 converting...
32 32 1 Initial add: a, c, e
33 33 0 rename a into b, create a, rename c into d
34 34 $ glog -R source-hg
35 35 o 1 "rename a into b, create a, rename c into d" files: a b c d e f
36 36 |
37 37 o 0 "Initial add: a, c, e" files: a c e
38 38
39 39
40 40 manifest
41 41
42 42 $ hg manifest -R source-hg -r tip
43 43 a
44 44 b
45 45 d
46 46 f
47 47
48 48 test --rev option
49 49
50 50 $ hg convert -r 1 source source-1-hg
51 51 initializing destination source-1-hg repository
52 52 scanning source...
53 53 sorting...
54 54 converting...
55 55 0 Initial add: a, c, e
56 56 $ glog -R source-1-hg
57 57 o 0 "Initial add: a, c, e" files: a c e
58 58
59 59
60 60 test with filemap
61 61
62 62 $ cat > filemap <<EOF
63 63 > exclude a
64 64 > EOF
65 65 $ hg convert --filemap filemap source source-filemap-hg
66 66 initializing destination source-filemap-hg repository
67 67 scanning source...
68 68 sorting...
69 69 converting...
70 70 1 Initial add: a, c, e
71 71 0 rename a into b, create a, rename c into d
72 72 $ hg -R source-filemap-hg manifest -r tip
73 73 b
74 74 d
75 75 f
76 76
77 77 convert from lightweight checkout
78 78
79 79 $ bzr checkout --lightweight source source-light
80 80 $ hg convert source-light source-light-hg
81 81 initializing destination source-light-hg repository
82 82 warning: lightweight checkouts may cause conversion failures, try with a regular branch instead.
83 83 scanning source...
84 84 sorting...
85 85 converting...
86 86 1 Initial add: a, c, e
87 87 0 rename a into b, create a, rename c into d
88 88
89 89 lightweight manifest
90 90
91 91 $ hg manifest -R source-light-hg -r tip
92 92 a
93 93 b
94 94 d
95 95 f
96 96
97 97 extract timestamps that look just like hg's {date|isodate}:
98 98 yyyy-mm-dd HH:MM zzzz (no seconds!)
99 99 compare timestamps
100 100
101 101 $ cd source
102 102 $ bzr log | \
103 103 > sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \
104 104 > > ../bzr-timestamps
105 105 $ cd ..
106 106 $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
107 107 $ diff -u bzr-timestamps hg-timestamps
108 108 $ cd ..
109 109
110 110 merge
111 111
112 112 $ mkdir test-merge
113 113 $ cd test-merge
114 114 $ cat > helper.py <<EOF
115 115 > import sys
116 116 > from bzrlib import workingtree
117 117 > wt = workingtree.WorkingTree.open('.')
118 118 >
119 119 > message, stamp = sys.argv[1:]
120 120 > wt.commit(message, timestamp=int(stamp))
121 121 > EOF
122 122 $ bzr init -q source
123 123 $ cd source
124 124 $ echo content > a
125 125 $ echo content2 > b
126 126 $ bzr add -q a b
127 127 $ bzr commit -q -m 'Initial add'
128 128 $ cd ..
129 129 $ bzr branch -q source source-improve
130 130 $ cd source
131 131 $ echo more >> a
132 132 $ python ../helper.py 'Editing a' 100
133 133 $ cd ../source-improve
134 134 $ echo content3 >> b
135 135 $ python ../helper.py 'Editing b' 200
136 136 $ cd ../source
137 137 $ bzr merge -q ../source-improve
138 138 $ bzr commit -q -m 'Merged improve branch'
139 139 $ cd ..
140 140 $ hg convert --datesort source source-hg
141 141 initializing destination source-hg repository
142 142 scanning source...
143 143 sorting...
144 144 converting...
145 145 3 Initial add
146 146 2 Editing a
147 147 1 Editing b
148 148 0 Merged improve branch
149 149 $ glog -R source-hg
150 150 o 3 "Merged improve branch" files:
151 151 |\
152 152 | o 2 "Editing b" files: b
153 153 | |
154 154 o | 1 "Editing a" files: a
155 155 |/
156 156 o 0 "Initial add" files: a b
157 157
158 158 $ cd ..
159 159
160 160 symlinks and executable files
161 161
162 162 $ mkdir test-symlinks
163 163 $ cd test-symlinks
164 164 $ bzr init -q source
165 165 $ cd source
166 166 $ touch program
167 167 $ chmod +x program
168 168 $ ln -s program altname
169 169 $ mkdir d
170 170 $ echo a > d/a
171 171 $ ln -s a syma
172 172 $ bzr add -q altname program syma d/a
173 173 $ bzr commit -q -m 'Initial setup'
174 174 $ touch newprog
175 175 $ chmod +x newprog
176 176 $ rm altname
177 177 $ ln -s newprog altname
178 178 $ chmod -x program
179 179 $ bzr add -q newprog
180 180 $ bzr commit -q -m 'Symlink changed, x bits changed'
181 181 $ cd ..
182 182 $ hg convert source source-hg
183 183 initializing destination source-hg repository
184 184 scanning source...
185 185 sorting...
186 186 converting...
187 187 1 Initial setup
188 188 0 Symlink changed, x bits changed
189 189 $ manifest source-hg 0
190 190 % manifest of 0
191 191 644 @ altname
192 192 644 d/a
193 193 755 * program
194 194 644 @ syma
195 195 $ manifest source-hg tip
196 196 % manifest of tip
197 197 644 @ altname
198 198 644 d/a
199 199 755 * newprog
200 200 644 program
201 201 644 @ syma
202 202 $ cd source-hg
203 203
204 204 test the symlinks can be recreated
205 205
206 206 $ hg up
207 207 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 208 $ hg cat syma; echo
209 209 a
210 210
@@ -1,139 +1,140 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
1 2
2 3 $ cat >> $HGRCPATH <<EOF
3 4 > [extensions]
4 5 > convert=
5 6 > [convert]
6 7 > hg.saverev=False
7 8 > EOF
8 9 $ hg init orig
9 10 $ cd orig
10 11 $ echo foo > foo
11 12 $ echo bar > bar
12 13 $ hg ci -qAm 'add foo bar' -d '0 0'
13 14 $ echo >> foo
14 15 $ hg ci -m 'change foo' -d '1 0'
15 16 $ hg up -qC 0
16 17 $ hg copy --after --force foo bar
17 18 $ hg copy foo baz
18 19 $ hg ci -m 'make bar and baz copies of foo' -d '2 0'
19 20 created new head
20 21 $ hg bookmark premerge1
21 22 $ hg merge
22 23 merging baz and foo to baz
23 24 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
24 25 (branch merge, don't forget to commit)
25 26 $ hg ci -m 'merge local copy' -d '3 0'
26 27 $ hg up -C 1
27 28 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
28 29 $ hg bookmark premerge2
29 30 $ hg merge 2
30 31 merging foo and baz to baz
31 32 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
32 33 (branch merge, don't forget to commit)
33 34 $ hg ci -m 'merge remote copy' -d '4 0'
34 35 created new head
35 36 $ chmod +x baz
36 37 $ hg ci -m 'mark baz executable' -d '5 0'
37 38 $ cd ..
38 39 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
39 40 initializing destination new repository
40 41 scanning source...
41 42 sorting...
42 43 converting...
43 44 5 add foo bar
44 45 4 change foo
45 46 3 make bar and baz copies of foo
46 47 2 merge local copy
47 48 1 merge remote copy
48 49 0 mark baz executable
49 50 updating bookmarks
50 51 $ cd new
51 52 $ hg out ../orig
52 53 comparing with ../orig
53 54 searching for changes
54 55 no changes found
55 56 [1]
56 57 $ hg bookmarks
57 58 premerge1 3:973ef48a98a4
58 59 premerge2 5:13d9b87cf8f8
59 60 $ cd ..
60 61
61 62 check shamap LF and CRLF handling
62 63
63 64 $ cat > rewrite.py <<EOF
64 65 > import sys
65 66 > # Interlace LF and CRLF
66 67 > lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
67 68 > for i, l in enumerate(file(sys.argv[1]))]
68 69 > file(sys.argv[1], 'wb').write(''.join(lines))
69 70 > EOF
70 71 $ python rewrite.py new/.hg/shamap
71 72 $ cd orig
72 73 $ hg up -qC 1
73 74 $ echo foo >> foo
74 75 $ hg ci -qm 'change foo again'
75 76 $ hg up -qC 2
76 77 $ echo foo >> foo
77 78 $ hg ci -qm 'change foo again again'
78 79 $ cd ..
79 80 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
80 81 scanning source...
81 82 sorting...
82 83 converting...
83 84 1 change foo again again
84 85 0 change foo again
85 86 updating bookmarks
86 87
87 88 init broken repository
88 89
89 90 $ hg init broken
90 91 $ cd broken
91 92 $ echo a >> a
92 93 $ echo b >> b
93 94 $ hg ci -qAm init
94 95 $ echo a >> a
95 96 $ echo b >> b
96 97 $ hg copy b c
97 98 $ hg ci -qAm changeall
98 99 $ hg up -qC 0
99 100 $ echo bc >> b
100 101 $ hg ci -m changebagain
101 102 created new head
102 103 $ HGMERGE=internal:local hg -q merge
103 104 $ hg ci -m merge
104 105 $ hg mv b d
105 106 $ hg ci -m moveb
106 107
107 108 break it
108 109
109 110 $ rm .hg/store/data/b.*
110 111 $ cd ..
111 112 $ hg --config convert.hg.ignoreerrors=True convert broken fixed
112 113 initializing destination fixed repository
113 114 scanning source...
114 115 sorting...
115 116 converting...
116 117 4 init
117 118 ignoring: data/b.i@1e88685f5dde: no match found
118 119 3 changeall
119 120 2 changebagain
120 121 1 merge
121 122 0 moveb
122 123 $ hg -R fixed verify
123 124 checking changesets
124 125 checking manifests
125 126 crosschecking files in changesets and manifests
126 127 checking files
127 128 3 files, 5 changesets, 5 total revisions
128 129
129 130 manifest -r 0
130 131
131 132 $ hg -R fixed manifest -r 0
132 133 a
133 134
134 135 manifest -r tip
135 136
136 137 $ hg -R fixed manifest -r tip
137 138 a
138 139 c
139 140 d
@@ -1,548 +1,548 b''
1 $ "$TESTDIR/hghave" svn13 no-outer-repo symlink || exit 80
1 $ "$TESTDIR/hghave" svn13 no-outer-repo symlink execbit || exit 80
2 2
3 3 $ fixpath()
4 4 > {
5 5 > tr '\\' /
6 6 > }
7 7 $ svnupanddisplay()
8 8 > {
9 9 > (
10 10 > cd $1;
11 11 > svn up;
12 12 > svn st -v | fixpath | sed 's/ */ /g'
13 13 > limit=''
14 14 > if [ $2 -gt 0 ]; then
15 15 > limit="--limit=$2"
16 16 > fi
17 17 > svn log --xml -v $limit \
18 18 > | fixpath \
19 19 > | sed 's,<date>.*,<date/>,' \
20 20 > | grep -v 'kind="'
21 21 > )
22 22 > }
23 23
24 24 $ cat >> $HGRCPATH <<EOF
25 25 > [extensions]
26 26 > convert =
27 27 > graphlog =
28 28 > EOF
29 29
30 30 $ hg init a
31 31
32 32 Add
33 33
34 34 $ echo a > a/a
35 35 $ mkdir -p a/d1/d2
36 36 $ echo b > a/d1/d2/b
37 37 $ ln -s a/missing a/link
38 38 $ hg --cwd a ci -d '0 0' -A -m 'add a file'
39 39 adding a
40 40 adding d1/d2/b
41 41 adding link
42 42
43 43 Modify
44 44
45 45 $ "$TESTDIR/svn-safe-append.py" a a/a
46 46 $ hg --cwd a ci -d '1 0' -m 'modify a file'
47 47 $ hg --cwd a tip -q
48 48 1:8231f652da37
49 49
50 50 $ hg convert -d svn a
51 51 assuming destination a-hg
52 52 initializing svn repository 'a-hg'
53 53 initializing svn working copy 'a-hg-wc'
54 54 scanning source...
55 55 sorting...
56 56 converting...
57 57 1 add a file
58 58 0 modify a file
59 59 $ svnupanddisplay a-hg-wc 2
60 60 At revision 2.
61 61 2 2 test .
62 62 2 2 test a
63 63 2 1 test d1
64 64 2 1 test d1/d2
65 65 2 1 test d1/d2/b
66 66 2 1 test link
67 67 <?xml version="1.0"?>
68 68 <log>
69 69 <logentry
70 70 revision="2">
71 71 <author>test</author>
72 72 <date/>
73 73 <paths>
74 74 <path
75 75 action="M">/a</path>
76 76 </paths>
77 77 <msg>modify a file</msg>
78 78 </logentry>
79 79 <logentry
80 80 revision="1">
81 81 <author>test</author>
82 82 <date/>
83 83 <paths>
84 84 <path
85 85 action="A">/a</path>
86 86 <path
87 87 action="A">/d1</path>
88 88 <path
89 89 action="A">/d1/d2</path>
90 90 <path
91 91 action="A">/d1/d2/b</path>
92 92 <path
93 93 action="A">/link</path>
94 94 </paths>
95 95 <msg>add a file</msg>
96 96 </logentry>
97 97 </log>
98 98 $ ls a a-hg-wc
99 99 a:
100 100 a
101 101 d1
102 102 link
103 103
104 104 a-hg-wc:
105 105 a
106 106 d1
107 107 link
108 108 $ cmp a/a a-hg-wc/a
109 109
110 110 Rename
111 111
112 112 $ hg --cwd a mv a b
113 113 $ hg --cwd a mv link newlink
114 114
115 115 $ hg --cwd a ci -d '2 0' -m 'rename a file'
116 116 $ hg --cwd a tip -q
117 117 2:a67e26ccec09
118 118
119 119 $ hg convert -d svn a
120 120 assuming destination a-hg
121 121 initializing svn working copy 'a-hg-wc'
122 122 scanning source...
123 123 sorting...
124 124 converting...
125 125 0 rename a file
126 126 $ svnupanddisplay a-hg-wc 1
127 127 At revision 3.
128 128 3 3 test .
129 129 3 3 test b
130 130 3 1 test d1
131 131 3 1 test d1/d2
132 132 3 1 test d1/d2/b
133 133 3 3 test newlink
134 134 <?xml version="1.0"?>
135 135 <log>
136 136 <logentry
137 137 revision="3">
138 138 <author>test</author>
139 139 <date/>
140 140 <paths>
141 141 <path
142 142 action="D">/a</path>
143 143 <path
144 144 copyfrom-path="/a"
145 145 copyfrom-rev="2"
146 146 action="A">/b</path>
147 147 <path
148 148 copyfrom-path="/link"
149 149 copyfrom-rev="2"
150 150 action="A">/newlink</path>
151 151 <path
152 152 action="D">/link</path>
153 153 </paths>
154 154 <msg>rename a file</msg>
155 155 </logentry>
156 156 </log>
157 157 $ ls a a-hg-wc
158 158 a:
159 159 b
160 160 d1
161 161 newlink
162 162
163 163 a-hg-wc:
164 164 b
165 165 d1
166 166 newlink
167 167
168 168 Copy
169 169
170 170 $ hg --cwd a cp b c
171 171
172 172 $ hg --cwd a ci -d '3 0' -m 'copy a file'
173 173 $ hg --cwd a tip -q
174 174 3:0cf087b9ab02
175 175
176 176 $ hg convert -d svn a
177 177 assuming destination a-hg
178 178 initializing svn working copy 'a-hg-wc'
179 179 scanning source...
180 180 sorting...
181 181 converting...
182 182 0 copy a file
183 183 $ svnupanddisplay a-hg-wc 1
184 184 At revision 4.
185 185 4 4 test .
186 186 4 3 test b
187 187 4 4 test c
188 188 4 1 test d1
189 189 4 1 test d1/d2
190 190 4 1 test d1/d2/b
191 191 4 3 test newlink
192 192 <?xml version="1.0"?>
193 193 <log>
194 194 <logentry
195 195 revision="4">
196 196 <author>test</author>
197 197 <date/>
198 198 <paths>
199 199 <path
200 200 copyfrom-path="/b"
201 201 copyfrom-rev="3"
202 202 action="A">/c</path>
203 203 </paths>
204 204 <msg>copy a file</msg>
205 205 </logentry>
206 206 </log>
207 207 $ ls a a-hg-wc
208 208 a:
209 209 b
210 210 c
211 211 d1
212 212 newlink
213 213
214 214 a-hg-wc:
215 215 b
216 216 c
217 217 d1
218 218 newlink
219 219
220 220 $ hg --cwd a rm b
221 221
222 222 Remove
223 223
224 224 $ hg --cwd a ci -d '4 0' -m 'remove a file'
225 225 $ hg --cwd a tip -q
226 226 4:07b2e34a5b17
227 227
228 228 $ hg convert -d svn a
229 229 assuming destination a-hg
230 230 initializing svn working copy 'a-hg-wc'
231 231 scanning source...
232 232 sorting...
233 233 converting...
234 234 0 remove a file
235 235 $ svnupanddisplay a-hg-wc 1
236 236 At revision 5.
237 237 5 5 test .
238 238 5 4 test c
239 239 5 1 test d1
240 240 5 1 test d1/d2
241 241 5 1 test d1/d2/b
242 242 5 3 test newlink
243 243 <?xml version="1.0"?>
244 244 <log>
245 245 <logentry
246 246 revision="5">
247 247 <author>test</author>
248 248 <date/>
249 249 <paths>
250 250 <path
251 251 action="D">/b</path>
252 252 </paths>
253 253 <msg>remove a file</msg>
254 254 </logentry>
255 255 </log>
256 256 $ ls a a-hg-wc
257 257 a:
258 258 c
259 259 d1
260 260 newlink
261 261
262 262 a-hg-wc:
263 263 c
264 264 d1
265 265 newlink
266 266
267 267 Exectutable
268 268
269 269 $ chmod +x a/c
270 270 $ hg --cwd a ci -d '5 0' -m 'make a file executable'
271 271 $ hg --cwd a tip -q
272 272 5:31093672760b
273 273
274 274 $ hg convert -d svn a
275 275 assuming destination a-hg
276 276 initializing svn working copy 'a-hg-wc'
277 277 scanning source...
278 278 sorting...
279 279 converting...
280 280 0 make a file executable
281 281 $ svnupanddisplay a-hg-wc 1
282 282 At revision 6.
283 283 6 6 test .
284 284 6 6 test c
285 285 6 1 test d1
286 286 6 1 test d1/d2
287 287 6 1 test d1/d2/b
288 288 6 3 test newlink
289 289 <?xml version="1.0"?>
290 290 <log>
291 291 <logentry
292 292 revision="6">
293 293 <author>test</author>
294 294 <date/>
295 295 <paths>
296 296 <path
297 297 action="M">/c</path>
298 298 </paths>
299 299 <msg>make a file executable</msg>
300 300 </logentry>
301 301 </log>
302 302 $ test -x a-hg-wc/c
303 303
304 304 Executable in new directory
305 305
306 306 $ rm -rf a a-hg a-hg-wc
307 307 $ hg init a
308 308
309 309 $ mkdir a/d1
310 310 $ echo a > a/d1/a
311 311 $ chmod +x a/d1/a
312 312 $ hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
313 313 adding d1/a
314 314
315 315 $ hg convert -d svn a
316 316 assuming destination a-hg
317 317 initializing svn repository 'a-hg'
318 318 initializing svn working copy 'a-hg-wc'
319 319 scanning source...
320 320 sorting...
321 321 converting...
322 322 0 add executable file in new directory
323 323 $ svnupanddisplay a-hg-wc 1
324 324 At revision 1.
325 325 1 1 test .
326 326 1 1 test d1
327 327 1 1 test d1/a
328 328 <?xml version="1.0"?>
329 329 <log>
330 330 <logentry
331 331 revision="1">
332 332 <author>test</author>
333 333 <date/>
334 334 <paths>
335 335 <path
336 336 action="A">/d1</path>
337 337 <path
338 338 action="A">/d1/a</path>
339 339 </paths>
340 340 <msg>add executable file in new directory</msg>
341 341 </logentry>
342 342 </log>
343 343 $ test -x a-hg-wc/d1/a
344 344
345 345 Copy to new directory
346 346
347 347 $ mkdir a/d2
348 348 $ hg --cwd a cp d1/a d2/a
349 349 $ hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
350 350
351 351 $ hg convert -d svn a
352 352 assuming destination a-hg
353 353 initializing svn working copy 'a-hg-wc'
354 354 scanning source...
355 355 sorting...
356 356 converting...
357 357 0 copy file to new directory
358 358 $ svnupanddisplay a-hg-wc 1
359 359 At revision 2.
360 360 2 2 test .
361 361 2 1 test d1
362 362 2 1 test d1/a
363 363 2 2 test d2
364 364 2 2 test d2/a
365 365 <?xml version="1.0"?>
366 366 <log>
367 367 <logentry
368 368 revision="2">
369 369 <author>test</author>
370 370 <date/>
371 371 <paths>
372 372 <path
373 373 action="A">/d2</path>
374 374 <path
375 375 copyfrom-path="/d1/a"
376 376 copyfrom-rev="1"
377 377 action="A">/d2/a</path>
378 378 </paths>
379 379 <msg>copy file to new directory</msg>
380 380 </logentry>
381 381 </log>
382 382
383 383 Branchy history
384 384
385 385 $ hg init b
386 386 $ echo base > b/b
387 387 $ hg --cwd b ci -d '0 0' -Ambase
388 388 adding b
389 389
390 390 $ "$TESTDIR/svn-safe-append.py" left-1 b/b
391 391 $ echo left-1 > b/left-1
392 392 $ hg --cwd b ci -d '1 0' -Amleft-1
393 393 adding left-1
394 394
395 395 $ "$TESTDIR/svn-safe-append.py" left-2 b/b
396 396 $ echo left-2 > b/left-2
397 397 $ hg --cwd b ci -d '2 0' -Amleft-2
398 398 adding left-2
399 399
400 400 $ hg --cwd b up 0
401 401 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
402 402
403 403 $ "$TESTDIR/svn-safe-append.py" right-1 b/b
404 404 $ echo right-1 > b/right-1
405 405 $ hg --cwd b ci -d '3 0' -Amright-1
406 406 adding right-1
407 407 created new head
408 408
409 409 $ "$TESTDIR/svn-safe-append.py" right-2 b/b
410 410 $ echo right-2 > b/right-2
411 411 $ hg --cwd b ci -d '4 0' -Amright-2
412 412 adding right-2
413 413
414 414 $ hg --cwd b up -C 2
415 415 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
416 416 $ hg --cwd b merge
417 417 merging b
418 418 warning: conflicts during merge.
419 419 merging b failed!
420 420 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
421 421 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
422 422 [1]
423 423 $ hg --cwd b revert -r 2 b
424 424 $ hg resolve -m b
425 425 $ hg --cwd b ci -d '5 0' -m 'merge'
426 426
427 427 Expect 4 changes
428 428
429 429 $ hg convert -d svn b
430 430 assuming destination b-hg
431 431 initializing svn repository 'b-hg'
432 432 initializing svn working copy 'b-hg-wc'
433 433 scanning source...
434 434 sorting...
435 435 converting...
436 436 5 base
437 437 4 left-1
438 438 3 left-2
439 439 2 right-1
440 440 1 right-2
441 441 0 merge
442 442
443 443 $ svnupanddisplay b-hg-wc 0
444 444 At revision 4.
445 445 4 4 test .
446 446 4 3 test b
447 447 4 2 test left-1
448 448 4 3 test left-2
449 449 4 4 test right-1
450 450 4 4 test right-2
451 451 <?xml version="1.0"?>
452 452 <log>
453 453 <logentry
454 454 revision="4">
455 455 <author>test</author>
456 456 <date/>
457 457 <paths>
458 458 <path
459 459 action="A">/right-1</path>
460 460 <path
461 461 action="A">/right-2</path>
462 462 </paths>
463 463 <msg>merge</msg>
464 464 </logentry>
465 465 <logentry
466 466 revision="3">
467 467 <author>test</author>
468 468 <date/>
469 469 <paths>
470 470 <path
471 471 action="M">/b</path>
472 472 <path
473 473 action="A">/left-2</path>
474 474 </paths>
475 475 <msg>left-2</msg>
476 476 </logentry>
477 477 <logentry
478 478 revision="2">
479 479 <author>test</author>
480 480 <date/>
481 481 <paths>
482 482 <path
483 483 action="M">/b</path>
484 484 <path
485 485 action="A">/left-1</path>
486 486 </paths>
487 487 <msg>left-1</msg>
488 488 </logentry>
489 489 <logentry
490 490 revision="1">
491 491 <author>test</author>
492 492 <date/>
493 493 <paths>
494 494 <path
495 495 action="A">/b</path>
496 496 </paths>
497 497 <msg>base</msg>
498 498 </logentry>
499 499 </log>
500 500
501 501 Tags are not supported, but must not break conversion
502 502
503 503 $ rm -rf a a-hg a-hg-wc
504 504 $ hg init a
505 505 $ echo a > a/a
506 506 $ hg --cwd a ci -d '0 0' -A -m 'Add file a'
507 507 adding a
508 508 $ hg --cwd a tag -d '1 0' -m 'Tagged as v1.0' v1.0
509 509
510 510 $ hg convert -d svn a
511 511 assuming destination a-hg
512 512 initializing svn repository 'a-hg'
513 513 initializing svn working copy 'a-hg-wc'
514 514 scanning source...
515 515 sorting...
516 516 converting...
517 517 1 Add file a
518 518 0 Tagged as v1.0
519 519 writing Subversion tags is not yet implemented
520 520 $ svnupanddisplay a-hg-wc 2
521 521 At revision 2.
522 522 2 2 test .
523 523 2 1 test a
524 524 2 2 test .hgtags
525 525 <?xml version="1.0"?>
526 526 <log>
527 527 <logentry
528 528 revision="2">
529 529 <author>test</author>
530 530 <date/>
531 531 <paths>
532 532 <path
533 533 action="A">/.hgtags</path>
534 534 </paths>
535 535 <msg>Tagged as v1.0</msg>
536 536 </logentry>
537 537 <logentry
538 538 revision="1">
539 539 <author>test</author>
540 540 <date/>
541 541 <paths>
542 542 <path
543 543 action="A">/a</path>
544 544 </paths>
545 545 <msg>Add file a</msg>
546 546 </logentry>
547 547 </log>
548 548 $ rm -rf a a-hg a-hg-wc
@@ -1,124 +1,126 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 Setup
2 4
3 5 $ echo "[color]" >> $HGRCPATH
4 6 $ echo "mode = ansi" >> $HGRCPATH
5 7 $ echo "[extensions]" >> $HGRCPATH
6 8 $ echo "color=" >> $HGRCPATH
7 9 $ hg init repo
8 10 $ cd repo
9 11 $ cat > a <<EOF
10 12 > c
11 13 > c
12 14 > a
13 15 > a
14 16 > b
15 17 > a
16 18 > a
17 19 > c
18 20 > c
19 21 > EOF
20 22 $ hg ci -Am adda
21 23 adding a
22 24 $ cat > a <<EOF
23 25 > c
24 26 > c
25 27 > a
26 28 > a
27 29 > dd
28 30 > a
29 31 > a
30 32 > c
31 33 > c
32 34 > EOF
33 35
34 36 default context
35 37
36 38 $ hg diff --nodates --color=always
37 39 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
38 40 \x1b[0;31;1m--- a/a\x1b[0m (esc)
39 41 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
40 42 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
41 43 c
42 44 a
43 45 a
44 46 \x1b[0;31m-b\x1b[0m (esc)
45 47 \x1b[0;32m+dd\x1b[0m (esc)
46 48 a
47 49 a
48 50 c
49 51
50 52 --unified=2
51 53
52 54 $ hg diff --nodates -U 2 --color=always
53 55 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
54 56 \x1b[0;31;1m--- a/a\x1b[0m (esc)
55 57 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
56 58 \x1b[0;35m@@ -3,5 +3,5 @@\x1b[0m (esc)
57 59 a
58 60 a
59 61 \x1b[0;31m-b\x1b[0m (esc)
60 62 \x1b[0;32m+dd\x1b[0m (esc)
61 63 a
62 64 a
63 65
64 66 diffstat
65 67
66 68 $ hg diff --stat --color=always
67 69 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
68 70 1 files changed, 1 insertions(+), 1 deletions(-)
69 71 $ echo "record=" >> $HGRCPATH
70 72 $ echo "[ui]" >> $HGRCPATH
71 73 $ echo "interactive=true" >> $HGRCPATH
72 74 $ echo "[diff]" >> $HGRCPATH
73 75 $ echo "git=True" >> $HGRCPATH
74 76
75 77 record
76 78
77 $ chmod 0755 a
79 $ chmod +x a
78 80 $ hg record --color=always -m moda a <<EOF
79 81 > y
80 82 > y
81 83 > EOF
82 84 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
83 85 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
84 86 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
85 87 1 hunks, 1 lines changed
86 88 \x1b[0;33mexamine changes to 'a'? [Ynsfdaq?]\x1b[0m (esc)
87 89 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
88 90 c
89 91 a
90 92 a
91 93 \x1b[0;31m-b\x1b[0m (esc)
92 94 \x1b[0;32m+dd\x1b[0m (esc)
93 95 a
94 96 a
95 97 c
96 98 \x1b[0;33mrecord this change to 'a'? [Ynsfdaq?]\x1b[0m (esc)
97 99
98 100 $ echo "[extensions]" >> $HGRCPATH
99 101 $ echo "mq=" >> $HGRCPATH
100 102 $ hg rollback
101 103 repository tip rolled back to revision 0 (undo commit)
102 104 working directory now based on revision 0
103 105
104 106 qrecord
105 107
106 108 $ hg qrecord --color=always -m moda patch <<EOF
107 109 > y
108 110 > y
109 111 > EOF
110 112 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
111 113 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
112 114 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
113 115 1 hunks, 1 lines changed
114 116 \x1b[0;33mexamine changes to 'a'? [Ynsfdaq?]\x1b[0m (esc)
115 117 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
116 118 c
117 119 a
118 120 a
119 121 \x1b[0;31m-b\x1b[0m (esc)
120 122 \x1b[0;32m+dd\x1b[0m (esc)
121 123 a
122 124 a
123 125 c
124 126 \x1b[0;33mrecord this change to 'a'? [Ynsfdaq?]\x1b[0m (esc)
@@ -1,282 +1,283 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
1 2
2 3 $ echo "[extensions]" >> $HGRCPATH
3 4 $ echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
4 5 $ echo "[diff]" >> $HGRCPATH
5 6 $ echo "nodates=1" >> $HGRCPATH
6 7
7 8 $ hg init repo
8 9 $ cd repo
9 10
10 11
11 12
12 13 make a combination of new, changed and deleted file
13 14
14 15 $ echo regular > regular
15 16 $ echo rmregular > rmregular
16 17 $ python -c "file('bintoregular', 'wb').write('\0')"
17 18 $ touch rmempty
18 19 $ echo exec > exec
19 20 $ chmod +x exec
20 21 $ echo rmexec > rmexec
21 22 $ chmod +x rmexec
22 23 $ echo setexec > setexec
23 24 $ echo unsetexec > unsetexec
24 25 $ chmod +x unsetexec
25 26 $ echo binary > binary
26 27 $ python -c "file('rmbinary', 'wb').write('\0')"
27 28 $ hg ci -Am addfiles
28 29 adding binary
29 30 adding bintoregular
30 31 adding exec
31 32 adding regular
32 33 adding rmbinary
33 34 adding rmempty
34 35 adding rmexec
35 36 adding rmregular
36 37 adding setexec
37 38 adding unsetexec
38 39 $ echo regular >> regular
39 40 $ echo newregular >> newregular
40 41 $ rm rmempty
41 42 $ touch newempty
42 43 $ rm rmregular
43 44 $ echo exec >> exec
44 45 $ echo newexec > newexec
45 46 $ echo bintoregular > bintoregular
46 47 $ chmod +x newexec
47 48 $ rm rmexec
48 49 $ chmod +x setexec
49 50 $ chmod -x unsetexec
50 51 $ python -c "file('binary', 'wb').write('\0\0')"
51 52 $ python -c "file('newbinary', 'wb').write('\0')"
52 53 $ rm rmbinary
53 54 $ hg addremove -s 0
54 55 adding newbinary
55 56 adding newempty
56 57 adding newexec
57 58 adding newregular
58 59 removing rmbinary
59 60 removing rmempty
60 61 removing rmexec
61 62 removing rmregular
62 63
63 64 git=no: regular diff for all files
64 65
65 66 $ hg autodiff --git=no
66 67 diff -r a66d19b9302d binary
67 68 Binary file binary has changed
68 69 diff -r a66d19b9302d bintoregular
69 70 Binary file bintoregular has changed
70 71 diff -r a66d19b9302d exec
71 72 --- a/exec
72 73 +++ b/exec
73 74 @@ -1,1 +1,2 @@
74 75 exec
75 76 +exec
76 77 diff -r a66d19b9302d newbinary
77 78 Binary file newbinary has changed
78 79 diff -r a66d19b9302d newexec
79 80 --- /dev/null
80 81 +++ b/newexec
81 82 @@ -0,0 +1,1 @@
82 83 +newexec
83 84 diff -r a66d19b9302d newregular
84 85 --- /dev/null
85 86 +++ b/newregular
86 87 @@ -0,0 +1,1 @@
87 88 +newregular
88 89 diff -r a66d19b9302d regular
89 90 --- a/regular
90 91 +++ b/regular
91 92 @@ -1,1 +1,2 @@
92 93 regular
93 94 +regular
94 95 diff -r a66d19b9302d rmbinary
95 96 Binary file rmbinary has changed
96 97 diff -r a66d19b9302d rmexec
97 98 --- a/rmexec
98 99 +++ /dev/null
99 100 @@ -1,1 +0,0 @@
100 101 -rmexec
101 102 diff -r a66d19b9302d rmregular
102 103 --- a/rmregular
103 104 +++ /dev/null
104 105 @@ -1,1 +0,0 @@
105 106 -rmregular
106 107
107 108 git=yes: git diff for single regular file
108 109
109 110 $ hg autodiff --git=yes regular
110 111 diff --git a/regular b/regular
111 112 --- a/regular
112 113 +++ b/regular
113 114 @@ -1,1 +1,2 @@
114 115 regular
115 116 +regular
116 117
117 118 git=auto: regular diff for regular files and non-binary removals
118 119
119 120 $ hg autodiff --git=auto regular newregular rmregular rmexec
120 121 diff -r a66d19b9302d newregular
121 122 --- /dev/null
122 123 +++ b/newregular
123 124 @@ -0,0 +1,1 @@
124 125 +newregular
125 126 diff -r a66d19b9302d regular
126 127 --- a/regular
127 128 +++ b/regular
128 129 @@ -1,1 +1,2 @@
129 130 regular
130 131 +regular
131 132 diff -r a66d19b9302d rmexec
132 133 --- a/rmexec
133 134 +++ /dev/null
134 135 @@ -1,1 +0,0 @@
135 136 -rmexec
136 137 diff -r a66d19b9302d rmregular
137 138 --- a/rmregular
138 139 +++ /dev/null
139 140 @@ -1,1 +0,0 @@
140 141 -rmregular
141 142
142 143 $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty rmbinary bintoregular; do
143 144 > echo
144 145 > echo '% git=auto: git diff for' $f
145 146 > hg autodiff --git=auto $f
146 147 > done
147 148
148 149 % git=auto: git diff for exec
149 150 diff -r a66d19b9302d exec
150 151 --- a/exec
151 152 +++ b/exec
152 153 @@ -1,1 +1,2 @@
153 154 exec
154 155 +exec
155 156
156 157 % git=auto: git diff for newexec
157 158 diff --git a/newexec b/newexec
158 159 new file mode 100755
159 160 --- /dev/null
160 161 +++ b/newexec
161 162 @@ -0,0 +1,1 @@
162 163 +newexec
163 164
164 165 % git=auto: git diff for setexec
165 166 diff --git a/setexec b/setexec
166 167 old mode 100644
167 168 new mode 100755
168 169
169 170 % git=auto: git diff for unsetexec
170 171 diff --git a/unsetexec b/unsetexec
171 172 old mode 100755
172 173 new mode 100644
173 174
174 175 % git=auto: git diff for binary
175 176 diff --git a/binary b/binary
176 177 index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
177 178 GIT binary patch
178 179 literal 2
179 180 Jc${Nk0000200961
180 181
181 182
182 183 % git=auto: git diff for newbinary
183 184 diff --git a/newbinary b/newbinary
184 185 new file mode 100644
185 186 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d
186 187 GIT binary patch
187 188 literal 1
188 189 Ic${MZ000310RR91
189 190
190 191
191 192 % git=auto: git diff for newempty
192 193 diff --git a/newempty b/newempty
193 194 new file mode 100644
194 195
195 196 % git=auto: git diff for rmempty
196 197 diff --git a/rmempty b/rmempty
197 198 deleted file mode 100644
198 199
199 200 % git=auto: git diff for rmbinary
200 201 diff --git a/rmbinary b/rmbinary
201 202 deleted file mode 100644
202 203 Binary file rmbinary has changed
203 204
204 205 % git=auto: git diff for bintoregular
205 206 diff --git a/bintoregular b/bintoregular
206 207 index f76dd238ade08917e6712764a16a22005a50573d..9c42f2b6427d8bf034b7bc23986152dc01bfd3ab
207 208 GIT binary patch
208 209 literal 13
209 210 Uc$`bh%qz(+N=+}#Ni5<5043uE82|tP
210 211
211 212
212 213 git=warn: regular diff with data loss warnings
213 214
214 215 $ hg autodiff --git=warn
215 216 diff -r a66d19b9302d binary
216 217 Binary file binary has changed
217 218 diff -r a66d19b9302d bintoregular
218 219 Binary file bintoregular has changed
219 220 diff -r a66d19b9302d exec
220 221 --- a/exec
221 222 +++ b/exec
222 223 @@ -1,1 +1,2 @@
223 224 exec
224 225 +exec
225 226 diff -r a66d19b9302d newbinary
226 227 Binary file newbinary has changed
227 228 diff -r a66d19b9302d newexec
228 229 --- /dev/null
229 230 +++ b/newexec
230 231 @@ -0,0 +1,1 @@
231 232 +newexec
232 233 diff -r a66d19b9302d newregular
233 234 --- /dev/null
234 235 +++ b/newregular
235 236 @@ -0,0 +1,1 @@
236 237 +newregular
237 238 diff -r a66d19b9302d regular
238 239 --- a/regular
239 240 +++ b/regular
240 241 @@ -1,1 +1,2 @@
241 242 regular
242 243 +regular
243 244 diff -r a66d19b9302d rmbinary
244 245 Binary file rmbinary has changed
245 246 diff -r a66d19b9302d rmexec
246 247 --- a/rmexec
247 248 +++ /dev/null
248 249 @@ -1,1 +0,0 @@
249 250 -rmexec
250 251 diff -r a66d19b9302d rmregular
251 252 --- a/rmregular
252 253 +++ /dev/null
253 254 @@ -1,1 +0,0 @@
254 255 -rmregular
255 256 data lost for: binary
256 257 data lost for: bintoregular
257 258 data lost for: newbinary
258 259 data lost for: newempty
259 260 data lost for: newexec
260 261 data lost for: rmbinary
261 262 data lost for: rmempty
262 263 data lost for: setexec
263 264 data lost for: unsetexec
264 265
265 266 git=abort: fail on execute bit change
266 267
267 268 $ hg autodiff --git=abort regular setexec
268 269 abort: losing data for setexec
269 270 [255]
270 271
271 272 git=abort: succeed on regular file
272 273
273 274 $ hg autodiff --git=abort regular
274 275 diff -r a66d19b9302d regular
275 276 --- a/regular
276 277 +++ b/regular
277 278 @@ -1,1 +1,2 @@
278 279 regular
279 280 +regular
280 281
281 282 $ cd ..
282 283
@@ -1,198 +1,198 b''
1 $ "$TESTDIR/hghave" symlink || exit 80
1 $ "$TESTDIR/hghave" symlink execbit || exit 80
2 2
3 3 $ echo "[extensions]" >> $HGRCPATH
4 4 $ echo "extdiff=" >> $HGRCPATH
5 5
6 6 $ hg init a
7 7 $ cd a
8 8 $ echo a > a
9 9 $ echo b > b
10 10 $ hg add
11 11 adding a
12 12 adding b
13 13
14 14 Should diff cloned directories:
15 15
16 16 $ hg extdiff -o -r $opt
17 17 Only in a: a
18 18 Only in a: b
19 19 [1]
20 20
21 21 $ echo "[extdiff]" >> $HGRCPATH
22 22 $ echo "cmd.falabala=echo" >> $HGRCPATH
23 23 $ echo "opts.falabala=diffing" >> $HGRCPATH
24 24
25 25 $ hg falabala
26 26 diffing a.000000000000 a
27 27 [1]
28 28
29 29 $ hg help falabala
30 30 hg falabala [OPTION]... [FILE]...
31 31
32 32 use 'echo' to diff repository (or selected files)
33 33
34 34 Show differences between revisions for the specified files, using the
35 35 'echo' program.
36 36
37 37 When two revision arguments are given, then changes are shown between
38 38 those revisions. If only one revision is specified then that revision is
39 39 compared to the working directory, and, when no revisions are specified,
40 40 the working directory files are compared to its parent.
41 41
42 42 options:
43 43
44 44 -o --option OPT [+] pass option to comparison program
45 45 -r --rev REV [+] revision
46 46 -c --change REV change made by revision
47 47 -I --include PATTERN [+] include names matching the given patterns
48 48 -X --exclude PATTERN [+] exclude names matching the given patterns
49 49
50 50 [+] marked option can be specified multiple times
51 51
52 52 use "hg -v help falabala" to show more info
53 53
54 54 $ hg ci -d '0 0' -mtest1
55 55
56 56 $ echo b >> a
57 57 $ hg ci -d '1 0' -mtest2
58 58
59 59 Should diff cloned files directly:
60 60
61 61 $ hg falabala -r 0:1
62 62 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
63 63 [1]
64 64
65 65 Test diff during merge:
66 66
67 67 $ hg update -C 0
68 68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 69 $ echo c >> c
70 70 $ hg add c
71 71 $ hg ci -m "new branch" -d '1 0'
72 72 created new head
73 73 $ hg merge 1
74 74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 75 (branch merge, don't forget to commit)
76 76
77 77 Should diff cloned file against wc file:
78 78
79 79 $ hg falabala
80 80 diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob)
81 81 [1]
82 82
83 83
84 84 Test --change option:
85 85
86 86 $ hg ci -d '2 0' -mtest3
87 87 $ hg falabala -c 1
88 88 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
89 89 [1]
90 90
91 91 Check diff are made from the first parent:
92 92
93 93 $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
94 94 diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob)
95 95 diff-like tools yield a non-zero exit code
96 96
97 97 Test extdiff of multiple files in tmp dir:
98 98
99 99 $ hg update -C 0 > /dev/null
100 100 $ echo changed > a
101 101 $ echo changed > b
102 102 $ chmod +x b
103 103
104 104 Diff in working directory, before:
105 105
106 106 $ hg diff --git
107 107 diff --git a/a b/a
108 108 --- a/a
109 109 +++ b/a
110 110 @@ -1,1 +1,1 @@
111 111 -a
112 112 +changed
113 113 diff --git a/b b/b
114 114 old mode 100644
115 115 new mode 100755
116 116 --- a/b
117 117 +++ b/b
118 118 @@ -1,1 +1,1 @@
119 119 -b
120 120 +changed
121 121
122 122
123 123 Edit with extdiff -p:
124 124
125 125 Prepare custom diff/edit tool:
126 126
127 127 $ cat > 'diff tool.py' << EOT
128 128 > #!/usr/bin/env python
129 129 > import time
130 130 > time.sleep(1) # avoid unchanged-timestamp problems
131 131 > file('a/a', 'ab').write('edited\n')
132 132 > file('a/b', 'ab').write('edited\n')
133 133 > EOT
134 134
135 135 $ chmod +x 'diff tool.py'
136 136
137 137 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
138 138 and start tool
139 139
140 140 $ hg extdiff -p "`pwd`/diff tool.py"
141 141 [1]
142 142
143 143 Diff in working directory, after:
144 144
145 145 $ hg diff --git
146 146 diff --git a/a b/a
147 147 --- a/a
148 148 +++ b/a
149 149 @@ -1,1 +1,2 @@
150 150 -a
151 151 +changed
152 152 +edited
153 153 diff --git a/b b/b
154 154 old mode 100644
155 155 new mode 100755
156 156 --- a/b
157 157 +++ b/b
158 158 @@ -1,1 +1,2 @@
159 159 -b
160 160 +changed
161 161 +edited
162 162
163 163 Test extdiff with --option:
164 164
165 165 $ hg extdiff -p echo -o this -c 1
166 166 this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
167 167 [1]
168 168
169 169 $ hg falabala -o this -c 1
170 170 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
171 171 [1]
172 172
173 173 Test with revsets:
174 174
175 175 $ hg extdif -p echo -c "rev(1)"
176 176 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
177 177 [1]
178 178
179 179 $ hg extdif -p echo -r "0::1"
180 180 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
181 181 [1]
182 182
183 183 $ cd ..
184 184
185 185 Test symlinks handling (issue1909)
186 186
187 187 $ hg init testsymlinks
188 188 $ cd testsymlinks
189 189 $ echo a > a
190 190 $ hg ci -Am adda
191 191 adding a
192 192 $ echo a >> a
193 193 $ ln -s missing linka
194 194 $ hg add linka
195 195 $ hg falabala -r 0 --traceback
196 196 diffing testsymlinks.07f494440405 testsymlinks
197 197 [1]
198 198 $ cd ..
@@ -1,147 +1,149 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 $ umask 027
2 4
3 5 $ hg init test1
4 6 $ cd test1
5 7 $ touch a b
6 8 $ hg add a b
7 9 $ hg ci -m "added a b"
8 10
9 11 $ cd ..
10 12 $ hg clone test1 test3
11 13 updating to branch default
12 14 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 15
14 16 $ hg init test2
15 17 $ cd test2
16 18 $ hg pull ../test1
17 19 pulling from ../test1
18 20 requesting all changes
19 21 adding changesets
20 22 adding manifests
21 23 adding file changes
22 24 added 1 changesets with 2 changes to 2 files
23 25 (run 'hg update' to get a working copy)
24 26 $ hg co
25 27 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 28 $ chmod +x a
27 29 $ hg ci -m "chmod +x a"
28 30
29 31 the changelog should mention file a:
30 32
31 33 $ hg tip --template '{files}\n'
32 34 a
33 35
34 36 $ cd ../test1
35 37 $ echo 123 >>a
36 38 $ hg ci -m "a updated"
37 39
38 40 $ hg pull ../test2
39 41 pulling from ../test2
40 42 searching for changes
41 43 adding changesets
42 44 adding manifests
43 45 adding file changes
44 46 added 1 changesets with 0 changes to 0 files (+1 heads)
45 47 (run 'hg heads' to see heads, 'hg merge' to merge)
46 48 $ hg heads
47 49 changeset: 2:7f4313b42a34
48 50 tag: tip
49 51 parent: 0:22a449e20da5
50 52 user: test
51 53 date: Thu Jan 01 00:00:00 1970 +0000
52 54 summary: chmod +x a
53 55
54 56 changeset: 1:c6ecefc45368
55 57 user: test
56 58 date: Thu Jan 01 00:00:00 1970 +0000
57 59 summary: a updated
58 60
59 61 $ hg history
60 62 changeset: 2:7f4313b42a34
61 63 tag: tip
62 64 parent: 0:22a449e20da5
63 65 user: test
64 66 date: Thu Jan 01 00:00:00 1970 +0000
65 67 summary: chmod +x a
66 68
67 69 changeset: 1:c6ecefc45368
68 70 user: test
69 71 date: Thu Jan 01 00:00:00 1970 +0000
70 72 summary: a updated
71 73
72 74 changeset: 0:22a449e20da5
73 75 user: test
74 76 date: Thu Jan 01 00:00:00 1970 +0000
75 77 summary: added a b
76 78
77 79
78 80 $ hg -v merge
79 81 resolving manifests
80 82 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 83 (branch merge, don't forget to commit)
82 84
83 85 $ cd ../test3
84 86 $ echo 123 >>b
85 87 $ hg ci -m "b updated"
86 88
87 89 $ hg pull ../test2
88 90 pulling from ../test2
89 91 searching for changes
90 92 adding changesets
91 93 adding manifests
92 94 adding file changes
93 95 added 1 changesets with 0 changes to 0 files (+1 heads)
94 96 (run 'hg heads' to see heads, 'hg merge' to merge)
95 97 $ hg heads
96 98 changeset: 2:7f4313b42a34
97 99 tag: tip
98 100 parent: 0:22a449e20da5
99 101 user: test
100 102 date: Thu Jan 01 00:00:00 1970 +0000
101 103 summary: chmod +x a
102 104
103 105 changeset: 1:dc57ead75f79
104 106 user: test
105 107 date: Thu Jan 01 00:00:00 1970 +0000
106 108 summary: b updated
107 109
108 110 $ hg history
109 111 changeset: 2:7f4313b42a34
110 112 tag: tip
111 113 parent: 0:22a449e20da5
112 114 user: test
113 115 date: Thu Jan 01 00:00:00 1970 +0000
114 116 summary: chmod +x a
115 117
116 118 changeset: 1:dc57ead75f79
117 119 user: test
118 120 date: Thu Jan 01 00:00:00 1970 +0000
119 121 summary: b updated
120 122
121 123 changeset: 0:22a449e20da5
122 124 user: test
123 125 date: Thu Jan 01 00:00:00 1970 +0000
124 126 summary: added a b
125 127
126 128
127 129 $ hg -v merge
128 130 resolving manifests
129 131 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 132 (branch merge, don't forget to commit)
131 133
132 134 $ ls -l ../test[123]/a > foo
133 135 $ cut -b 1-10 < foo
134 136 -rwxr-x---
135 137 -rwxr-x---
136 138 -rwxr-x---
137 139
138 140 $ hg debugindex a
139 141 rev offset length base linkrev nodeid p1 p2
140 142 0 0 0 0 0 b80de5d13875 000000000000 000000000000
141 143 $ hg debugindex -R ../test2 a
142 144 rev offset length base linkrev nodeid p1 p2
143 145 0 0 0 0 0 b80de5d13875 000000000000 000000000000
144 146 $ hg debugindex -R ../test1 a
145 147 rev offset length base linkrev nodeid p1 p2
146 148 0 0 0 0 0 b80de5d13875 000000000000 000000000000
147 149 1 0 5 1 1 7fe919cc0336 b80de5d13875 000000000000
@@ -1,349 +1,351 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 $ hg init
2 4 $ echo start > start
3 5 $ hg ci -Amstart
4 6 adding start
5 7
6 8 New file:
7 9
8 10 $ echo new > new
9 11 $ hg ci -Amnew
10 12 adding new
11 13 $ hg diff --git -r 0
12 14 diff --git a/new b/new
13 15 new file mode 100644
14 16 --- /dev/null
15 17 +++ b/new
16 18 @@ -0,0 +1,1 @@
17 19 +new
18 20
19 21 Copy:
20 22
21 23 $ hg cp new copy
22 24 $ hg ci -mcopy
23 25 $ hg diff --git -r 1:tip
24 26 diff --git a/new b/copy
25 27 copy from new
26 28 copy to copy
27 29
28 30 Rename:
29 31
30 32 $ hg mv copy rename
31 33 $ hg ci -mrename
32 34 $ hg diff --git -r 2:tip
33 35 diff --git a/copy b/rename
34 36 rename from copy
35 37 rename to rename
36 38
37 39 Delete:
38 40
39 41 $ hg rm rename
40 42 $ hg ci -mdelete
41 43 $ hg diff --git -r 3:tip
42 44 diff --git a/rename b/rename
43 45 deleted file mode 100644
44 46 --- a/rename
45 47 +++ /dev/null
46 48 @@ -1,1 +0,0 @@
47 49 -new
48 50
49 51 $ cat > src <<EOF
50 52 > 1
51 53 > 2
52 54 > 3
53 55 > 4
54 56 > 5
55 57 > EOF
56 58 $ hg ci -Amsrc
57 59 adding src
58 60
59 61 chmod 644:
60 62
61 63 $ chmod +x src
62 64 $ hg ci -munexec
63 65 $ hg diff --git -r 5:tip
64 66 diff --git a/src b/src
65 67 old mode 100644
66 68 new mode 100755
67 69
68 70 Rename+mod+chmod:
69 71
70 72 $ hg mv src dst
71 73 $ chmod -x dst
72 74 $ echo a >> dst
73 75 $ hg ci -mrenamemod
74 76 $ hg diff --git -r 6:tip
75 77 diff --git a/src b/dst
76 78 old mode 100755
77 79 new mode 100644
78 80 rename from src
79 81 rename to dst
80 82 --- a/src
81 83 +++ b/dst
82 84 @@ -3,3 +3,4 @@
83 85 3
84 86 4
85 87 5
86 88 +a
87 89
88 90 Nonexistent in tip+chmod:
89 91
90 92 $ hg diff --git -r 5:6
91 93 diff --git a/src b/src
92 94 old mode 100644
93 95 new mode 100755
94 96
95 97 Binary diff:
96 98
97 99 $ cp $TESTDIR/binfile.bin .
98 100 $ hg add binfile.bin
99 101 $ hg diff --git > b.diff
100 102 $ cat b.diff
101 103 diff --git a/binfile.bin b/binfile.bin
102 104 new file mode 100644
103 105 index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
104 106 GIT binary patch
105 107 literal 593
106 108 zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
107 109 z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
108 110 zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
109 111 z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
110 112 zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
111 113 ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
112 114 zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
113 115 z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
114 116 zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
115 117 z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
116 118 zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
117 119 fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
118 120
119 121
120 122 Import binary diff:
121 123
122 124 $ hg revert binfile.bin
123 125 $ rm binfile.bin
124 126 $ hg import -mfoo b.diff
125 127 applying b.diff
126 128 $ cmp binfile.bin $TESTDIR/binfile.bin
127 129
128 130 Rename binary file:
129 131
130 132 $ hg mv binfile.bin renamed.bin
131 133 $ hg diff --git
132 134 diff --git a/binfile.bin b/renamed.bin
133 135 rename from binfile.bin
134 136 rename to renamed.bin
135 137
136 138 Diff across many revisions:
137 139
138 140 $ hg mv dst dst2
139 141 $ hg ci -m 'mv dst dst2'
140 142
141 143 $ echo >> start
142 144 $ hg ci -m 'change start'
143 145
144 146 $ hg revert -r -2 start
145 147 $ hg mv dst2 dst3
146 148 $ hg ci -m 'mv dst2 dst3; revert start'
147 149
148 150 $ hg diff --git -r 9:11
149 151 diff --git a/dst2 b/dst3
150 152 rename from dst2
151 153 rename to dst3
152 154
153 155 Reversed:
154 156
155 157 $ hg diff --git -r 11:9
156 158 diff --git a/dst3 b/dst2
157 159 rename from dst3
158 160 rename to dst2
159 161
160 162
161 163 $ echo a >> foo
162 164 $ hg add foo
163 165 $ hg ci -m 'add foo'
164 166 $ echo b >> foo
165 167 $ hg ci -m 'change foo'
166 168 $ hg mv foo bar
167 169 $ hg ci -m 'mv foo bar'
168 170 $ echo c >> bar
169 171 $ hg ci -m 'change bar'
170 172
171 173 File created before r1 and renamed before r2:
172 174
173 175 $ hg diff --git -r -3:-1
174 176 diff --git a/foo b/bar
175 177 rename from foo
176 178 rename to bar
177 179 --- a/foo
178 180 +++ b/bar
179 181 @@ -1,2 +1,3 @@
180 182 a
181 183 b
182 184 +c
183 185
184 186 Reversed:
185 187
186 188 $ hg diff --git -r -1:-3
187 189 diff --git a/bar b/foo
188 190 rename from bar
189 191 rename to foo
190 192 --- a/bar
191 193 +++ b/foo
192 194 @@ -1,3 +1,2 @@
193 195 a
194 196 b
195 197 -c
196 198
197 199 File created in r1 and renamed before r2:
198 200
199 201 $ hg diff --git -r -4:-1
200 202 diff --git a/foo b/bar
201 203 rename from foo
202 204 rename to bar
203 205 --- a/foo
204 206 +++ b/bar
205 207 @@ -1,1 +1,3 @@
206 208 a
207 209 +b
208 210 +c
209 211
210 212 Reversed:
211 213
212 214 $ hg diff --git -r -1:-4
213 215 diff --git a/bar b/foo
214 216 rename from bar
215 217 rename to foo
216 218 --- a/bar
217 219 +++ b/foo
218 220 @@ -1,3 +1,1 @@
219 221 a
220 222 -b
221 223 -c
222 224
223 225 File created after r1 and renamed before r2:
224 226
225 227 $ hg diff --git -r -5:-1
226 228 diff --git a/bar b/bar
227 229 new file mode 100644
228 230 --- /dev/null
229 231 +++ b/bar
230 232 @@ -0,0 +1,3 @@
231 233 +a
232 234 +b
233 235 +c
234 236
235 237 Reversed:
236 238
237 239 $ hg diff --git -r -1:-5
238 240 diff --git a/bar b/bar
239 241 deleted file mode 100644
240 242 --- a/bar
241 243 +++ /dev/null
242 244 @@ -1,3 +0,0 @@
243 245 -a
244 246 -b
245 247 -c
246 248
247 249
248 250 Comparing with the working dir:
249 251
250 252 $ echo >> start
251 253 $ hg ci -m 'change start again'
252 254
253 255 $ echo > created
254 256 $ hg add created
255 257 $ hg ci -m 'add created'
256 258
257 259 $ hg mv created created2
258 260 $ hg ci -m 'mv created created2'
259 261
260 262 $ hg mv created2 created3
261 263
262 264 There's a copy in the working dir:
263 265
264 266 $ hg diff --git
265 267 diff --git a/created2 b/created3
266 268 rename from created2
267 269 rename to created3
268 270
269 271 There's another copy between the original rev and the wd:
270 272
271 273 $ hg diff --git -r -2
272 274 diff --git a/created b/created3
273 275 rename from created
274 276 rename to created3
275 277
276 278 The source of the copy was created after the original rev:
277 279
278 280 $ hg diff --git -r -3
279 281 diff --git a/created3 b/created3
280 282 new file mode 100644
281 283 --- /dev/null
282 284 +++ b/created3
283 285 @@ -0,0 +1,1 @@
284 286 +
285 287 $ hg ci -m 'mv created2 created3'
286 288
287 289
288 290 $ echo > brand-new
289 291 $ hg add brand-new
290 292 $ hg ci -m 'add brand-new'
291 293 $ hg mv brand-new brand-new2
292 294
293 295 Created in parent of wd; renamed in the wd:
294 296
295 297 $ hg diff --git
296 298 diff --git a/brand-new b/brand-new2
297 299 rename from brand-new
298 300 rename to brand-new2
299 301
300 302 Created between r1 and parent of wd; renamed in the wd:
301 303
302 304 $ hg diff --git -r -2
303 305 diff --git a/brand-new2 b/brand-new2
304 306 new file mode 100644
305 307 --- /dev/null
306 308 +++ b/brand-new2
307 309 @@ -0,0 +1,1 @@
308 310 +
309 311 $ hg ci -m 'mv brand-new brand-new2'
310 312
311 313 One file is copied to many destinations and removed:
312 314
313 315 $ hg cp brand-new2 brand-new3
314 316 $ hg mv brand-new2 brand-new3-2
315 317 $ hg ci -m 'multiple renames/copies'
316 318 $ hg diff --git -r -2 -r -1
317 319 diff --git a/brand-new2 b/brand-new3
318 320 rename from brand-new2
319 321 rename to brand-new3
320 322 diff --git a/brand-new2 b/brand-new3-2
321 323 copy from brand-new2
322 324 copy to brand-new3-2
323 325
324 326 Reversed:
325 327
326 328 $ hg diff --git -r -1 -r -2
327 329 diff --git a/brand-new3 b/brand-new2
328 330 rename from brand-new3
329 331 rename to brand-new2
330 332 diff --git a/brand-new3-2 b/brand-new3-2
331 333 deleted file mode 100644
332 334 --- a/brand-new3-2
333 335 +++ /dev/null
334 336 @@ -1,1 +0,0 @@
335 337 -
336 338
337 339 There should be a trailing TAB if there are spaces in the file name:
338 340
339 341 $ echo foo > 'with spaces'
340 342 $ hg add 'with spaces'
341 343 $ hg diff --git
342 344 diff --git a/with spaces b/with spaces
343 345 new file mode 100644
344 346 --- /dev/null
345 347 +++ b/with spaces
346 348 @@ -0,0 +1,1 @@
347 349 +foo
348 350 $ hg ci -m 'add filename with spaces'
349 351
@@ -1,555 +1,557 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 setting up repo
2 4
3 5 $ hg init test
4 6 $ cd test
5 7 $ echo a > a
6 8 $ echo b > b
7 9 $ hg ci -Ama
8 10 adding a
9 11 adding b
10 12
11 13 change permissions for git diffs
12 14
13 $ chmod 755 a
15 $ chmod +x a
14 16 $ hg ci -Amb
15 17
16 18 set up hgweb
17 19
18 20 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
19 21 $ cat hg.pid >> $DAEMON_PIDS
20 22
21 23 revision
22 24
23 25 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
24 26 200 Script output follows
25 27
26 28 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
27 29 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
28 30 <head>
29 31 <link rel="icon" href="/static/hgicon.png" type="image/png" />
30 32 <meta name="robots" content="index, nofollow" />
31 33 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
32 34 <script type="text/javascript" src="/static/mercurial.js"></script>
33 35
34 36 <title>test: 0cd96de13884</title>
35 37 </head>
36 38 <body>
37 39 <div class="container">
38 40 <div class="menu">
39 41 <div class="logo">
40 42 <a href="http://mercurial.selenic.com/">
41 43 <img src="/static/hglogo.png" alt="mercurial" /></a>
42 44 </div>
43 45 <ul>
44 46 <li><a href="/shortlog/0cd96de13884">log</a></li>
45 47 <li><a href="/graph/0cd96de13884">graph</a></li>
46 48 <li><a href="/tags">tags</a></li>
47 49 <li><a href="/bookmarks">bookmarks</a></li>
48 50 <li><a href="/branches">branches</a></li>
49 51 </ul>
50 52 <ul>
51 53 <li class="active">changeset</li>
52 54 <li><a href="/raw-rev/0cd96de13884">raw</a></li>
53 55 <li><a href="/file/0cd96de13884">browse</a></li>
54 56 </ul>
55 57 <ul>
56 58
57 59 </ul>
58 60 <ul>
59 61 <li><a href="/help">help</a></li>
60 62 </ul>
61 63 </div>
62 64
63 65 <div class="main">
64 66
65 67 <h2><a href="/">test</a></h2>
66 68 <h3>changeset 0:0cd96de13884 </h3>
67 69
68 70 <form class="search" action="/log">
69 71
70 72 <p><input name="rev" id="search1" type="text" size="30" /></p>
71 73 <div id="hint">find changesets by author, revision,
72 74 files, or words in the commit message</div>
73 75 </form>
74 76
75 77 <div class="description">a</div>
76 78
77 79 <table id="changesetEntry">
78 80 <tr>
79 81 <th class="author">author</th>
80 82 <td class="author">&#116;&#101;&#115;&#116;</td>
81 83 </tr>
82 84 <tr>
83 85 <th class="date">date</th>
84 86 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td></tr>
85 87 <tr>
86 88 <th class="author">parents</th>
87 89 <td class="author"></td>
88 90 </tr>
89 91 <tr>
90 92 <th class="author">children</th>
91 93 <td class="author"> <a href="/rev/78e4ebad7cdf">78e4ebad7cdf</a></td>
92 94 </tr>
93 95 <tr>
94 96 <th class="files">files</th>
95 97 <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
96 98 </tr>
97 99 <tr>
98 100 <th class="diffstat">diffstat</th>
99 101 <td class="diffstat">
100 102 2 files changed, 2 insertions(+), 0 deletions(-)
101 103
102 104 <a id="diffstatexpand" href="javascript:showDiffstat()"/>[<tt>+</tt>]</a>
103 105 <div id="diffstatdetails" style="display:none;">
104 106 <a href="javascript:hideDiffstat()"/>[<tt>-</tt>]</a>
105 107 <p>
106 108 <table> <tr class="parity0">
107 109 <td class="diffstat-file"><a href="#l1.1">a</a></td>
108 110 <td class="diffstat-total" align="right">1</td>
109 111 <td class="diffstat-graph">
110 112 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
111 113 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
112 114 </td>
113 115 </tr>
114 116 <tr class="parity1">
115 117 <td class="diffstat-file"><a href="#l2.1">b</a></td>
116 118 <td class="diffstat-total" align="right">1</td>
117 119 <td class="diffstat-graph">
118 120 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
119 121 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
120 122 </td>
121 123 </tr>
122 124 </table>
123 125 </div>
124 126 </td>
125 127 </tr>
126 128 </table>
127 129
128 130 <div class="overflow">
129 131 <div class="sourcefirst"> line diff</div>
130 132
131 133 <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
132 134 </span><a href="#l1.2" id="l1.2"> 1.2</a> <span class="plusline">+++ b/a Thu Jan 01 00:00:00 1970 +0000
133 135 </span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="atline">@@ -0,0 +1,1 @@
134 136 </span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="plusline">+a
135 137 </span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1"> 2.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
136 138 </span><a href="#l2.2" id="l2.2"> 2.2</a> <span class="plusline">+++ b/b Thu Jan 01 00:00:00 1970 +0000
137 139 </span><a href="#l2.3" id="l2.3"> 2.3</a> <span class="atline">@@ -0,0 +1,1 @@
138 140 </span><a href="#l2.4" id="l2.4"> 2.4</a> <span class="plusline">+b
139 141 </span></pre></div>
140 142 </div>
141 143
142 144 </div>
143 145 </div>
144 146 <script type="text/javascript">process_dates()</script>
145 147
146 148
147 149 </body>
148 150 </html>
149 151
150 152
151 153 raw revision
152 154
153 155 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0'
154 156 200 Script output follows
155 157
156 158
157 159 # HG changeset patch
158 160 # User test
159 161 # Date 0 0
160 162 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
161 163
162 164 a
163 165
164 166 diff -r 000000000000 -r 0cd96de13884 a
165 167 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
166 168 +++ b/a Thu Jan 01 00:00:00 1970 +0000
167 169 @@ -0,0 +1,1 @@
168 170 +a
169 171 diff -r 000000000000 -r 0cd96de13884 b
170 172 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
171 173 +++ b/b Thu Jan 01 00:00:00 1970 +0000
172 174 @@ -0,0 +1,1 @@
173 175 +b
174 176
175 177
176 178 diff removed file
177 179
178 180 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
179 181 200 Script output follows
180 182
181 183 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
182 184 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
183 185 <head>
184 186 <link rel="icon" href="/static/hgicon.png" type="image/png" />
185 187 <meta name="robots" content="index, nofollow" />
186 188 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
187 189 <script type="text/javascript" src="/static/mercurial.js"></script>
188 190
189 191 <title>test: a diff</title>
190 192 </head>
191 193 <body>
192 194
193 195 <div class="container">
194 196 <div class="menu">
195 197 <div class="logo">
196 198 <a href="http://mercurial.selenic.com/">
197 199 <img src="/static/hglogo.png" alt="mercurial" /></a>
198 200 </div>
199 201 <ul>
200 202 <li><a href="/shortlog/78e4ebad7cdf">log</a></li>
201 203 <li><a href="/graph/78e4ebad7cdf">graph</a></li>
202 204 <li><a href="/tags">tags</a></li>
203 205 <li><a href="/bookmarks">bookmarks</a></li>
204 206 <li><a href="/branches">branches</a></li>
205 207 </ul>
206 208 <ul>
207 209 <li><a href="/rev/78e4ebad7cdf">changeset</a></li>
208 210 <li><a href="/file/78e4ebad7cdf">browse</a></li>
209 211 </ul>
210 212 <ul>
211 213 <li><a href="/file/78e4ebad7cdf/a">file</a></li>
212 214 <li><a href="/file/tip/a">latest</a></li>
213 215 <li class="active">diff</li>
214 216 <li><a href="/annotate/78e4ebad7cdf/a">annotate</a></li>
215 217 <li><a href="/log/78e4ebad7cdf/a">file log</a></li>
216 218 <li><a href="/raw-file/78e4ebad7cdf/a">raw</a></li>
217 219 </ul>
218 220 <ul>
219 221 <li><a href="/help">help</a></li>
220 222 </ul>
221 223 </div>
222 224
223 225 <div class="main">
224 226 <h2><a href="/">test</a></h2>
225 227 <h3>diff a @ 1:78e4ebad7cdf</h3>
226 228
227 229 <form class="search" action="/log">
228 230 <p></p>
229 231 <p><input name="rev" id="search1" type="text" size="30" /></p>
230 232 <div id="hint">find changesets by author, revision,
231 233 files, or words in the commit message</div>
232 234 </form>
233 235
234 236 <div class="description">b</div>
235 237
236 238 <table id="changesetEntry">
237 239 <tr>
238 240 <th>author</th>
239 241 <td>&#116;&#101;&#115;&#116;</td>
240 242 </tr>
241 243 <tr>
242 244 <th>date</th>
243 245 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
244 246 </tr>
245 247 <tr>
246 248 <th>parents</th>
247 249 <td></td>
248 250 </tr>
249 251 <tr>
250 252 <th>children</th>
251 253 <td></td>
252 254 </tr>
253 255
254 256 </table>
255 257
256 258 <div class="overflow">
257 259 <div class="sourcefirst"> line diff</div>
258 260
259 261 <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
260 262 </span><a href="#l1.2" id="l1.2"> 1.2</a> <span class="plusline">+++ b/a Thu Jan 01 00:00:00 1970 +0000
261 263 </span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="atline">@@ -0,0 +1,1 @@
262 264 </span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="plusline">+a
263 265 </span></pre></div>
264 266 </div>
265 267 </div>
266 268 </div>
267 269
268 270 <script type="text/javascript">process_dates()</script>
269 271
270 272
271 273 </body>
272 274 </html>
273 275
274 276
275 277 set up hgweb with git diffs
276 278
277 279 $ "$TESTDIR/killdaemons.py"
278 280 $ hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
279 281 $ cat hg.pid >> $DAEMON_PIDS
280 282
281 283 revision
282 284
283 285 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
284 286 200 Script output follows
285 287
286 288 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
287 289 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
288 290 <head>
289 291 <link rel="icon" href="/static/hgicon.png" type="image/png" />
290 292 <meta name="robots" content="index, nofollow" />
291 293 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
292 294 <script type="text/javascript" src="/static/mercurial.js"></script>
293 295
294 296 <title>test: 0cd96de13884</title>
295 297 </head>
296 298 <body>
297 299 <div class="container">
298 300 <div class="menu">
299 301 <div class="logo">
300 302 <a href="http://mercurial.selenic.com/">
301 303 <img src="/static/hglogo.png" alt="mercurial" /></a>
302 304 </div>
303 305 <ul>
304 306 <li><a href="/shortlog/0cd96de13884">log</a></li>
305 307 <li><a href="/graph/0cd96de13884">graph</a></li>
306 308 <li><a href="/tags">tags</a></li>
307 309 <li><a href="/bookmarks">bookmarks</a></li>
308 310 <li><a href="/branches">branches</a></li>
309 311 </ul>
310 312 <ul>
311 313 <li class="active">changeset</li>
312 314 <li><a href="/raw-rev/0cd96de13884">raw</a></li>
313 315 <li><a href="/file/0cd96de13884">browse</a></li>
314 316 </ul>
315 317 <ul>
316 318
317 319 </ul>
318 320 <ul>
319 321 <li><a href="/help">help</a></li>
320 322 </ul>
321 323 </div>
322 324
323 325 <div class="main">
324 326
325 327 <h2><a href="/">test</a></h2>
326 328 <h3>changeset 0:0cd96de13884 </h3>
327 329
328 330 <form class="search" action="/log">
329 331
330 332 <p><input name="rev" id="search1" type="text" size="30" /></p>
331 333 <div id="hint">find changesets by author, revision,
332 334 files, or words in the commit message</div>
333 335 </form>
334 336
335 337 <div class="description">a</div>
336 338
337 339 <table id="changesetEntry">
338 340 <tr>
339 341 <th class="author">author</th>
340 342 <td class="author">&#116;&#101;&#115;&#116;</td>
341 343 </tr>
342 344 <tr>
343 345 <th class="date">date</th>
344 346 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td></tr>
345 347 <tr>
346 348 <th class="author">parents</th>
347 349 <td class="author"></td>
348 350 </tr>
349 351 <tr>
350 352 <th class="author">children</th>
351 353 <td class="author"> <a href="/rev/78e4ebad7cdf">78e4ebad7cdf</a></td>
352 354 </tr>
353 355 <tr>
354 356 <th class="files">files</th>
355 357 <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
356 358 </tr>
357 359 <tr>
358 360 <th class="diffstat">diffstat</th>
359 361 <td class="diffstat">
360 362 2 files changed, 2 insertions(+), 0 deletions(-)
361 363
362 364 <a id="diffstatexpand" href="javascript:showDiffstat()"/>[<tt>+</tt>]</a>
363 365 <div id="diffstatdetails" style="display:none;">
364 366 <a href="javascript:hideDiffstat()"/>[<tt>-</tt>]</a>
365 367 <p>
366 368 <table> <tr class="parity0">
367 369 <td class="diffstat-file"><a href="#l1.1">a</a></td>
368 370 <td class="diffstat-total" align="right">1</td>
369 371 <td class="diffstat-graph">
370 372 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
371 373 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
372 374 </td>
373 375 </tr>
374 376 <tr class="parity1">
375 377 <td class="diffstat-file"><a href="#l2.1">b</a></td>
376 378 <td class="diffstat-total" align="right">1</td>
377 379 <td class="diffstat-graph">
378 380 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
379 381 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
380 382 </td>
381 383 </tr>
382 384 </table>
383 385 </div>
384 386 </td>
385 387 </tr>
386 388 </table>
387 389
388 390 <div class="overflow">
389 391 <div class="sourcefirst"> line diff</div>
390 392
391 393 <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> new file mode 100644
392 394 <a href="#l1.2" id="l1.2"> 1.2</a> <span class="minusline">--- /dev/null
393 395 </span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="plusline">+++ b/a
394 396 </span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="atline">@@ -0,0 +1,1 @@
395 397 </span><a href="#l1.5" id="l1.5"> 1.5</a> <span class="plusline">+a
396 398 </span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1"> 2.1</a> new file mode 100644
397 399 <a href="#l2.2" id="l2.2"> 2.2</a> <span class="minusline">--- /dev/null
398 400 </span><a href="#l2.3" id="l2.3"> 2.3</a> <span class="plusline">+++ b/b
399 401 </span><a href="#l2.4" id="l2.4"> 2.4</a> <span class="atline">@@ -0,0 +1,1 @@
400 402 </span><a href="#l2.5" id="l2.5"> 2.5</a> <span class="plusline">+b
401 403 </span></pre></div>
402 404 </div>
403 405
404 406 </div>
405 407 </div>
406 408 <script type="text/javascript">process_dates()</script>
407 409
408 410
409 411 </body>
410 412 </html>
411 413
412 414
413 415 revision
414 416
415 417 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0'
416 418 200 Script output follows
417 419
418 420
419 421 # HG changeset patch
420 422 # User test
421 423 # Date 0 0
422 424 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
423 425
424 426 a
425 427
426 428 diff --git a/a b/a
427 429 new file mode 100644
428 430 --- /dev/null
429 431 +++ b/a
430 432 @@ -0,0 +1,1 @@
431 433 +a
432 434 diff --git a/b b/b
433 435 new file mode 100644
434 436 --- /dev/null
435 437 +++ b/b
436 438 @@ -0,0 +1,1 @@
437 439 +b
438 440
439 441
440 442 diff removed file
441 443
442 444 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
443 445 200 Script output follows
444 446
445 447 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
446 448 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
447 449 <head>
448 450 <link rel="icon" href="/static/hgicon.png" type="image/png" />
449 451 <meta name="robots" content="index, nofollow" />
450 452 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
451 453 <script type="text/javascript" src="/static/mercurial.js"></script>
452 454
453 455 <title>test: a diff</title>
454 456 </head>
455 457 <body>
456 458
457 459 <div class="container">
458 460 <div class="menu">
459 461 <div class="logo">
460 462 <a href="http://mercurial.selenic.com/">
461 463 <img src="/static/hglogo.png" alt="mercurial" /></a>
462 464 </div>
463 465 <ul>
464 466 <li><a href="/shortlog/78e4ebad7cdf">log</a></li>
465 467 <li><a href="/graph/78e4ebad7cdf">graph</a></li>
466 468 <li><a href="/tags">tags</a></li>
467 469 <li><a href="/bookmarks">bookmarks</a></li>
468 470 <li><a href="/branches">branches</a></li>
469 471 </ul>
470 472 <ul>
471 473 <li><a href="/rev/78e4ebad7cdf">changeset</a></li>
472 474 <li><a href="/file/78e4ebad7cdf">browse</a></li>
473 475 </ul>
474 476 <ul>
475 477 <li><a href="/file/78e4ebad7cdf/a">file</a></li>
476 478 <li><a href="/file/tip/a">latest</a></li>
477 479 <li class="active">diff</li>
478 480 <li><a href="/annotate/78e4ebad7cdf/a">annotate</a></li>
479 481 <li><a href="/log/78e4ebad7cdf/a">file log</a></li>
480 482 <li><a href="/raw-file/78e4ebad7cdf/a">raw</a></li>
481 483 </ul>
482 484 <ul>
483 485 <li><a href="/help">help</a></li>
484 486 </ul>
485 487 </div>
486 488
487 489 <div class="main">
488 490 <h2><a href="/">test</a></h2>
489 491 <h3>diff a @ 1:78e4ebad7cdf</h3>
490 492
491 493 <form class="search" action="/log">
492 494 <p></p>
493 495 <p><input name="rev" id="search1" type="text" size="30" /></p>
494 496 <div id="hint">find changesets by author, revision,
495 497 files, or words in the commit message</div>
496 498 </form>
497 499
498 500 <div class="description">b</div>
499 501
500 502 <table id="changesetEntry">
501 503 <tr>
502 504 <th>author</th>
503 505 <td>&#116;&#101;&#115;&#116;</td>
504 506 </tr>
505 507 <tr>
506 508 <th>date</th>
507 509 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
508 510 </tr>
509 511 <tr>
510 512 <th>parents</th>
511 513 <td></td>
512 514 </tr>
513 515 <tr>
514 516 <th>children</th>
515 517 <td></td>
516 518 </tr>
517 519
518 520 </table>
519 521
520 522 <div class="overflow">
521 523 <div class="sourcefirst"> line diff</div>
522 524
523 525 <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> new file mode 100755
524 526 <a href="#l1.2" id="l1.2"> 1.2</a> <span class="minusline">--- /dev/null
525 527 </span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="plusline">+++ b/a
526 528 </span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="atline">@@ -0,0 +1,1 @@
527 529 </span><a href="#l1.5" id="l1.5"> 1.5</a> <span class="plusline">+a
528 530 </span></pre></div>
529 531 </div>
530 532 </div>
531 533 </div>
532 534
533 535 <script type="text/javascript">process_dates()</script>
534 536
535 537
536 538 </body>
537 539 </html>
538 540
539 541 $ cd ..
540 542
541 543 test import rev as raw-rev
542 544
543 545 $ hg clone -r0 test test1
544 546 adding changesets
545 547 adding manifests
546 548 adding file changes
547 549 added 1 changesets with 2 changes to 2 files
548 550 updating to branch default
549 551 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
550 552 $ cd test1
551 553 $ hg import -q --exact http://localhost:$HGPORT/rev/1
552 554
553 555 errors
554 556
555 557 $ cat ../test/errors.log
@@ -1,258 +1,258 b''
1 $ "$TESTDIR/hghave" symlink || exit 80
1 $ "$TESTDIR/hghave" symlink execbit || exit 80
2 2
3 3 $ echo "[extensions]" >> $HGRCPATH
4 4 $ echo "purge=" >> $HGRCPATH
5 5 $ echo "graphlog=" >> $HGRCPATH
6 6
7 7 $ shortlog() {
8 8 > hg glog --template '{rev}:{node|short} {author} {date|hgdate} - {branch} - {desc|firstline}\n'
9 9 > }
10 10
11 11 Test --bypass with other options
12 12
13 13 $ hg init repo-options
14 14 $ cd repo-options
15 15 $ echo a > a
16 16 $ hg ci -Am adda
17 17 adding a
18 18 $ echo a >> a
19 19 $ hg branch foo
20 20 marked working directory as branch foo
21 21 $ hg ci -Am changea
22 22 $ hg export . > ../test.diff
23 23 $ hg up null
24 24 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
25 25
26 26 Test importing an existing revision
27 27
28 28 $ hg import --bypass --exact ../test.diff
29 29 applying ../test.diff
30 30 $ shortlog
31 31 o 1:4e322f7ce8e3 test 0 0 - foo - changea
32 32 |
33 33 o 0:07f494440405 test 0 0 - default - adda
34 34
35 35
36 36 Test failure without --exact
37 37
38 38 $ hg import --bypass ../test.diff
39 39 applying ../test.diff
40 40 unable to find 'a' for patching
41 41 abort: patch failed to apply
42 42 [255]
43 43 $ hg st
44 44 $ shortlog
45 45 o 1:4e322f7ce8e3 test 0 0 - foo - changea
46 46 |
47 47 o 0:07f494440405 test 0 0 - default - adda
48 48
49 49
50 50 Test --user, --date and --message
51 51
52 52 $ hg up 0
53 53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 54 $ hg import --bypass --u test2 -d '1 0' -m patch2 ../test.diff
55 55 applying ../test.diff
56 56 $ cat .hg/last-message.txt
57 57 patch2 (no-eol)
58 58 $ shortlog
59 59 o 2:2e127d1da504 test2 1 0 - default - patch2
60 60 |
61 61 | o 1:4e322f7ce8e3 test 0 0 - foo - changea
62 62 |/
63 63 @ 0:07f494440405 test 0 0 - default - adda
64 64
65 65 $ hg rollback
66 66 repository tip rolled back to revision 1 (undo import)
67 67
68 68 Test --import-branch
69 69
70 70 $ hg import --bypass --import-branch ../test.diff
71 71 applying ../test.diff
72 72 $ shortlog
73 73 o 1:4e322f7ce8e3 test 0 0 - foo - changea
74 74 |
75 75 @ 0:07f494440405 test 0 0 - default - adda
76 76
77 77 $ hg rollback
78 78 repository tip rolled back to revision 1 (undo import)
79 79
80 80 Test --strip
81 81
82 82 $ hg import --bypass --strip 0 - <<EOF
83 83 > # HG changeset patch
84 84 > # User test
85 85 > # Date 0 0
86 86 > # Branch foo
87 87 > # Node ID 4e322f7ce8e3e4203950eac9ece27bf7e45ffa6c
88 88 > # Parent 07f4944404050f47db2e5c5071e0e84e7a27bba9
89 89 > changea
90 90 >
91 91 > diff -r 07f494440405 -r 4e322f7ce8e3 a
92 92 > --- a Thu Jan 01 00:00:00 1970 +0000
93 93 > +++ a Thu Jan 01 00:00:00 1970 +0000
94 94 > @@ -1,1 +1,2 @@
95 95 > a
96 96 > +a
97 97 > EOF
98 98 applying patch from stdin
99 99 $ hg rollback
100 100 repository tip rolled back to revision 1 (undo import)
101 101
102 102 Test unsupported combinations
103 103
104 104 $ hg import --bypass --no-commit ../test.diff
105 105 abort: cannot use --no-commit with --bypass
106 106 [255]
107 107 $ hg import --bypass --similarity 50 ../test.diff
108 108 abort: cannot use --similarity with --bypass
109 109 [255]
110 110
111 111 Test commit editor
112 112
113 113 $ hg diff -c 1 > ../test.diff
114 114 $ HGEDITOR=cat hg import --bypass ../test.diff
115 115 applying ../test.diff
116 116
117 117
118 118 HG: Enter commit message. Lines beginning with 'HG:' are removed.
119 119 HG: Leave message empty to abort commit.
120 120 HG: --
121 121 HG: user: test
122 122 HG: branch 'default'
123 123 HG: changed a
124 124 abort: empty commit message
125 125 [255]
126 126
127 127 Test patch.eol is handled
128 128
129 129 $ python -c 'file("a", "wb").write("a\r\n")'
130 130 $ hg ci -m makeacrlf
131 131 $ hg import -m 'should fail because of eol' --bypass ../test.diff
132 132 applying ../test.diff
133 133 patching file a
134 134 Hunk #1 FAILED at 0
135 135 abort: patch failed to apply
136 136 [255]
137 137 $ hg --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff
138 138 applying ../test.diff
139 139 $ shortlog
140 140 o 3:d7805b4d2cb3 test 0 0 - default - test patch.eol
141 141 |
142 142 @ 2:872023de769d test 0 0 - default - makeacrlf
143 143 |
144 144 | o 1:4e322f7ce8e3 test 0 0 - foo - changea
145 145 |/
146 146 o 0:07f494440405 test 0 0 - default - adda
147 147
148 148
149 149 Test applying multiple patches
150 150
151 151 $ hg up -qC 0
152 152 $ echo e > e
153 153 $ hg ci -Am adde
154 154 adding e
155 155 created new head
156 156 $ hg export . > ../patch1.diff
157 157 $ hg up -qC 1
158 158 $ echo f > f
159 159 $ hg ci -Am addf
160 160 adding f
161 161 $ hg export . > ../patch2.diff
162 162 $ cd ..
163 163 $ hg clone -r1 repo-options repo-multi1
164 164 adding changesets
165 165 adding manifests
166 166 adding file changes
167 167 added 2 changesets with 2 changes to 1 files
168 168 updating to branch foo
169 169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 170 $ cd repo-multi1
171 171 $ hg up 0
172 172 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 173 $ hg import --bypass ../patch1.diff ../patch2.diff
174 174 applying ../patch1.diff
175 175 applying ../patch2.diff
176 176 $ shortlog
177 177 o 3:bc8ca3f8a7c4 test 0 0 - default - addf
178 178 |
179 179 o 2:16581080145e test 0 0 - default - adde
180 180 |
181 181 | o 1:4e322f7ce8e3 test 0 0 - foo - changea
182 182 |/
183 183 @ 0:07f494440405 test 0 0 - default - adda
184 184
185 185
186 186 Test applying multiple patches with --exact
187 187
188 188 $ cd ..
189 189 $ hg clone -r1 repo-options repo-multi2
190 190 adding changesets
191 191 adding manifests
192 192 adding file changes
193 193 added 2 changesets with 2 changes to 1 files
194 194 updating to branch foo
195 195 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
196 196 $ cd repo-multi2
197 197 $ hg import --bypass --exact ../patch1.diff ../patch2.diff
198 198 applying ../patch1.diff
199 199 applying ../patch2.diff
200 200 $ shortlog
201 201 o 3:d60cb8989666 test 0 0 - foo - addf
202 202 |
203 203 | o 2:16581080145e test 0 0 - default - adde
204 204 | |
205 205 @ | 1:4e322f7ce8e3 test 0 0 - foo - changea
206 206 |/
207 207 o 0:07f494440405 test 0 0 - default - adda
208 208
209 209
210 210 $ cd ..
211 211
212 212 Test complicated patch with --exact
213 213
214 214 $ hg init repo-exact
215 215 $ cd repo-exact
216 216 $ echo a > a
217 217 $ echo c > c
218 218 $ echo d > d
219 219 $ echo e > e
220 220 $ echo f > f
221 221 $ chmod +x f
222 222 $ ln -s c linkc
223 223 $ hg ci -Am t
224 224 adding a
225 225 adding c
226 226 adding d
227 227 adding e
228 228 adding f
229 229 adding linkc
230 230 $ hg cp a aa1
231 231 $ echo b >> a
232 232 $ echo b > b
233 233 $ hg add b
234 234 $ hg cp a aa2
235 235 $ echo aa >> aa2
236 236 $ chmod +x e
237 237 $ chmod -x f
238 238 $ ln -s a linka
239 239 $ hg rm d
240 240 $ hg rm linkc
241 241 $ hg mv c cc
242 242 $ hg ci -m patch
243 243 $ hg export --git . > ../test.diff
244 244 $ hg up -C null
245 245 0 files updated, 0 files merged, 7 files removed, 0 files unresolved
246 246 $ hg purge
247 247 $ hg st
248 248 $ hg import --bypass --exact ../test.diff
249 249 applying ../test.diff
250 250
251 251 The patch should have matched the exported revision and generated no additional
252 252 data. If not, diff both heads to debug it.
253 253
254 254 $ shortlog
255 255 o 1:2978fd5c8aa4 test 0 0 - default - patch
256 256 |
257 257 o 0:a0e19e636a43 test 0 0 - default - t
258 258
@@ -1,69 +1,71 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 Create extension that can disable exec checks:
2 4
3 5 $ cat > noexec.py <<EOF
4 6 > from mercurial import extensions, util
5 7 > def setflags(orig, f, l, x):
6 8 > pass
7 9 > def checkexec(orig, path):
8 10 > return False
9 11 > def extsetup(ui):
10 12 > extensions.wrapfunction(util, 'setflags', setflags)
11 13 > extensions.wrapfunction(util, 'checkexec', checkexec)
12 14 > EOF
13 15
14 16 $ hg init unix-repo
15 17 $ cd unix-repo
16 18 $ touch a
17 19 $ hg add a
18 20 $ hg commit -m 'unix: add a'
19 21 $ hg clone . ../win-repo
20 22 updating to branch default
21 23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 24 $ chmod +x a
23 25 $ hg commit -m 'unix: chmod a'
24 26 $ hg manifest -v
25 27 755 * a
26 28
27 29 $ cd ../win-repo
28 30
29 31 $ touch b
30 32 $ hg add b
31 33 $ hg commit -m 'win: add b'
32 34
33 35 $ hg manifest -v
34 36 644 a
35 37 644 b
36 38
37 39 $ hg pull
38 40 pulling from $TESTTMP/unix-repo
39 41 searching for changes
40 42 adding changesets
41 43 adding manifests
42 44 adding file changes
43 45 added 1 changesets with 0 changes to 0 files (+1 heads)
44 46 (run 'hg heads' to see heads, 'hg merge' to merge)
45 47
46 48 $ hg manifest -v -r tip
47 49 755 * a
48 50
49 51 Simulate a Windows merge:
50 52
51 53 $ hg --config extensions.n=$TESTTMP/noexec.py merge --debug
52 54 searching for copies back to rev 1
53 55 unmatched files in local:
54 56 b
55 57 resolving manifests
56 58 overwrite None partial False
57 59 ancestor a03b0deabf2b local d6fa54f68ae1+ remote 2d8bcf2dda39
58 60 a: update permissions -> e
59 61 updating: a 1/1 files (100.00%)
60 62 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 63 (branch merge, don't forget to commit)
62 64
63 65 Simulate a Windows commit:
64 66
65 67 $ hg --config extensions.n=$TESTTMP/noexec.py commit -m 'win: merge'
66 68
67 69 $ hg manifest -v
68 70 755 * a
69 71 644 b
@@ -1,1158 +1,1160 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 $ hg init a
2 4
3 5 $ cd a
4 6 $ echo a > a
5 7 $ hg ci -Ama -d '1 0'
6 8 adding a
7 9
8 10 $ hg cp a b
9 11 $ hg ci -mb -d '2 0'
10 12
11 13 $ mkdir dir
12 14 $ hg mv b dir
13 15 $ hg ci -mc -d '3 0'
14 16
15 17 $ hg mv a b
16 18 $ echo a > d
17 19 $ hg add d
18 20 $ hg ci -md -d '4 0'
19 21
20 22 $ hg mv dir/b e
21 23 $ hg ci -me -d '5 0'
22 24
23 25 $ hg log a
24 26 changeset: 0:8580ff50825a
25 27 user: test
26 28 date: Thu Jan 01 00:00:01 1970 +0000
27 29 summary: a
28 30
29 31
30 32 -f, directory
31 33
32 34 $ hg log -f dir
33 35 abort: cannot follow nonexistent file: "dir"
34 36 [255]
35 37
36 38 -f, but no args
37 39
38 40 $ hg log -f
39 41 changeset: 4:66c1345dc4f9
40 42 tag: tip
41 43 user: test
42 44 date: Thu Jan 01 00:00:05 1970 +0000
43 45 summary: e
44 46
45 47 changeset: 3:7c6c671bb7cc
46 48 user: test
47 49 date: Thu Jan 01 00:00:04 1970 +0000
48 50 summary: d
49 51
50 52 changeset: 2:41dd4284081e
51 53 user: test
52 54 date: Thu Jan 01 00:00:03 1970 +0000
53 55 summary: c
54 56
55 57 changeset: 1:784de7cef101
56 58 user: test
57 59 date: Thu Jan 01 00:00:02 1970 +0000
58 60 summary: b
59 61
60 62 changeset: 0:8580ff50825a
61 63 user: test
62 64 date: Thu Jan 01 00:00:01 1970 +0000
63 65 summary: a
64 66
65 67
66 68 one rename
67 69
68 70 $ hg log -vf a
69 71 changeset: 0:8580ff50825a
70 72 user: test
71 73 date: Thu Jan 01 00:00:01 1970 +0000
72 74 files: a
73 75 description:
74 76 a
75 77
76 78
77 79
78 80 many renames
79 81
80 82 $ hg log -vf e
81 83 changeset: 4:66c1345dc4f9
82 84 tag: tip
83 85 user: test
84 86 date: Thu Jan 01 00:00:05 1970 +0000
85 87 files: dir/b e
86 88 description:
87 89 e
88 90
89 91
90 92 changeset: 2:41dd4284081e
91 93 user: test
92 94 date: Thu Jan 01 00:00:03 1970 +0000
93 95 files: b dir/b
94 96 description:
95 97 c
96 98
97 99
98 100 changeset: 1:784de7cef101
99 101 user: test
100 102 date: Thu Jan 01 00:00:02 1970 +0000
101 103 files: b
102 104 description:
103 105 b
104 106
105 107
106 108 changeset: 0:8580ff50825a
107 109 user: test
108 110 date: Thu Jan 01 00:00:01 1970 +0000
109 111 files: a
110 112 description:
111 113 a
112 114
113 115
114 116
115 117
116 118 log -pf dir/b
117 119
118 120 $ hg log -pf dir/b
119 121 changeset: 2:41dd4284081e
120 122 user: test
121 123 date: Thu Jan 01 00:00:03 1970 +0000
122 124 summary: c
123 125
124 126 diff -r 784de7cef101 -r 41dd4284081e dir/b
125 127 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
126 128 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
127 129 @@ -0,0 +1,1 @@
128 130 +a
129 131
130 132 changeset: 1:784de7cef101
131 133 user: test
132 134 date: Thu Jan 01 00:00:02 1970 +0000
133 135 summary: b
134 136
135 137 diff -r 8580ff50825a -r 784de7cef101 b
136 138 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
137 139 +++ b/b Thu Jan 01 00:00:02 1970 +0000
138 140 @@ -0,0 +1,1 @@
139 141 +a
140 142
141 143 changeset: 0:8580ff50825a
142 144 user: test
143 145 date: Thu Jan 01 00:00:01 1970 +0000
144 146 summary: a
145 147
146 148 diff -r 000000000000 -r 8580ff50825a a
147 149 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
148 150 +++ b/a Thu Jan 01 00:00:01 1970 +0000
149 151 @@ -0,0 +1,1 @@
150 152 +a
151 153
152 154
153 155 log -vf dir/b
154 156
155 157 $ hg log -vf dir/b
156 158 changeset: 2:41dd4284081e
157 159 user: test
158 160 date: Thu Jan 01 00:00:03 1970 +0000
159 161 files: b dir/b
160 162 description:
161 163 c
162 164
163 165
164 166 changeset: 1:784de7cef101
165 167 user: test
166 168 date: Thu Jan 01 00:00:02 1970 +0000
167 169 files: b
168 170 description:
169 171 b
170 172
171 173
172 174 changeset: 0:8580ff50825a
173 175 user: test
174 176 date: Thu Jan 01 00:00:01 1970 +0000
175 177 files: a
176 178 description:
177 179 a
178 180
179 181
180 182
181 183
182 184 log copies with --copies
183 185
184 186 $ hg log -vC --template '{rev} {file_copies}\n'
185 187 4 e (dir/b)
186 188 3 b (a)
187 189 2 dir/b (b)
188 190 1 b (a)
189 191 0
190 192
191 193 log copies switch without --copies, with old filecopy template
192 194
193 195 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
194 196 4
195 197 3
196 198 2
197 199 1
198 200 0
199 201
200 202 log copies switch with --copies
201 203
202 204 $ hg log -vC --template '{rev} {file_copies_switch}\n'
203 205 4 e (dir/b)
204 206 3 b (a)
205 207 2 dir/b (b)
206 208 1 b (a)
207 209 0
208 210
209 211
210 212 log copies with hardcoded style and with --style=default
211 213
212 214 $ hg log -vC -r4
213 215 changeset: 4:66c1345dc4f9
214 216 tag: tip
215 217 user: test
216 218 date: Thu Jan 01 00:00:05 1970 +0000
217 219 files: dir/b e
218 220 copies: e (dir/b)
219 221 description:
220 222 e
221 223
222 224
223 225 $ hg log -vC -r4 --style=default
224 226 changeset: 4:66c1345dc4f9
225 227 tag: tip
226 228 user: test
227 229 date: Thu Jan 01 00:00:05 1970 +0000
228 230 files: dir/b e
229 231 copies: e (dir/b)
230 232 description:
231 233 e
232 234
233 235
234 236
235 237
236 238 log copies, non-linear manifest
237 239
238 240 $ hg up -C 3
239 241 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
240 242 $ hg mv dir/b e
241 243 $ echo foo > foo
242 244 $ hg ci -Ame2 -d '6 0'
243 245 adding foo
244 246 created new head
245 247 $ hg log -v --template '{rev} {file_copies}\n' -r 5
246 248 5 e (dir/b)
247 249
248 250
249 251 log copies, execute bit set
250 252
251 253 $ chmod +x e
252 254 $ hg ci -me3 -d '7 0'
253 255 $ hg log -v --template '{rev} {file_copies}\n' -r 6
254 256 6
255 257
256 258
257 259 log -p d
258 260
259 261 $ hg log -pv d
260 262 changeset: 3:7c6c671bb7cc
261 263 user: test
262 264 date: Thu Jan 01 00:00:04 1970 +0000
263 265 files: a b d
264 266 description:
265 267 d
266 268
267 269
268 270 diff -r 41dd4284081e -r 7c6c671bb7cc d
269 271 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
270 272 +++ b/d Thu Jan 01 00:00:04 1970 +0000
271 273 @@ -0,0 +1,1 @@
272 274 +a
273 275
274 276
275 277
276 278 log --removed file
277 279
278 280 $ hg log --removed -v a
279 281 changeset: 3:7c6c671bb7cc
280 282 user: test
281 283 date: Thu Jan 01 00:00:04 1970 +0000
282 284 files: a b d
283 285 description:
284 286 d
285 287
286 288
287 289 changeset: 0:8580ff50825a
288 290 user: test
289 291 date: Thu Jan 01 00:00:01 1970 +0000
290 292 files: a
291 293 description:
292 294 a
293 295
294 296
295 297
296 298 log --removed revrange file
297 299
298 300 $ hg log --removed -v -r0:2 a
299 301 changeset: 0:8580ff50825a
300 302 user: test
301 303 date: Thu Jan 01 00:00:01 1970 +0000
302 304 files: a
303 305 description:
304 306 a
305 307
306 308
307 309
308 310
309 311 log --follow tests
310 312
311 313 $ hg init ../follow
312 314 $ cd ../follow
313 315
314 316 $ echo base > base
315 317 $ hg ci -Ambase -d '1 0'
316 318 adding base
317 319
318 320 $ echo r1 >> base
319 321 $ hg ci -Amr1 -d '1 0'
320 322 $ echo r2 >> base
321 323 $ hg ci -Amr2 -d '1 0'
322 324
323 325 $ hg up -C 1
324 326 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
325 327 $ echo b1 > b1
326 328 $ hg ci -Amb1 -d '1 0'
327 329 adding b1
328 330 created new head
329 331
330 332
331 333 log -f
332 334
333 335 $ hg log -f
334 336 changeset: 3:e62f78d544b4
335 337 tag: tip
336 338 parent: 1:3d5bf5654eda
337 339 user: test
338 340 date: Thu Jan 01 00:00:01 1970 +0000
339 341 summary: b1
340 342
341 343 changeset: 1:3d5bf5654eda
342 344 user: test
343 345 date: Thu Jan 01 00:00:01 1970 +0000
344 346 summary: r1
345 347
346 348 changeset: 0:67e992f2c4f3
347 349 user: test
348 350 date: Thu Jan 01 00:00:01 1970 +0000
349 351 summary: base
350 352
351 353
352 354
353 355 log -f -r 1:tip
354 356
355 357 $ hg up -C 0
356 358 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
357 359 $ echo b2 > b2
358 360 $ hg ci -Amb2 -d '1 0'
359 361 adding b2
360 362 created new head
361 363 $ hg log -f -r 1:tip
362 364 changeset: 1:3d5bf5654eda
363 365 user: test
364 366 date: Thu Jan 01 00:00:01 1970 +0000
365 367 summary: r1
366 368
367 369 changeset: 2:60c670bf5b30
368 370 user: test
369 371 date: Thu Jan 01 00:00:01 1970 +0000
370 372 summary: r2
371 373
372 374 changeset: 3:e62f78d544b4
373 375 parent: 1:3d5bf5654eda
374 376 user: test
375 377 date: Thu Jan 01 00:00:01 1970 +0000
376 378 summary: b1
377 379
378 380
379 381
380 382 log -r . with two parents
381 383
382 384 $ hg up -C 3
383 385 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
384 386 $ hg merge tip
385 387 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
386 388 (branch merge, don't forget to commit)
387 389 $ hg log -r .
388 390 changeset: 3:e62f78d544b4
389 391 parent: 1:3d5bf5654eda
390 392 user: test
391 393 date: Thu Jan 01 00:00:01 1970 +0000
392 394 summary: b1
393 395
394 396
395 397
396 398 log -r . with one parent
397 399
398 400 $ hg ci -mm12 -d '1 0'
399 401 $ hg log -r .
400 402 changeset: 5:302e9dd6890d
401 403 tag: tip
402 404 parent: 3:e62f78d544b4
403 405 parent: 4:ddb82e70d1a1
404 406 user: test
405 407 date: Thu Jan 01 00:00:01 1970 +0000
406 408 summary: m12
407 409
408 410
409 411 $ echo postm >> b1
410 412 $ hg ci -Amb1.1 -d'1 0'
411 413
412 414
413 415 log --follow-first
414 416
415 417 $ hg log --follow-first
416 418 changeset: 6:2404bbcab562
417 419 tag: tip
418 420 user: test
419 421 date: Thu Jan 01 00:00:01 1970 +0000
420 422 summary: b1.1
421 423
422 424 changeset: 5:302e9dd6890d
423 425 parent: 3:e62f78d544b4
424 426 parent: 4:ddb82e70d1a1
425 427 user: test
426 428 date: Thu Jan 01 00:00:01 1970 +0000
427 429 summary: m12
428 430
429 431 changeset: 3:e62f78d544b4
430 432 parent: 1:3d5bf5654eda
431 433 user: test
432 434 date: Thu Jan 01 00:00:01 1970 +0000
433 435 summary: b1
434 436
435 437 changeset: 1:3d5bf5654eda
436 438 user: test
437 439 date: Thu Jan 01 00:00:01 1970 +0000
438 440 summary: r1
439 441
440 442 changeset: 0:67e992f2c4f3
441 443 user: test
442 444 date: Thu Jan 01 00:00:01 1970 +0000
443 445 summary: base
444 446
445 447
446 448
447 449 log -P 2
448 450
449 451 $ hg log -P 2
450 452 changeset: 6:2404bbcab562
451 453 tag: tip
452 454 user: test
453 455 date: Thu Jan 01 00:00:01 1970 +0000
454 456 summary: b1.1
455 457
456 458 changeset: 5:302e9dd6890d
457 459 parent: 3:e62f78d544b4
458 460 parent: 4:ddb82e70d1a1
459 461 user: test
460 462 date: Thu Jan 01 00:00:01 1970 +0000
461 463 summary: m12
462 464
463 465 changeset: 4:ddb82e70d1a1
464 466 parent: 0:67e992f2c4f3
465 467 user: test
466 468 date: Thu Jan 01 00:00:01 1970 +0000
467 469 summary: b2
468 470
469 471 changeset: 3:e62f78d544b4
470 472 parent: 1:3d5bf5654eda
471 473 user: test
472 474 date: Thu Jan 01 00:00:01 1970 +0000
473 475 summary: b1
474 476
475 477
476 478
477 479 log -r tip -p --git
478 480
479 481 $ hg log -r tip -p --git
480 482 changeset: 6:2404bbcab562
481 483 tag: tip
482 484 user: test
483 485 date: Thu Jan 01 00:00:01 1970 +0000
484 486 summary: b1.1
485 487
486 488 diff --git a/b1 b/b1
487 489 --- a/b1
488 490 +++ b/b1
489 491 @@ -1,1 +1,2 @@
490 492 b1
491 493 +postm
492 494
493 495
494 496
495 497 log -r ""
496 498
497 499 $ hg log -r ''
498 500 hg: parse error: empty query
499 501 [255]
500 502
501 503 log -r <some unknown node id>
502 504
503 505 $ hg log -r 1000000000000000000000000000000000000000
504 506 abort: unknown revision '1000000000000000000000000000000000000000'!
505 507 [255]
506 508
507 509 log -k r1
508 510
509 511 $ hg log -k r1
510 512 changeset: 1:3d5bf5654eda
511 513 user: test
512 514 date: Thu Jan 01 00:00:01 1970 +0000
513 515 summary: r1
514 516
515 517 log -d " " (whitespaces only)
516 518
517 519 $ hg log -d " "
518 520 abort: dates cannot consist entirely of whitespace
519 521 [255]
520 522
521 523 log -d -1
522 524
523 525 $ hg log -d -1
524 526
525 527 log -d ">"
526 528
527 529 $ hg log -d ">"
528 530 abort: invalid day spec, use '>DATE'
529 531 [255]
530 532
531 533 log -d "<"
532 534
533 535 $ hg log -d "<"
534 536 abort: invalid day spec, use '<DATE'
535 537 [255]
536 538
537 539 Negative ranges
538 540 $ hg log -d "--2"
539 541 abort: -2 must be nonnegative (see 'hg help dates')
540 542 [255]
541 543
542 544
543 545 log -p -l2 --color=always
544 546
545 547 $ hg --config extensions.color= --config color.mode=ansi \
546 548 > log -p -l2 --color=always
547 549 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
548 550 tag: tip
549 551 user: test
550 552 date: Thu Jan 01 00:00:01 1970 +0000
551 553 summary: b1.1
552 554
553 555 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
554 556 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
555 557 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
556 558 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
557 559 b1
558 560 \x1b[0;32m+postm\x1b[0m (esc)
559 561
560 562 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
561 563 parent: 3:e62f78d544b4
562 564 parent: 4:ddb82e70d1a1
563 565 user: test
564 566 date: Thu Jan 01 00:00:01 1970 +0000
565 567 summary: m12
566 568
567 569 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
568 570 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
569 571 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
570 572 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
571 573 \x1b[0;32m+b2\x1b[0m (esc)
572 574
573 575
574 576
575 577 log -r tip --stat
576 578
577 579 $ hg log -r tip --stat
578 580 changeset: 6:2404bbcab562
579 581 tag: tip
580 582 user: test
581 583 date: Thu Jan 01 00:00:01 1970 +0000
582 584 summary: b1.1
583 585
584 586 b1 | 1 +
585 587 1 files changed, 1 insertions(+), 0 deletions(-)
586 588
587 589
588 590 $ cd ..
589 591
590 592 $ hg init usertest
591 593 $ cd usertest
592 594
593 595 $ echo a > a
594 596 $ hg ci -A -m "a" -u "User One <user1@example.org>"
595 597 adding a
596 598 $ echo b > b
597 599 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
598 600 adding b
599 601
600 602 $ hg log -u "User One <user1@example.org>"
601 603 changeset: 0:29a4c94f1924
602 604 user: User One <user1@example.org>
603 605 date: Thu Jan 01 00:00:00 1970 +0000
604 606 summary: a
605 607
606 608 $ hg log -u "user1" -u "user2"
607 609 changeset: 1:e834b5e69c0e
608 610 tag: tip
609 611 user: User Two <user2@example.org>
610 612 date: Thu Jan 01 00:00:00 1970 +0000
611 613 summary: b
612 614
613 615 changeset: 0:29a4c94f1924
614 616 user: User One <user1@example.org>
615 617 date: Thu Jan 01 00:00:00 1970 +0000
616 618 summary: a
617 619
618 620 $ hg log -u "user3"
619 621
620 622 $ cd ..
621 623
622 624 $ hg init branches
623 625 $ cd branches
624 626
625 627 $ echo a > a
626 628 $ hg ci -A -m "commit on default"
627 629 adding a
628 630 $ hg branch test
629 631 marked working directory as branch test
630 632 $ echo b > b
631 633 $ hg ci -A -m "commit on test"
632 634 adding b
633 635
634 636 $ hg up default
635 637 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
636 638 $ echo c > c
637 639 $ hg ci -A -m "commit on default"
638 640 adding c
639 641 $ hg up test
640 642 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
641 643 $ echo c > c
642 644 $ hg ci -A -m "commit on test"
643 645 adding c
644 646
645 647
646 648 log -b default
647 649
648 650 $ hg log -b default
649 651 changeset: 2:c3a4f03cc9a7
650 652 parent: 0:24427303d56f
651 653 user: test
652 654 date: Thu Jan 01 00:00:00 1970 +0000
653 655 summary: commit on default
654 656
655 657 changeset: 0:24427303d56f
656 658 user: test
657 659 date: Thu Jan 01 00:00:00 1970 +0000
658 660 summary: commit on default
659 661
660 662
661 663
662 664 log -b test
663 665
664 666 $ hg log -b test
665 667 changeset: 3:f5d8de11c2e2
666 668 branch: test
667 669 tag: tip
668 670 parent: 1:d32277701ccb
669 671 user: test
670 672 date: Thu Jan 01 00:00:00 1970 +0000
671 673 summary: commit on test
672 674
673 675 changeset: 1:d32277701ccb
674 676 branch: test
675 677 user: test
676 678 date: Thu Jan 01 00:00:00 1970 +0000
677 679 summary: commit on test
678 680
679 681
680 682
681 683 log -b dummy
682 684
683 685 $ hg log -b dummy
684 686 abort: unknown revision 'dummy'!
685 687 [255]
686 688
687 689
688 690 log -b .
689 691
690 692 $ hg log -b .
691 693 changeset: 3:f5d8de11c2e2
692 694 branch: test
693 695 tag: tip
694 696 parent: 1:d32277701ccb
695 697 user: test
696 698 date: Thu Jan 01 00:00:00 1970 +0000
697 699 summary: commit on test
698 700
699 701 changeset: 1:d32277701ccb
700 702 branch: test
701 703 user: test
702 704 date: Thu Jan 01 00:00:00 1970 +0000
703 705 summary: commit on test
704 706
705 707
706 708
707 709 log -b default -b test
708 710
709 711 $ hg log -b default -b test
710 712 changeset: 3:f5d8de11c2e2
711 713 branch: test
712 714 tag: tip
713 715 parent: 1:d32277701ccb
714 716 user: test
715 717 date: Thu Jan 01 00:00:00 1970 +0000
716 718 summary: commit on test
717 719
718 720 changeset: 2:c3a4f03cc9a7
719 721 parent: 0:24427303d56f
720 722 user: test
721 723 date: Thu Jan 01 00:00:00 1970 +0000
722 724 summary: commit on default
723 725
724 726 changeset: 1:d32277701ccb
725 727 branch: test
726 728 user: test
727 729 date: Thu Jan 01 00:00:00 1970 +0000
728 730 summary: commit on test
729 731
730 732 changeset: 0:24427303d56f
731 733 user: test
732 734 date: Thu Jan 01 00:00:00 1970 +0000
733 735 summary: commit on default
734 736
735 737
736 738
737 739 log -b default -b .
738 740
739 741 $ hg log -b default -b .
740 742 changeset: 3:f5d8de11c2e2
741 743 branch: test
742 744 tag: tip
743 745 parent: 1:d32277701ccb
744 746 user: test
745 747 date: Thu Jan 01 00:00:00 1970 +0000
746 748 summary: commit on test
747 749
748 750 changeset: 2:c3a4f03cc9a7
749 751 parent: 0:24427303d56f
750 752 user: test
751 753 date: Thu Jan 01 00:00:00 1970 +0000
752 754 summary: commit on default
753 755
754 756 changeset: 1:d32277701ccb
755 757 branch: test
756 758 user: test
757 759 date: Thu Jan 01 00:00:00 1970 +0000
758 760 summary: commit on test
759 761
760 762 changeset: 0:24427303d56f
761 763 user: test
762 764 date: Thu Jan 01 00:00:00 1970 +0000
763 765 summary: commit on default
764 766
765 767
766 768
767 769 log -b . -b test
768 770
769 771 $ hg log -b . -b test
770 772 changeset: 3:f5d8de11c2e2
771 773 branch: test
772 774 tag: tip
773 775 parent: 1:d32277701ccb
774 776 user: test
775 777 date: Thu Jan 01 00:00:00 1970 +0000
776 778 summary: commit on test
777 779
778 780 changeset: 1:d32277701ccb
779 781 branch: test
780 782 user: test
781 783 date: Thu Jan 01 00:00:00 1970 +0000
782 784 summary: commit on test
783 785
784 786
785 787
786 788 log -b 2
787 789
788 790 $ hg log -b 2
789 791 changeset: 2:c3a4f03cc9a7
790 792 parent: 0:24427303d56f
791 793 user: test
792 794 date: Thu Jan 01 00:00:00 1970 +0000
793 795 summary: commit on default
794 796
795 797 changeset: 0:24427303d56f
796 798 user: test
797 799 date: Thu Jan 01 00:00:00 1970 +0000
798 800 summary: commit on default
799 801
800 802
801 803
802 804 log -p --cwd dir (in subdir)
803 805
804 806 $ mkdir dir
805 807 $ hg log -p --cwd dir
806 808 changeset: 3:f5d8de11c2e2
807 809 branch: test
808 810 tag: tip
809 811 parent: 1:d32277701ccb
810 812 user: test
811 813 date: Thu Jan 01 00:00:00 1970 +0000
812 814 summary: commit on test
813 815
814 816 diff -r d32277701ccb -r f5d8de11c2e2 c
815 817 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
816 818 +++ b/c Thu Jan 01 00:00:00 1970 +0000
817 819 @@ -0,0 +1,1 @@
818 820 +c
819 821
820 822 changeset: 2:c3a4f03cc9a7
821 823 parent: 0:24427303d56f
822 824 user: test
823 825 date: Thu Jan 01 00:00:00 1970 +0000
824 826 summary: commit on default
825 827
826 828 diff -r 24427303d56f -r c3a4f03cc9a7 c
827 829 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
828 830 +++ b/c Thu Jan 01 00:00:00 1970 +0000
829 831 @@ -0,0 +1,1 @@
830 832 +c
831 833
832 834 changeset: 1:d32277701ccb
833 835 branch: test
834 836 user: test
835 837 date: Thu Jan 01 00:00:00 1970 +0000
836 838 summary: commit on test
837 839
838 840 diff -r 24427303d56f -r d32277701ccb b
839 841 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
840 842 +++ b/b Thu Jan 01 00:00:00 1970 +0000
841 843 @@ -0,0 +1,1 @@
842 844 +b
843 845
844 846 changeset: 0:24427303d56f
845 847 user: test
846 848 date: Thu Jan 01 00:00:00 1970 +0000
847 849 summary: commit on default
848 850
849 851 diff -r 000000000000 -r 24427303d56f a
850 852 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
851 853 +++ b/a Thu Jan 01 00:00:00 1970 +0000
852 854 @@ -0,0 +1,1 @@
853 855 +a
854 856
855 857
856 858
857 859 log -p -R repo
858 860
859 861 $ cd dir
860 862 $ hg log -p -R .. ../a
861 863 changeset: 0:24427303d56f
862 864 user: test
863 865 date: Thu Jan 01 00:00:00 1970 +0000
864 866 summary: commit on default
865 867
866 868 diff -r 000000000000 -r 24427303d56f a
867 869 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
868 870 +++ b/a Thu Jan 01 00:00:00 1970 +0000
869 871 @@ -0,0 +1,1 @@
870 872 +a
871 873
872 874
873 875
874 876 $ cd ..
875 877 $ hg init follow2
876 878 $ cd follow2
877 879
878 880
879 881 # Build the following history:
880 882 # tip - o - x - o - x - x
881 883 # \ /
882 884 # o - o - o - x
883 885 # \ /
884 886 # o
885 887 #
886 888 # Where "o" is a revision containing "foo" and
887 889 # "x" is a revision without "foo"
888 890
889 891 $ touch init
890 892 $ hg ci -A -m "init, unrelated"
891 893 adding init
892 894 $ echo 'foo' > init
893 895 $ hg ci -m "change, unrelated"
894 896 $ echo 'foo' > foo
895 897 $ hg ci -A -m "add unrelated old foo"
896 898 adding foo
897 899 $ hg rm foo
898 900 $ hg ci -m "delete foo, unrelated"
899 901 $ echo 'related' > foo
900 902 $ hg ci -A -m "add foo, related"
901 903 adding foo
902 904
903 905 $ hg up 0
904 906 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
905 907 $ touch branch
906 908 $ hg ci -A -m "first branch, unrelated"
907 909 adding branch
908 910 created new head
909 911 $ touch foo
910 912 $ hg ci -A -m "create foo, related"
911 913 adding foo
912 914 $ echo 'change' > foo
913 915 $ hg ci -m "change foo, related"
914 916
915 917 $ hg up 6
916 918 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
917 919 $ echo 'change foo in branch' > foo
918 920 $ hg ci -m "change foo in branch, related"
919 921 created new head
920 922 $ hg merge 7
921 923 merging foo
922 924 warning: conflicts during merge.
923 925 merging foo failed!
924 926 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
925 927 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
926 928 [1]
927 929 $ echo 'merge 1' > foo
928 930 $ hg resolve -m foo
929 931 $ hg ci -m "First merge, related"
930 932
931 933 $ hg merge 4
932 934 merging foo
933 935 warning: conflicts during merge.
934 936 merging foo failed!
935 937 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
936 938 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
937 939 [1]
938 940 $ echo 'merge 2' > foo
939 941 $ hg resolve -m foo
940 942 $ hg ci -m "Last merge, related"
941 943
942 944 $ hg --config "extensions.graphlog=" glog
943 945 @ changeset: 10:4dae8563d2c5
944 946 |\ tag: tip
945 947 | | parent: 9:7b35701b003e
946 948 | | parent: 4:88176d361b69
947 949 | | user: test
948 950 | | date: Thu Jan 01 00:00:00 1970 +0000
949 951 | | summary: Last merge, related
950 952 | |
951 953 | o changeset: 9:7b35701b003e
952 954 | |\ parent: 8:e5416ad8a855
953 955 | | | parent: 7:87fe3144dcfa
954 956 | | | user: test
955 957 | | | date: Thu Jan 01 00:00:00 1970 +0000
956 958 | | | summary: First merge, related
957 959 | | |
958 960 | | o changeset: 8:e5416ad8a855
959 961 | | | parent: 6:dc6c325fe5ee
960 962 | | | user: test
961 963 | | | date: Thu Jan 01 00:00:00 1970 +0000
962 964 | | | summary: change foo in branch, related
963 965 | | |
964 966 | o | changeset: 7:87fe3144dcfa
965 967 | |/ user: test
966 968 | | date: Thu Jan 01 00:00:00 1970 +0000
967 969 | | summary: change foo, related
968 970 | |
969 971 | o changeset: 6:dc6c325fe5ee
970 972 | | user: test
971 973 | | date: Thu Jan 01 00:00:00 1970 +0000
972 974 | | summary: create foo, related
973 975 | |
974 976 | o changeset: 5:73db34516eb9
975 977 | | parent: 0:e87515fd044a
976 978 | | user: test
977 979 | | date: Thu Jan 01 00:00:00 1970 +0000
978 980 | | summary: first branch, unrelated
979 981 | |
980 982 o | changeset: 4:88176d361b69
981 983 | | user: test
982 984 | | date: Thu Jan 01 00:00:00 1970 +0000
983 985 | | summary: add foo, related
984 986 | |
985 987 o | changeset: 3:dd78ae4afb56
986 988 | | user: test
987 989 | | date: Thu Jan 01 00:00:00 1970 +0000
988 990 | | summary: delete foo, unrelated
989 991 | |
990 992 o | changeset: 2:c4c64aedf0f7
991 993 | | user: test
992 994 | | date: Thu Jan 01 00:00:00 1970 +0000
993 995 | | summary: add unrelated old foo
994 996 | |
995 997 o | changeset: 1:e5faa7440653
996 998 |/ user: test
997 999 | date: Thu Jan 01 00:00:00 1970 +0000
998 1000 | summary: change, unrelated
999 1001 |
1000 1002 o changeset: 0:e87515fd044a
1001 1003 user: test
1002 1004 date: Thu Jan 01 00:00:00 1970 +0000
1003 1005 summary: init, unrelated
1004 1006
1005 1007
1006 1008 $ hg --traceback log -f foo
1007 1009 changeset: 10:4dae8563d2c5
1008 1010 tag: tip
1009 1011 parent: 9:7b35701b003e
1010 1012 parent: 4:88176d361b69
1011 1013 user: test
1012 1014 date: Thu Jan 01 00:00:00 1970 +0000
1013 1015 summary: Last merge, related
1014 1016
1015 1017 changeset: 9:7b35701b003e
1016 1018 parent: 8:e5416ad8a855
1017 1019 parent: 7:87fe3144dcfa
1018 1020 user: test
1019 1021 date: Thu Jan 01 00:00:00 1970 +0000
1020 1022 summary: First merge, related
1021 1023
1022 1024 changeset: 8:e5416ad8a855
1023 1025 parent: 6:dc6c325fe5ee
1024 1026 user: test
1025 1027 date: Thu Jan 01 00:00:00 1970 +0000
1026 1028 summary: change foo in branch, related
1027 1029
1028 1030 changeset: 7:87fe3144dcfa
1029 1031 user: test
1030 1032 date: Thu Jan 01 00:00:00 1970 +0000
1031 1033 summary: change foo, related
1032 1034
1033 1035 changeset: 6:dc6c325fe5ee
1034 1036 user: test
1035 1037 date: Thu Jan 01 00:00:00 1970 +0000
1036 1038 summary: create foo, related
1037 1039
1038 1040 changeset: 4:88176d361b69
1039 1041 user: test
1040 1042 date: Thu Jan 01 00:00:00 1970 +0000
1041 1043 summary: add foo, related
1042 1044
1043 1045
1044 1046 Also check when maxrev < lastrevfilelog
1045 1047
1046 1048 $ hg --traceback log -f -r4 foo
1047 1049 changeset: 4:88176d361b69
1048 1050 user: test
1049 1051 date: Thu Jan 01 00:00:00 1970 +0000
1050 1052 summary: add foo, related
1051 1053
1052 1054
1053 1055 Issue2383: hg log showing _less_ differences than hg diff
1054 1056
1055 1057 $ hg init issue2383
1056 1058 $ cd issue2383
1057 1059
1058 1060 Create a test repo:
1059 1061
1060 1062 $ echo a > a
1061 1063 $ hg ci -Am0
1062 1064 adding a
1063 1065 $ echo b > b
1064 1066 $ hg ci -Am1
1065 1067 adding b
1066 1068 $ hg co 0
1067 1069 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1068 1070 $ echo b > a
1069 1071 $ hg ci -m2
1070 1072 created new head
1071 1073
1072 1074 Merge:
1073 1075
1074 1076 $ hg merge
1075 1077 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1076 1078 (branch merge, don't forget to commit)
1077 1079
1078 1080 Make sure there's a file listed in the merge to trigger the bug:
1079 1081
1080 1082 $ echo c > a
1081 1083 $ hg ci -m3
1082 1084
1083 1085 Two files shown here in diff:
1084 1086
1085 1087 $ hg diff --rev 2:3
1086 1088 diff -r b09be438c43a -r 8e07aafe1edc a
1087 1089 --- a/a Thu Jan 01 00:00:00 1970 +0000
1088 1090 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1089 1091 @@ -1,1 +1,1 @@
1090 1092 -b
1091 1093 +c
1092 1094 diff -r b09be438c43a -r 8e07aafe1edc b
1093 1095 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1094 1096 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1095 1097 @@ -0,0 +1,1 @@
1096 1098 +b
1097 1099
1098 1100 Diff here should be the same:
1099 1101
1100 1102 $ hg log -vpr 3
1101 1103 changeset: 3:8e07aafe1edc
1102 1104 tag: tip
1103 1105 parent: 2:b09be438c43a
1104 1106 parent: 1:925d80f479bb
1105 1107 user: test
1106 1108 date: Thu Jan 01 00:00:00 1970 +0000
1107 1109 files: a
1108 1110 description:
1109 1111 3
1110 1112
1111 1113
1112 1114 diff -r b09be438c43a -r 8e07aafe1edc a
1113 1115 --- a/a Thu Jan 01 00:00:00 1970 +0000
1114 1116 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1115 1117 @@ -1,1 +1,1 @@
1116 1118 -b
1117 1119 +c
1118 1120 diff -r b09be438c43a -r 8e07aafe1edc b
1119 1121 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1120 1122 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1121 1123 @@ -0,0 +1,1 @@
1122 1124 +b
1123 1125
1124 1126 $ cd ..
1125 1127
1126 1128 'hg log -r rev fn' when last(filelog(fn)) != rev
1127 1129
1128 1130 $ hg init simplelog; cd simplelog
1129 1131 $ echo f > a
1130 1132 $ hg ci -Am'a' -d '0 0'
1131 1133 adding a
1132 1134 $ echo f >> a
1133 1135 $ hg ci -Am'a bis' -d '1 0'
1134 1136
1135 1137 $ hg log -r0 a
1136 1138 changeset: 0:9f758d63dcde
1137 1139 user: test
1138 1140 date: Thu Jan 01 00:00:00 1970 +0000
1139 1141 summary: a
1140 1142
1141 1143 $ cat > $HGTMP/testhidden.py << EOF
1142 1144 > def reposetup(ui, repo):
1143 1145 > for line in repo.opener('hidden'):
1144 1146 > ctx = repo[line.strip()]
1145 1147 > repo.changelog.hiddenrevs.add(ctx.rev())
1146 1148 > EOF
1147 1149 $ echo '[extensions]' >> $HGRCPATH
1148 1150 $ echo "hidden=$HGTMP/testhidden.py" >> $HGRCPATH
1149 1151 $ touch .hg/hidden
1150 1152 $ hg log --template='{rev}:{node}\n'
1151 1153 1:a765632148dc55d38c35c4f247c618701886cb2f
1152 1154 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1153 1155 $ echo a765632148dc55d38c35c4f247c618701886cb2f > .hg/hidden
1154 1156 $ hg log --template='{rev}:{node}\n'
1155 1157 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1156 1158 $ hg log --template='{rev}:{node}\n' --hidden
1157 1159 1:a765632148dc55d38c35c4f247c618701886cb2f
1158 1160 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
@@ -1,72 +1,72 b''
1 $ "$TESTDIR/hghave" symlink || exit 80
1 $ "$TESTDIR/hghave" symlink execbit || exit 80
2 2
3 3 $ hg init
4 4
5 5 $ echo a > a
6 6 $ hg ci -Amadd
7 7 adding a
8 8
9 9 $ chmod +x a
10 10 $ hg ci -mexecutable
11 11
12 12 $ hg up 0
13 13 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
14 14 $ rm a
15 15 $ ln -s symlink a
16 16 $ hg ci -msymlink
17 17 created new head
18 18
19 19 $ hg merge --debug
20 20 searching for copies back to rev 1
21 21 resolving manifests
22 22 overwrite None partial False
23 23 ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c
24 24 conflicting flags for a
25 25 (n)one, e(x)ec or sym(l)ink? n
26 26 a: update permissions -> e
27 27 updating: a 1/1 files (100.00%)
28 28 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 29 (branch merge, don't forget to commit)
30 30
31 31
32 32 Symlink is local parent, executable is other:
33 33
34 34 $ if [ -h a ]; then
35 35 > echo a is a symlink
36 36 > $TESTDIR/readlink.py a
37 37 > elif [ -x a ]; then
38 38 > echo a is executable
39 39 > else
40 40 > echo "a has no flags (default for conflicts)"
41 41 > fi
42 42 a has no flags (default for conflicts)
43 43
44 44 $ hg update -C 1
45 45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 46
47 47 $ hg merge --debug
48 48 searching for copies back to rev 1
49 49 resolving manifests
50 50 overwrite None partial False
51 51 ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f
52 52 conflicting flags for a
53 53 (n)one, e(x)ec or sym(l)ink? n
54 54 a: remote is newer -> g
55 55 updating: a 1/1 files (100.00%)
56 56 getting a
57 57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 58 (branch merge, don't forget to commit)
59 59
60 60
61 61 Symlink is other parent, executable is local:
62 62
63 63 $ if [ -h a ]; then
64 64 > echo a is a symlink
65 65 > $TESTDIR/readlink.py a
66 66 > elif [ -x a ]; then
67 67 > echo a is executable
68 68 > else
69 69 > echo "a has no flags (default for conflicts)"
70 70 > fi
71 71 a has no flags (default for conflicts)
72 72
@@ -1,1394 +1,1396 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 $ checkundo()
2 4 > {
3 5 > if [ -f .hg/store/undo ]; then
4 6 > echo ".hg/store/undo still exists after $1"
5 7 > fi
6 8 > }
7 9
8 10 $ echo "[extensions]" >> $HGRCPATH
9 11 $ echo "mq=" >> $HGRCPATH
10 12
11 13 $ echo "[mq]" >> $HGRCPATH
12 14 $ echo "plain=true" >> $HGRCPATH
13 15
14 16
15 17 help
16 18
17 19 $ hg help mq
18 20 mq extension - manage a stack of patches
19 21
20 22 This extension lets you work with a stack of patches in a Mercurial
21 23 repository. It manages two stacks of patches - all known patches, and applied
22 24 patches (subset of known patches).
23 25
24 26 Known patches are represented as patch files in the .hg/patches directory.
25 27 Applied patches are both patch files and changesets.
26 28
27 29 Common tasks (use "hg help command" for more details):
28 30
29 31 create new patch qnew
30 32 import existing patch qimport
31 33
32 34 print patch series qseries
33 35 print applied patches qapplied
34 36
35 37 add known patch to applied stack qpush
36 38 remove patch from applied stack qpop
37 39 refresh contents of top applied patch qrefresh
38 40
39 41 By default, mq will automatically use git patches when required to avoid
40 42 losing file mode changes, copy records, binary files or empty files creations
41 43 or deletions. This behaviour can be configured with:
42 44
43 45 [mq]
44 46 git = auto/keep/yes/no
45 47
46 48 If set to 'keep', mq will obey the [diff] section configuration while
47 49 preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
48 50 will override the [diff] section and always generate git or regular patches,
49 51 possibly losing data in the second case.
50 52
51 53 You will by default be managing a patch queue named "patches". You can create
52 54 other, independent patch queues with the "hg qqueue" command.
53 55
54 56 list of commands:
55 57
56 58 qapplied print the patches already applied
57 59 qclone clone main and patch repository at same time
58 60 qdelete remove patches from queue
59 61 qdiff diff of the current patch and subsequent modifications
60 62 qfinish move applied patches into repository history
61 63 qfold fold the named patches into the current patch
62 64 qgoto push or pop patches until named patch is at top of stack
63 65 qguard set or print guards for a patch
64 66 qheader print the header of the topmost or specified patch
65 67 qimport import a patch
66 68 qnew create a new patch
67 69 qnext print the name of the next patch
68 70 qpop pop the current patch off the stack
69 71 qprev print the name of the previous patch
70 72 qpush push the next patch onto the stack
71 73 qqueue manage multiple patch queues
72 74 qrefresh update the current patch
73 75 qrename rename a patch
74 76 qselect set or print guarded patches to push
75 77 qseries print the entire series file
76 78 qtop print the name of the current patch
77 79 qunapplied print the patches not yet applied
78 80 strip strip changesets and all their descendants from the repository
79 81
80 82 use "hg -v help mq" to show builtin aliases and global options
81 83
82 84 $ hg init a
83 85 $ cd a
84 86 $ echo a > a
85 87 $ hg ci -Ama
86 88 adding a
87 89
88 90 $ hg clone . ../k
89 91 updating to branch default
90 92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 93
92 94 $ mkdir b
93 95 $ echo z > b/z
94 96 $ hg ci -Ama
95 97 adding b/z
96 98
97 99
98 100 qinit
99 101
100 102 $ hg qinit
101 103
102 104 $ cd ..
103 105 $ hg init b
104 106
105 107
106 108 -R qinit
107 109
108 110 $ hg -R b qinit
109 111
110 112 $ hg init c
111 113
112 114
113 115 qinit -c
114 116
115 117 $ hg --cwd c qinit -c
116 118 $ hg -R c/.hg/patches st
117 119 A .hgignore
118 120 A series
119 121
120 122
121 123 qinit; qinit -c
122 124
123 125 $ hg init d
124 126 $ cd d
125 127 $ hg qinit
126 128 $ hg qinit -c
127 129
128 130 qinit -c should create both files if they don't exist
129 131
130 132 $ cat .hg/patches/.hgignore
131 133 ^\.hg
132 134 ^\.mq
133 135 syntax: glob
134 136 status
135 137 guards
136 138 $ cat .hg/patches/series
137 139 $ hg qinit -c
138 140 abort: repository $TESTTMP/d/.hg/patches already exists!
139 141 [255]
140 142 $ cd ..
141 143
142 144 $ echo '% qinit; <stuff>; qinit -c'
143 145 % qinit; <stuff>; qinit -c
144 146 $ hg init e
145 147 $ cd e
146 148 $ hg qnew A
147 149 $ checkundo qnew
148 150 $ echo foo > foo
149 151 $ hg add foo
150 152 $ hg qrefresh
151 153 $ hg qnew B
152 154 $ echo >> foo
153 155 $ hg qrefresh
154 156 $ echo status >> .hg/patches/.hgignore
155 157 $ echo bleh >> .hg/patches/.hgignore
156 158 $ hg qinit -c
157 159 adding .hg/patches/A
158 160 adding .hg/patches/B
159 161 $ hg -R .hg/patches status
160 162 A .hgignore
161 163 A A
162 164 A B
163 165 A series
164 166
165 167 qinit -c shouldn't touch these files if they already exist
166 168
167 169 $ cat .hg/patches/.hgignore
168 170 status
169 171 bleh
170 172 $ cat .hg/patches/series
171 173 A
172 174 B
173 175
174 176 add an untracked file
175 177
176 178 $ echo >> .hg/patches/flaf
177 179
178 180 status --mq with color (issue2096)
179 181
180 182 $ hg status --mq --config extensions.color= --config color.mode=ansi --color=always
181 183 \x1b[0;32;1mA .hgignore\x1b[0m (esc)
182 184 \x1b[0;32;1mA A\x1b[0m (esc)
183 185 \x1b[0;32;1mA B\x1b[0m (esc)
184 186 \x1b[0;32;1mA series\x1b[0m (esc)
185 187 \x1b[0;35;1;4m? flaf\x1b[0m (esc)
186 188
187 189 try the --mq option on a command provided by an extension
188 190
189 191 $ hg purge --mq --verbose --config extensions.purge=
190 192 Removing file flaf
191 193
192 194 $ cd ..
193 195
194 196 init --mq without repo
195 197
196 198 $ mkdir f
197 199 $ cd f
198 200 $ hg init --mq
199 201 abort: there is no Mercurial repository here (.hg not found)
200 202 [255]
201 203 $ cd ..
202 204
203 205 init --mq with repo path
204 206
205 207 $ hg init g
206 208 $ hg init --mq g
207 209 $ test -d g/.hg/patches/.hg
208 210
209 211 init --mq with nonexistent directory
210 212
211 213 $ hg init --mq nonexistentdir
212 214 abort: repository nonexistentdir not found!
213 215 [255]
214 216
215 217
216 218 init --mq with bundle (non "local")
217 219
218 220 $ hg -R a bundle --all a.bundle >/dev/null
219 221 $ hg init --mq a.bundle
220 222 abort: only a local queue repository may be initialized
221 223 [255]
222 224
223 225 $ cd a
224 226
225 227 $ hg qnew -m 'foo bar' test.patch
226 228
227 229 $ echo '# comment' > .hg/patches/series.tmp
228 230 $ echo >> .hg/patches/series.tmp # empty line
229 231 $ cat .hg/patches/series >> .hg/patches/series.tmp
230 232 $ mv .hg/patches/series.tmp .hg/patches/series
231 233
232 234
233 235 qrefresh
234 236
235 237 $ echo a >> a
236 238 $ hg qrefresh
237 239 $ cat .hg/patches/test.patch
238 240 foo bar
239 241
240 242 diff -r [a-f0-9]* a (re)
241 243 --- a/a\t(?P<date>.*) (re)
242 244 \+\+\+ b/a\t(?P<date2>.*) (re)
243 245 @@ -1,1 +1,2 @@
244 246 a
245 247 +a
246 248
247 249 empty qrefresh
248 250
249 251 $ hg qrefresh -X a
250 252
251 253 revision:
252 254
253 255 $ hg diff -r -2 -r -1
254 256
255 257 patch:
256 258
257 259 $ cat .hg/patches/test.patch
258 260 foo bar
259 261
260 262
261 263 working dir diff:
262 264
263 265 $ hg diff --nodates -q
264 266 --- a/a
265 267 +++ b/a
266 268 @@ -1,1 +1,2 @@
267 269 a
268 270 +a
269 271
270 272 restore things
271 273
272 274 $ hg qrefresh
273 275 $ checkundo qrefresh
274 276
275 277
276 278 qpop
277 279
278 280 $ hg qpop
279 281 popping test.patch
280 282 patch queue now empty
281 283 $ checkundo qpop
282 284
283 285
284 286 qpush with dump of tag cache
285 287 Dump the tag cache to ensure that it has exactly one head after qpush.
286 288
287 289 $ rm -f .hg/cache/tags
288 290 $ hg tags > /dev/null
289 291
290 292 .hg/cache/tags (pre qpush):
291 293
292 294 $ cat .hg/cache/tags
293 295 1 [\da-f]{40} (re)
294 296
295 297 $ hg qpush
296 298 applying test.patch
297 299 now at: test.patch
298 300 $ hg tags > /dev/null
299 301
300 302 .hg/cache/tags (post qpush):
301 303
302 304 $ cat .hg/cache/tags
303 305 2 [\da-f]{40} (re)
304 306
305 307 $ checkundo qpush
306 308 $ cd ..
307 309
308 310
309 311 pop/push outside repo
310 312 $ hg -R a qpop
311 313 popping test.patch
312 314 patch queue now empty
313 315 $ hg -R a qpush
314 316 applying test.patch
315 317 now at: test.patch
316 318
317 319 $ cd a
318 320 $ hg qnew test2.patch
319 321
320 322 qrefresh in subdir
321 323
322 324 $ cd b
323 325 $ echo a > a
324 326 $ hg add a
325 327 $ hg qrefresh
326 328
327 329 pop/push -a in subdir
328 330
329 331 $ hg qpop -a
330 332 popping test2.patch
331 333 popping test.patch
332 334 patch queue now empty
333 335 $ hg --traceback qpush -a
334 336 applying test.patch
335 337 applying test2.patch
336 338 now at: test2.patch
337 339
338 340
339 341 setting columns & formatted tests truncating (issue1912)
340 342
341 343 $ COLUMNS=4 hg qseries --config ui.formatted=true
342 344 test.patch
343 345 test2.patch
344 346 $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
345 347 0 A test.patch: f...
346 348 1 A test2.patch:
347 349 $ hg qpop
348 350 popping test2.patch
349 351 now at: test.patch
350 352 $ hg qseries -vs
351 353 0 A test.patch: foo bar
352 354 1 U test2.patch:
353 355 $ hg sum | grep mq
354 356 mq: 1 applied, 1 unapplied
355 357 $ hg qpush
356 358 applying test2.patch
357 359 now at: test2.patch
358 360 $ hg sum | grep mq
359 361 mq: 2 applied
360 362 $ hg qapplied
361 363 test.patch
362 364 test2.patch
363 365 $ hg qtop
364 366 test2.patch
365 367
366 368
367 369 prev
368 370
369 371 $ hg qapp -1
370 372 test.patch
371 373
372 374 next
373 375
374 376 $ hg qunapp -1
375 377 all patches applied
376 378 [1]
377 379
378 380 $ hg qpop
379 381 popping test2.patch
380 382 now at: test.patch
381 383
382 384 commit should fail
383 385
384 386 $ hg commit
385 387 abort: cannot commit over an applied mq patch
386 388 [255]
387 389
388 390 push should fail
389 391
390 392 $ hg push ../../k
391 393 pushing to ../../k
392 394 abort: source has mq patches applied
393 395 [255]
394 396
395 397
396 398 import should fail
397 399
398 400 $ hg st .
399 401 $ echo foo >> ../a
400 402 $ hg diff > ../../import.diff
401 403 $ hg revert --no-backup ../a
402 404 $ hg import ../../import.diff
403 405 abort: cannot import over an applied patch
404 406 [255]
405 407 $ hg st
406 408
407 409 import --no-commit should succeed
408 410
409 411 $ hg import --no-commit ../../import.diff
410 412 applying ../../import.diff
411 413 $ hg st
412 414 M a
413 415 $ hg revert --no-backup ../a
414 416
415 417
416 418 qunapplied
417 419
418 420 $ hg qunapplied
419 421 test2.patch
420 422
421 423
422 424 qpush/qpop with index
423 425
424 426 $ hg qnew test1b.patch
425 427 $ echo 1b > 1b
426 428 $ hg add 1b
427 429 $ hg qrefresh
428 430 $ hg qpush 2
429 431 applying test2.patch
430 432 now at: test2.patch
431 433 $ hg qpop 0
432 434 popping test2.patch
433 435 popping test1b.patch
434 436 now at: test.patch
435 437 $ hg qpush test.patch+1
436 438 applying test1b.patch
437 439 now at: test1b.patch
438 440 $ hg qpush test.patch+2
439 441 applying test2.patch
440 442 now at: test2.patch
441 443 $ hg qpop test2.patch-1
442 444 popping test2.patch
443 445 now at: test1b.patch
444 446 $ hg qpop test2.patch-2
445 447 popping test1b.patch
446 448 now at: test.patch
447 449 $ hg qpush test1b.patch+1
448 450 applying test1b.patch
449 451 applying test2.patch
450 452 now at: test2.patch
451 453
452 454
453 455 qpush --move
454 456
455 457 $ hg qpop -a
456 458 popping test2.patch
457 459 popping test1b.patch
458 460 popping test.patch
459 461 patch queue now empty
460 462 $ hg qguard test1b.patch -- -negguard
461 463 $ hg qguard test2.patch -- +posguard
462 464 $ hg qpush --move test2.patch # can't move guarded patch
463 465 cannot push 'test2.patch' - guarded by '+posguard'
464 466 [1]
465 467 $ hg qselect posguard
466 468 number of unguarded, unapplied patches has changed from 2 to 3
467 469 $ hg qpush --move test2.patch # move to front
468 470 applying test2.patch
469 471 now at: test2.patch
470 472 $ hg qpush --move test1b.patch # negative guard unselected
471 473 applying test1b.patch
472 474 now at: test1b.patch
473 475 $ hg qpush --move test.patch # noop move
474 476 applying test.patch
475 477 now at: test.patch
476 478 $ hg qseries -v
477 479 0 A test2.patch
478 480 1 A test1b.patch
479 481 2 A test.patch
480 482 $ hg qpop -a
481 483 popping test.patch
482 484 popping test1b.patch
483 485 popping test2.patch
484 486 patch queue now empty
485 487
486 488 cleaning up
487 489
488 490 $ hg qselect --none
489 491 guards deactivated
490 492 number of unguarded, unapplied patches has changed from 3 to 2
491 493 $ hg qguard --none test1b.patch
492 494 $ hg qguard --none test2.patch
493 495 $ hg qpush --move test.patch
494 496 applying test.patch
495 497 now at: test.patch
496 498 $ hg qpush --move test1b.patch
497 499 applying test1b.patch
498 500 now at: test1b.patch
499 501 $ hg qpush --move bogus # nonexistent patch
500 502 abort: patch bogus not in series
501 503 [255]
502 504 $ hg qpush --move # no patch
503 505 abort: please specify the patch to move
504 506 [255]
505 507 $ hg qpush --move test.patch # already applied
506 508 abort: cannot push to a previous patch: test.patch
507 509 [255]
508 510 $ hg qpush
509 511 applying test2.patch
510 512 now at: test2.patch
511 513
512 514
513 515 series after move
514 516
515 517 $ cat `hg root`/.hg/patches/series
516 518 test.patch
517 519 test1b.patch
518 520 test2.patch
519 521 # comment
520 522
521 523
522 524
523 525 pop, qapplied, qunapplied
524 526
525 527 $ hg qseries -v
526 528 0 A test.patch
527 529 1 A test1b.patch
528 530 2 A test2.patch
529 531
530 532 qapplied -1 test.patch
531 533
532 534 $ hg qapplied -1 test.patch
533 535 only one patch applied
534 536 [1]
535 537
536 538 qapplied -1 test1b.patch
537 539
538 540 $ hg qapplied -1 test1b.patch
539 541 test.patch
540 542
541 543 qapplied -1 test2.patch
542 544
543 545 $ hg qapplied -1 test2.patch
544 546 test1b.patch
545 547
546 548 qapplied -1
547 549
548 550 $ hg qapplied -1
549 551 test1b.patch
550 552
551 553 qapplied
552 554
553 555 $ hg qapplied
554 556 test.patch
555 557 test1b.patch
556 558 test2.patch
557 559
558 560 qapplied test1b.patch
559 561
560 562 $ hg qapplied test1b.patch
561 563 test.patch
562 564 test1b.patch
563 565
564 566 qunapplied -1
565 567
566 568 $ hg qunapplied -1
567 569 all patches applied
568 570 [1]
569 571
570 572 qunapplied
571 573
572 574 $ hg qunapplied
573 575
574 576 popping
575 577
576 578 $ hg qpop
577 579 popping test2.patch
578 580 now at: test1b.patch
579 581
580 582 qunapplied -1
581 583
582 584 $ hg qunapplied -1
583 585 test2.patch
584 586
585 587 qunapplied
586 588
587 589 $ hg qunapplied
588 590 test2.patch
589 591
590 592 qunapplied test2.patch
591 593
592 594 $ hg qunapplied test2.patch
593 595
594 596 qunapplied -1 test2.patch
595 597
596 598 $ hg qunapplied -1 test2.patch
597 599 all patches applied
598 600 [1]
599 601
600 602 popping -a
601 603
602 604 $ hg qpop -a
603 605 popping test1b.patch
604 606 popping test.patch
605 607 patch queue now empty
606 608
607 609 qapplied
608 610
609 611 $ hg qapplied
610 612
611 613 qapplied -1
612 614
613 615 $ hg qapplied -1
614 616 no patches applied
615 617 [1]
616 618 $ hg qpush
617 619 applying test.patch
618 620 now at: test.patch
619 621
620 622
621 623 push should succeed
622 624
623 625 $ hg qpop -a
624 626 popping test.patch
625 627 patch queue now empty
626 628 $ hg push ../../k
627 629 pushing to ../../k
628 630 searching for changes
629 631 adding changesets
630 632 adding manifests
631 633 adding file changes
632 634 added 1 changesets with 1 changes to 1 files
633 635
634 636
635 637 we want to start with some patches applied
636 638
637 639 $ hg qpush -a
638 640 applying test.patch
639 641 applying test1b.patch
640 642 applying test2.patch
641 643 now at: test2.patch
642 644
643 645 % pops all patches and succeeds
644 646
645 647 $ hg qpop -a
646 648 popping test2.patch
647 649 popping test1b.patch
648 650 popping test.patch
649 651 patch queue now empty
650 652
651 653 % does nothing and succeeds
652 654
653 655 $ hg qpop -a
654 656 no patches applied
655 657
656 658 % fails - nothing else to pop
657 659
658 660 $ hg qpop
659 661 no patches applied
660 662 [1]
661 663
662 664 % pushes a patch and succeeds
663 665
664 666 $ hg qpush
665 667 applying test.patch
666 668 now at: test.patch
667 669
668 670 % pops a patch and succeeds
669 671
670 672 $ hg qpop
671 673 popping test.patch
672 674 patch queue now empty
673 675
674 676 % pushes up to test1b.patch and succeeds
675 677
676 678 $ hg qpush test1b.patch
677 679 applying test.patch
678 680 applying test1b.patch
679 681 now at: test1b.patch
680 682
681 683 % does nothing and succeeds
682 684
683 685 $ hg qpush test1b.patch
684 686 qpush: test1b.patch is already at the top
685 687
686 688 % does nothing and succeeds
687 689
688 690 $ hg qpop test1b.patch
689 691 qpop: test1b.patch is already at the top
690 692
691 693 % fails - can't push to this patch
692 694
693 695 $ hg qpush test.patch
694 696 abort: cannot push to a previous patch: test.patch
695 697 [255]
696 698
697 699 % fails - can't pop to this patch
698 700
699 701 $ hg qpop test2.patch
700 702 abort: patch test2.patch is not applied
701 703 [255]
702 704
703 705 % pops up to test.patch and succeeds
704 706
705 707 $ hg qpop test.patch
706 708 popping test1b.patch
707 709 now at: test.patch
708 710
709 711 % pushes all patches and succeeds
710 712
711 713 $ hg qpush -a
712 714 applying test1b.patch
713 715 applying test2.patch
714 716 now at: test2.patch
715 717
716 718 % does nothing and succeeds
717 719
718 720 $ hg qpush -a
719 721 all patches are currently applied
720 722
721 723 % fails - nothing else to push
722 724
723 725 $ hg qpush
724 726 patch series already fully applied
725 727 [1]
726 728
727 729 % does nothing and succeeds
728 730
729 731 $ hg qpush test2.patch
730 732 qpush: test2.patch is already at the top
731 733
732 734 strip
733 735
734 736 $ cd ../../b
735 737 $ echo x>x
736 738 $ hg ci -Ama
737 739 adding x
738 740 $ hg strip tip
739 741 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
740 742 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
741 743 $ hg unbundle .hg/strip-backup/*
742 744 adding changesets
743 745 adding manifests
744 746 adding file changes
745 747 added 1 changesets with 1 changes to 1 files
746 748 (run 'hg update' to get a working copy)
747 749
748 750
749 751 strip with local changes, should complain
750 752
751 753 $ hg up
752 754 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
753 755 $ echo y>y
754 756 $ hg add y
755 757 $ hg strip tip
756 758 abort: local changes found
757 759 [255]
758 760
759 761 --force strip with local changes
760 762
761 763 $ hg strip -f tip
762 764 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
763 765 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
764 766
765 767
766 768 cd b; hg qrefresh
767 769
768 770 $ hg init refresh
769 771 $ cd refresh
770 772 $ echo a > a
771 773 $ hg ci -Ama
772 774 adding a
773 775 $ hg qnew -mfoo foo
774 776 $ echo a >> a
775 777 $ hg qrefresh
776 778 $ mkdir b
777 779 $ cd b
778 780 $ echo f > f
779 781 $ hg add f
780 782 $ hg qrefresh
781 783 $ cat ../.hg/patches/foo
782 784 foo
783 785
784 786 diff -r cb9a9f314b8b a
785 787 --- a/a\t(?P<date>.*) (re)
786 788 \+\+\+ b/a\t(?P<date>.*) (re)
787 789 @@ -1,1 +1,2 @@
788 790 a
789 791 +a
790 792 diff -r cb9a9f314b8b b/f
791 793 --- /dev/null\t(?P<date>.*) (re)
792 794 \+\+\+ b/b/f\t(?P<date>.*) (re)
793 795 @@ -0,0 +1,1 @@
794 796 +f
795 797
796 798 hg qrefresh .
797 799
798 800 $ hg qrefresh .
799 801 $ cat ../.hg/patches/foo
800 802 foo
801 803
802 804 diff -r cb9a9f314b8b b/f
803 805 --- /dev/null\t(?P<date>.*) (re)
804 806 \+\+\+ b/b/f\t(?P<date>.*) (re)
805 807 @@ -0,0 +1,1 @@
806 808 +f
807 809 $ hg status
808 810 M a
809 811
810 812
811 813 qpush failure
812 814
813 815 $ cd ..
814 816 $ hg qrefresh
815 817 $ hg qnew -mbar bar
816 818 $ echo foo > foo
817 819 $ echo bar > bar
818 820 $ hg add foo bar
819 821 $ hg qrefresh
820 822 $ hg qpop -a
821 823 popping bar
822 824 popping foo
823 825 patch queue now empty
824 826 $ echo bar > foo
825 827 $ hg qpush -a
826 828 applying foo
827 829 applying bar
828 830 file foo already exists
829 831 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
830 832 patch failed, unable to continue (try -v)
831 833 patch failed, rejects left in working dir
832 834 errors during apply, please fix and refresh bar
833 835 [2]
834 836 $ hg st
835 837 ? foo
836 838 ? foo.rej
837 839
838 840
839 841 mq tags
840 842
841 843 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
842 844 0 qparent
843 845 1 foo qbase
844 846 2 bar qtip tip
845 847
846 848 mq revset
847 849
848 850 $ hg log -r 'mq()' --template '{rev}\n'
849 851 1
850 852 2
851 853 $ hg help revsets | grep -i mq
852 854 "mq()"
853 855 Changesets managed by MQ.
854 856
855 857 bad node in status
856 858
857 859 $ hg qpop
858 860 popping bar
859 861 now at: foo
860 862 $ hg strip -qn tip
861 863 $ hg tip
862 864 changeset: 0:cb9a9f314b8b
863 865 tag: tip
864 866 user: test
865 867 date: Thu Jan 01 00:00:00 1970 +0000
866 868 summary: a
867 869
868 870 $ hg branches
869 871 default 0:cb9a9f314b8b
870 872 $ hg qpop
871 873 no patches applied
872 874 [1]
873 875
874 876 $ cat >>$HGRCPATH <<EOF
875 877 > [diff]
876 878 > git = True
877 879 > EOF
878 880 $ cd ..
879 881 $ hg init git
880 882 $ cd git
881 883 $ hg qinit
882 884
883 885 $ hg qnew -m'new file' new
884 886 $ echo foo > new
885 887 $ chmod +x new
886 888 $ hg add new
887 889 $ hg qrefresh
888 890 $ cat .hg/patches/new
889 891 new file
890 892
891 893 diff --git a/new b/new
892 894 new file mode 100755
893 895 --- /dev/null
894 896 +++ b/new
895 897 @@ -0,0 +1,1 @@
896 898 +foo
897 899
898 900 $ hg qnew -m'copy file' copy
899 901 $ hg cp new copy
900 902 $ hg qrefresh
901 903 $ cat .hg/patches/copy
902 904 copy file
903 905
904 906 diff --git a/new b/copy
905 907 copy from new
906 908 copy to copy
907 909
908 910 $ hg qpop
909 911 popping copy
910 912 now at: new
911 913 $ hg qpush
912 914 applying copy
913 915 now at: copy
914 916 $ hg qdiff
915 917 diff --git a/new b/copy
916 918 copy from new
917 919 copy to copy
918 920 $ cat >>$HGRCPATH <<EOF
919 921 > [diff]
920 922 > git = False
921 923 > EOF
922 924 $ hg qdiff --git
923 925 diff --git a/new b/copy
924 926 copy from new
925 927 copy to copy
926 928 $ cd ..
927 929
928 930 empty lines in status
929 931
930 932 $ hg init emptystatus
931 933 $ cd emptystatus
932 934 $ hg qinit
933 935 $ printf '\n\n' > .hg/patches/status
934 936 $ hg qser
935 937 $ cd ..
936 938
937 939 bad line in status (without ":")
938 940
939 941 $ hg init badstatus
940 942 $ cd badstatus
941 943 $ hg qinit
942 944 $ printf 'babar has no colon in this line\n' > .hg/patches/status
943 945 $ hg qser
944 946 malformated mq status line: ['babar has no colon in this line']
945 947 $ cd ..
946 948
947 949
948 950 test file addition in slow path
949 951
950 952 $ hg init slow
951 953 $ cd slow
952 954 $ hg qinit
953 955 $ echo foo > foo
954 956 $ hg add foo
955 957 $ hg ci -m 'add foo'
956 958 $ hg qnew bar
957 959 $ echo bar > bar
958 960 $ hg add bar
959 961 $ hg mv foo baz
960 962 $ hg qrefresh --git
961 963 $ hg up -C 0
962 964 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
963 965 $ echo >> foo
964 966 $ hg ci -m 'change foo'
965 967 created new head
966 968 $ hg up -C 1
967 969 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
968 970 $ hg qrefresh --git
969 971 $ cat .hg/patches/bar
970 972 diff --git a/bar b/bar
971 973 new file mode 100644
972 974 --- /dev/null
973 975 +++ b/bar
974 976 @@ -0,0 +1,1 @@
975 977 +bar
976 978 diff --git a/foo b/baz
977 979 rename from foo
978 980 rename to baz
979 981 $ hg log -v --template '{rev} {file_copies}\n' -r .
980 982 2 baz (foo)
981 983 $ hg qrefresh --git
982 984 $ cat .hg/patches/bar
983 985 diff --git a/bar b/bar
984 986 new file mode 100644
985 987 --- /dev/null
986 988 +++ b/bar
987 989 @@ -0,0 +1,1 @@
988 990 +bar
989 991 diff --git a/foo b/baz
990 992 rename from foo
991 993 rename to baz
992 994 $ hg log -v --template '{rev} {file_copies}\n' -r .
993 995 2 baz (foo)
994 996 $ hg qrefresh
995 997 $ grep 'diff --git' .hg/patches/bar
996 998 diff --git a/bar b/bar
997 999 diff --git a/foo b/baz
998 1000
999 1001
1000 1002 test file move chains in the slow path
1001 1003
1002 1004 $ hg up -C 1
1003 1005 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1004 1006 $ echo >> foo
1005 1007 $ hg ci -m 'change foo again'
1006 1008 $ hg up -C 2
1007 1009 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1008 1010 $ hg mv bar quux
1009 1011 $ hg mv baz bleh
1010 1012 $ hg qrefresh --git
1011 1013 $ cat .hg/patches/bar
1012 1014 diff --git a/foo b/bleh
1013 1015 rename from foo
1014 1016 rename to bleh
1015 1017 diff --git a/quux b/quux
1016 1018 new file mode 100644
1017 1019 --- /dev/null
1018 1020 +++ b/quux
1019 1021 @@ -0,0 +1,1 @@
1020 1022 +bar
1021 1023 $ hg log -v --template '{rev} {file_copies}\n' -r .
1022 1024 3 bleh (foo)
1023 1025 $ hg mv quux fred
1024 1026 $ hg mv bleh barney
1025 1027 $ hg qrefresh --git
1026 1028 $ cat .hg/patches/bar
1027 1029 diff --git a/foo b/barney
1028 1030 rename from foo
1029 1031 rename to barney
1030 1032 diff --git a/fred b/fred
1031 1033 new file mode 100644
1032 1034 --- /dev/null
1033 1035 +++ b/fred
1034 1036 @@ -0,0 +1,1 @@
1035 1037 +bar
1036 1038 $ hg log -v --template '{rev} {file_copies}\n' -r .
1037 1039 3 barney (foo)
1038 1040
1039 1041
1040 1042 refresh omitting an added file
1041 1043
1042 1044 $ hg qnew baz
1043 1045 $ echo newfile > newfile
1044 1046 $ hg add newfile
1045 1047 $ hg qrefresh
1046 1048 $ hg st -A newfile
1047 1049 C newfile
1048 1050 $ hg qrefresh -X newfile
1049 1051 $ hg st -A newfile
1050 1052 A newfile
1051 1053 $ hg revert newfile
1052 1054 $ rm newfile
1053 1055 $ hg qpop
1054 1056 popping baz
1055 1057 now at: bar
1056 1058 $ hg qdel baz
1057 1059
1058 1060
1059 1061 create a git patch
1060 1062
1061 1063 $ echo a > alexander
1062 1064 $ hg add alexander
1063 1065 $ hg qnew -f --git addalexander
1064 1066 $ grep diff .hg/patches/addalexander
1065 1067 diff --git a/alexander b/alexander
1066 1068
1067 1069
1068 1070 create a git binary patch
1069 1071
1070 1072 $ cat > writebin.py <<EOF
1071 1073 > import sys
1072 1074 > path = sys.argv[1]
1073 1075 > open(path, 'wb').write('BIN\x00ARY')
1074 1076 > EOF
1075 1077 $ python writebin.py bucephalus
1076 1078
1077 1079 $ python "$TESTDIR/md5sum.py" bucephalus
1078 1080 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1079 1081 $ hg add bucephalus
1080 1082 $ hg qnew -f --git addbucephalus
1081 1083 $ grep diff .hg/patches/addbucephalus
1082 1084 diff --git a/bucephalus b/bucephalus
1083 1085
1084 1086
1085 1087 check binary patches can be popped and pushed
1086 1088
1087 1089 $ hg qpop
1088 1090 popping addbucephalus
1089 1091 now at: addalexander
1090 1092 $ test -f bucephalus && echo % bucephalus should not be there
1091 1093 [1]
1092 1094 $ hg qpush
1093 1095 applying addbucephalus
1094 1096 now at: addbucephalus
1095 1097 $ test -f bucephalus
1096 1098 $ python "$TESTDIR/md5sum.py" bucephalus
1097 1099 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1098 1100
1099 1101
1100 1102
1101 1103 strip again
1102 1104
1103 1105 $ cd ..
1104 1106 $ hg init strip
1105 1107 $ cd strip
1106 1108 $ touch foo
1107 1109 $ hg add foo
1108 1110 $ hg ci -m 'add foo'
1109 1111 $ echo >> foo
1110 1112 $ hg ci -m 'change foo 1'
1111 1113 $ hg up -C 0
1112 1114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1113 1115 $ echo 1 >> foo
1114 1116 $ hg ci -m 'change foo 2'
1115 1117 created new head
1116 1118 $ HGMERGE=true hg merge
1117 1119 merging foo
1118 1120 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1119 1121 (branch merge, don't forget to commit)
1120 1122 $ hg ci -m merge
1121 1123 $ hg log
1122 1124 changeset: 3:99615015637b
1123 1125 tag: tip
1124 1126 parent: 2:20cbbe65cff7
1125 1127 parent: 1:d2871fc282d4
1126 1128 user: test
1127 1129 date: Thu Jan 01 00:00:00 1970 +0000
1128 1130 summary: merge
1129 1131
1130 1132 changeset: 2:20cbbe65cff7
1131 1133 parent: 0:53245c60e682
1132 1134 user: test
1133 1135 date: Thu Jan 01 00:00:00 1970 +0000
1134 1136 summary: change foo 2
1135 1137
1136 1138 changeset: 1:d2871fc282d4
1137 1139 user: test
1138 1140 date: Thu Jan 01 00:00:00 1970 +0000
1139 1141 summary: change foo 1
1140 1142
1141 1143 changeset: 0:53245c60e682
1142 1144 user: test
1143 1145 date: Thu Jan 01 00:00:00 1970 +0000
1144 1146 summary: add foo
1145 1147
1146 1148 $ hg strip 1
1147 1149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1148 1150 saved backup bundle to $TESTTMP/b/strip/.hg/strip-backup/*-backup.hg (glob)
1149 1151 $ checkundo strip
1150 1152 $ hg log
1151 1153 changeset: 1:20cbbe65cff7
1152 1154 tag: tip
1153 1155 user: test
1154 1156 date: Thu Jan 01 00:00:00 1970 +0000
1155 1157 summary: change foo 2
1156 1158
1157 1159 changeset: 0:53245c60e682
1158 1160 user: test
1159 1161 date: Thu Jan 01 00:00:00 1970 +0000
1160 1162 summary: add foo
1161 1163
1162 1164 $ cd ..
1163 1165
1164 1166
1165 1167 qclone
1166 1168
1167 1169 $ qlog()
1168 1170 > {
1169 1171 > echo 'main repo:'
1170 1172 > hg log --template ' rev {rev}: {desc}\n'
1171 1173 > echo 'patch repo:'
1172 1174 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1173 1175 > }
1174 1176 $ hg init qclonesource
1175 1177 $ cd qclonesource
1176 1178 $ echo foo > foo
1177 1179 $ hg add foo
1178 1180 $ hg ci -m 'add foo'
1179 1181 $ hg qinit
1180 1182 $ hg qnew patch1
1181 1183 $ echo bar >> foo
1182 1184 $ hg qrefresh -m 'change foo'
1183 1185 $ cd ..
1184 1186
1185 1187
1186 1188 repo with unversioned patch dir
1187 1189
1188 1190 $ hg qclone qclonesource failure
1189 1191 abort: versioned patch repository not found (see init --mq)
1190 1192 [255]
1191 1193
1192 1194 $ cd qclonesource
1193 1195 $ hg qinit -c
1194 1196 adding .hg/patches/patch1
1195 1197 $ hg qci -m checkpoint
1196 1198 $ qlog
1197 1199 main repo:
1198 1200 rev 1: change foo
1199 1201 rev 0: add foo
1200 1202 patch repo:
1201 1203 rev 0: checkpoint
1202 1204 $ cd ..
1203 1205
1204 1206
1205 1207 repo with patches applied
1206 1208
1207 1209 $ hg qclone qclonesource qclonedest
1208 1210 updating to branch default
1209 1211 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1210 1212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1211 1213 $ cd qclonedest
1212 1214 $ qlog
1213 1215 main repo:
1214 1216 rev 0: add foo
1215 1217 patch repo:
1216 1218 rev 0: checkpoint
1217 1219 $ cd ..
1218 1220
1219 1221
1220 1222 repo with patches unapplied
1221 1223
1222 1224 $ cd qclonesource
1223 1225 $ hg qpop -a
1224 1226 popping patch1
1225 1227 patch queue now empty
1226 1228 $ qlog
1227 1229 main repo:
1228 1230 rev 0: add foo
1229 1231 patch repo:
1230 1232 rev 0: checkpoint
1231 1233 $ cd ..
1232 1234 $ hg qclone qclonesource qclonedest2
1233 1235 updating to branch default
1234 1236 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1235 1237 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1236 1238 $ cd qclonedest2
1237 1239 $ qlog
1238 1240 main repo:
1239 1241 rev 0: add foo
1240 1242 patch repo:
1241 1243 rev 0: checkpoint
1242 1244 $ cd ..
1243 1245
1244 1246
1245 1247 Issue1033: test applying on an empty file
1246 1248
1247 1249 $ hg init empty
1248 1250 $ cd empty
1249 1251 $ touch a
1250 1252 $ hg ci -Am addempty
1251 1253 adding a
1252 1254 $ echo a > a
1253 1255 $ hg qnew -f -e changea
1254 1256 $ hg qpop
1255 1257 popping changea
1256 1258 patch queue now empty
1257 1259 $ hg qpush
1258 1260 applying changea
1259 1261 now at: changea
1260 1262 $ cd ..
1261 1263
1262 1264 test qpush with --force, issue1087
1263 1265
1264 1266 $ hg init forcepush
1265 1267 $ cd forcepush
1266 1268 $ echo hello > hello.txt
1267 1269 $ echo bye > bye.txt
1268 1270 $ hg ci -Ama
1269 1271 adding bye.txt
1270 1272 adding hello.txt
1271 1273 $ hg qnew -d '0 0' empty
1272 1274 $ hg qpop
1273 1275 popping empty
1274 1276 patch queue now empty
1275 1277 $ echo world >> hello.txt
1276 1278
1277 1279
1278 1280 qpush should fail, local changes
1279 1281
1280 1282 $ hg qpush
1281 1283 abort: local changes found
1282 1284 [255]
1283 1285
1284 1286
1285 1287 apply force, should not discard changes with empty patch
1286 1288
1287 1289 $ hg qpush -f
1288 1290 applying empty
1289 1291 patch empty is empty
1290 1292 now at: empty
1291 1293 $ hg diff --config diff.nodates=True
1292 1294 diff -r d58265112590 hello.txt
1293 1295 --- a/hello.txt
1294 1296 +++ b/hello.txt
1295 1297 @@ -1,1 +1,2 @@
1296 1298 hello
1297 1299 +world
1298 1300 $ hg qdiff --config diff.nodates=True
1299 1301 diff -r 9ecee4f634e3 hello.txt
1300 1302 --- a/hello.txt
1301 1303 +++ b/hello.txt
1302 1304 @@ -1,1 +1,2 @@
1303 1305 hello
1304 1306 +world
1305 1307 $ hg log -l1 -p
1306 1308 changeset: 1:d58265112590
1307 1309 tag: empty
1308 1310 tag: qbase
1309 1311 tag: qtip
1310 1312 tag: tip
1311 1313 user: test
1312 1314 date: Thu Jan 01 00:00:00 1970 +0000
1313 1315 summary: imported patch empty
1314 1316
1315 1317
1316 1318 $ hg qref -d '0 0'
1317 1319 $ hg qpop
1318 1320 popping empty
1319 1321 patch queue now empty
1320 1322 $ echo universe >> hello.txt
1321 1323 $ echo universe >> bye.txt
1322 1324
1323 1325
1324 1326 qpush should fail, local changes
1325 1327
1326 1328 $ hg qpush
1327 1329 abort: local changes found
1328 1330 [255]
1329 1331
1330 1332
1331 1333 apply force, should discard changes in hello, but not bye
1332 1334
1333 1335 $ hg qpush -f
1334 1336 applying empty
1335 1337 now at: empty
1336 1338 $ hg st
1337 1339 M bye.txt
1338 1340 $ hg diff --config diff.nodates=True
1339 1341 diff -r ba252371dbc1 bye.txt
1340 1342 --- a/bye.txt
1341 1343 +++ b/bye.txt
1342 1344 @@ -1,1 +1,2 @@
1343 1345 bye
1344 1346 +universe
1345 1347 $ hg qdiff --config diff.nodates=True
1346 1348 diff -r 9ecee4f634e3 bye.txt
1347 1349 --- a/bye.txt
1348 1350 +++ b/bye.txt
1349 1351 @@ -1,1 +1,2 @@
1350 1352 bye
1351 1353 +universe
1352 1354 diff -r 9ecee4f634e3 hello.txt
1353 1355 --- a/hello.txt
1354 1356 +++ b/hello.txt
1355 1357 @@ -1,1 +1,3 @@
1356 1358 hello
1357 1359 +world
1358 1360 +universe
1359 1361
1360 1362
1361 1363 test popping revisions not in working dir ancestry
1362 1364
1363 1365 $ hg qseries -v
1364 1366 0 A empty
1365 1367 $ hg up qparent
1366 1368 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1367 1369 $ hg qpop
1368 1370 popping empty
1369 1371 patch queue now empty
1370 1372
1371 1373 $ cd ..
1372 1374 $ hg init deletion-order
1373 1375 $ cd deletion-order
1374 1376
1375 1377 $ touch a
1376 1378 $ hg ci -Aqm0
1377 1379
1378 1380 $ hg qnew rename-dir
1379 1381 $ hg rm a
1380 1382 $ hg qrefresh
1381 1383
1382 1384 $ mkdir a b
1383 1385 $ touch a/a b/b
1384 1386 $ hg add -q a b
1385 1387 $ hg qrefresh
1386 1388
1387 1389
1388 1390 test popping must remove files added in subdirectories first
1389 1391
1390 1392 $ hg qpop
1391 1393 popping rename-dir
1392 1394 patch queue now empty
1393 1395 $ cd ..
1394 1396
@@ -1,961 +1,963 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 Set up a repo
2 4
3 5 $ echo "[ui]" >> $HGRCPATH
4 6 $ echo "interactive=true" >> $HGRCPATH
5 7 $ echo "[extensions]" >> $HGRCPATH
6 8 $ echo "record=" >> $HGRCPATH
7 9
8 10 $ hg init a
9 11 $ cd a
10 12
11 13 Select no files
12 14
13 15 $ touch empty-rw
14 16 $ hg add empty-rw
15 17
16 18 $ hg record empty-rw<<EOF
17 19 > n
18 20 > EOF
19 21 diff --git a/empty-rw b/empty-rw
20 22 new file mode 100644
21 23 examine changes to 'empty-rw'? [Ynsfdaq?]
22 24 no changes to record
23 25
24 26 $ hg tip -p
25 27 changeset: -1:000000000000
26 28 tag: tip
27 29 user:
28 30 date: Thu Jan 01 00:00:00 1970 +0000
29 31
30 32
31 33
32 34 Select files but no hunks
33 35
34 36 $ hg record empty-rw<<EOF
35 37 > y
36 38 > n
37 39 > EOF
38 40 diff --git a/empty-rw b/empty-rw
39 41 new file mode 100644
40 42 examine changes to 'empty-rw'? [Ynsfdaq?]
41 43 abort: empty commit message
42 44 [255]
43 45
44 46 $ hg tip -p
45 47 changeset: -1:000000000000
46 48 tag: tip
47 49 user:
48 50 date: Thu Jan 01 00:00:00 1970 +0000
49 51
50 52
51 53
52 54 Record empty file
53 55
54 56 $ hg record -d '0 0' -m empty empty-rw<<EOF
55 57 > y
56 58 > y
57 59 > EOF
58 60 diff --git a/empty-rw b/empty-rw
59 61 new file mode 100644
60 62 examine changes to 'empty-rw'? [Ynsfdaq?]
61 63
62 64 $ hg tip -p
63 65 changeset: 0:c0708cf4e46e
64 66 tag: tip
65 67 user: test
66 68 date: Thu Jan 01 00:00:00 1970 +0000
67 69 summary: empty
68 70
69 71
70 72
71 73 Summary shows we updated to the new cset
72 74
73 75 $ hg summary
74 76 parent: 0:c0708cf4e46e tip
75 77 empty
76 78 branch: default
77 79 commit: (clean)
78 80 update: (current)
79 81
80 82 Rename empty file
81 83
82 84 $ hg mv empty-rw empty-rename
83 85 $ hg record -d '1 0' -m rename<<EOF
84 86 > y
85 87 > EOF
86 88 diff --git a/empty-rw b/empty-rename
87 89 rename from empty-rw
88 90 rename to empty-rename
89 91 examine changes to 'empty-rw' and 'empty-rename'? [Ynsfdaq?]
90 92
91 93 $ hg tip -p
92 94 changeset: 1:d695e8dcb197
93 95 tag: tip
94 96 user: test
95 97 date: Thu Jan 01 00:00:01 1970 +0000
96 98 summary: rename
97 99
98 100
99 101
100 102 Copy empty file
101 103
102 104 $ hg cp empty-rename empty-copy
103 105 $ hg record -d '2 0' -m copy<<EOF
104 106 > y
105 107 > EOF
106 108 diff --git a/empty-rename b/empty-copy
107 109 copy from empty-rename
108 110 copy to empty-copy
109 111 examine changes to 'empty-rename' and 'empty-copy'? [Ynsfdaq?]
110 112
111 113 $ hg tip -p
112 114 changeset: 2:1d4b90bea524
113 115 tag: tip
114 116 user: test
115 117 date: Thu Jan 01 00:00:02 1970 +0000
116 118 summary: copy
117 119
118 120
119 121
120 122 Delete empty file
121 123
122 124 $ hg rm empty-copy
123 125 $ hg record -d '3 0' -m delete<<EOF
124 126 > y
125 127 > EOF
126 128 diff --git a/empty-copy b/empty-copy
127 129 deleted file mode 100644
128 130 examine changes to 'empty-copy'? [Ynsfdaq?]
129 131
130 132 $ hg tip -p
131 133 changeset: 3:b39a238f01a1
132 134 tag: tip
133 135 user: test
134 136 date: Thu Jan 01 00:00:03 1970 +0000
135 137 summary: delete
136 138
137 139
138 140
139 141 Add binary file
140 142
141 143 $ hg bundle --base -2 tip.bundle
142 144 1 changesets found
143 145 $ hg add tip.bundle
144 146 $ hg record -d '4 0' -m binary<<EOF
145 147 > y
146 148 > EOF
147 149 diff --git a/tip.bundle b/tip.bundle
148 150 new file mode 100644
149 151 this is a binary file
150 152 examine changes to 'tip.bundle'? [Ynsfdaq?]
151 153
152 154 $ hg tip -p
153 155 changeset: 4:ad816da3711e
154 156 tag: tip
155 157 user: test
156 158 date: Thu Jan 01 00:00:04 1970 +0000
157 159 summary: binary
158 160
159 161 diff -r b39a238f01a1 -r ad816da3711e tip.bundle
160 162 Binary file tip.bundle has changed
161 163
162 164
163 165 Change binary file
164 166
165 167 $ hg bundle --base -2 tip.bundle
166 168 1 changesets found
167 169 $ hg record -d '5 0' -m binary-change<<EOF
168 170 > y
169 171 > EOF
170 172 diff --git a/tip.bundle b/tip.bundle
171 173 this modifies a binary file (all or nothing)
172 174 examine changes to 'tip.bundle'? [Ynsfdaq?]
173 175
174 176 $ hg tip -p
175 177 changeset: 5:dccd6f3eb485
176 178 tag: tip
177 179 user: test
178 180 date: Thu Jan 01 00:00:05 1970 +0000
179 181 summary: binary-change
180 182
181 183 diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
182 184 Binary file tip.bundle has changed
183 185
184 186
185 187 Rename and change binary file
186 188
187 189 $ hg mv tip.bundle top.bundle
188 190 $ hg bundle --base -2 top.bundle
189 191 1 changesets found
190 192 $ hg record -d '6 0' -m binary-change-rename<<EOF
191 193 > y
192 194 > EOF
193 195 diff --git a/tip.bundle b/top.bundle
194 196 rename from tip.bundle
195 197 rename to top.bundle
196 198 this modifies a binary file (all or nothing)
197 199 examine changes to 'tip.bundle' and 'top.bundle'? [Ynsfdaq?]
198 200
199 201 $ hg tip -p
200 202 changeset: 6:7fa44105f5b3
201 203 tag: tip
202 204 user: test
203 205 date: Thu Jan 01 00:00:06 1970 +0000
204 206 summary: binary-change-rename
205 207
206 208 diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
207 209 Binary file tip.bundle has changed
208 210 diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
209 211 Binary file top.bundle has changed
210 212
211 213
212 214 Add plain file
213 215
214 216 $ for i in 1 2 3 4 5 6 7 8 9 10; do
215 217 > echo $i >> plain
216 218 > done
217 219
218 220 $ hg add plain
219 221 $ hg record -d '7 0' -m plain plain<<EOF
220 222 > y
221 223 > y
222 224 > EOF
223 225 diff --git a/plain b/plain
224 226 new file mode 100644
225 227 examine changes to 'plain'? [Ynsfdaq?]
226 228
227 229 $ hg tip -p
228 230 changeset: 7:11fb457c1be4
229 231 tag: tip
230 232 user: test
231 233 date: Thu Jan 01 00:00:07 1970 +0000
232 234 summary: plain
233 235
234 236 diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
235 237 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
236 238 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
237 239 @@ -0,0 +1,10 @@
238 240 +1
239 241 +2
240 242 +3
241 243 +4
242 244 +5
243 245 +6
244 246 +7
245 247 +8
246 248 +9
247 249 +10
248 250
249 251
250 252 Modify end of plain file
251 253
252 254 $ echo 11 >> plain
253 255 $ hg record -d '8 0' -m end plain <<EOF
254 256 > y
255 257 > y
256 258 > EOF
257 259 diff --git a/plain b/plain
258 260 1 hunks, 1 lines changed
259 261 examine changes to 'plain'? [Ynsfdaq?]
260 262 @@ -8,3 +8,4 @@
261 263 8
262 264 9
263 265 10
264 266 +11
265 267 record this change to 'plain'? [Ynsfdaq?]
266 268
267 269 Modify end of plain file, no EOL
268 270
269 271 $ hg tip --template '{node}' >> plain
270 272 $ hg record -d '9 0' -m noeol plain <<EOF
271 273 > y
272 274 > y
273 275 > EOF
274 276 diff --git a/plain b/plain
275 277 1 hunks, 1 lines changed
276 278 examine changes to 'plain'? [Ynsfdaq?]
277 279 @@ -9,3 +9,4 @@
278 280 9
279 281 10
280 282 11
281 283 +7264f99c5f5ff3261504828afa4fb4d406c3af54
282 284 \ No newline at end of file
283 285 record this change to 'plain'? [Ynsfdaq?]
284 286
285 287 Modify end of plain file, add EOL
286 288
287 289 $ echo >> plain
288 290 $ echo 1 > plain2
289 291 $ hg add plain2
290 292 $ hg record -d '10 0' -m eol plain plain2 <<EOF
291 293 > y
292 294 > y
293 295 > y
294 296 > EOF
295 297 diff --git a/plain b/plain
296 298 1 hunks, 1 lines changed
297 299 examine changes to 'plain'? [Ynsfdaq?]
298 300 @@ -9,4 +9,4 @@
299 301 9
300 302 10
301 303 11
302 304 -7264f99c5f5ff3261504828afa4fb4d406c3af54
303 305 \ No newline at end of file
304 306 +7264f99c5f5ff3261504828afa4fb4d406c3af54
305 307 record change 1/2 to 'plain'? [Ynsfdaq?]
306 308 diff --git a/plain2 b/plain2
307 309 new file mode 100644
308 310 examine changes to 'plain2'? [Ynsfdaq?]
309 311
310 312 Modify beginning, trim end, record both, add another file to test
311 313 changes numbering
312 314
313 315 $ rm plain
314 316 $ for i in 2 2 3 4 5 6 7 8 9 10; do
315 317 > echo $i >> plain
316 318 > done
317 319 $ echo 2 >> plain2
318 320
319 321 $ hg record -d '10 0' -m begin-and-end plain plain2 <<EOF
320 322 > y
321 323 > y
322 324 > y
323 325 > y
324 326 > y
325 327 > EOF
326 328 diff --git a/plain b/plain
327 329 2 hunks, 3 lines changed
328 330 examine changes to 'plain'? [Ynsfdaq?]
329 331 @@ -1,4 +1,4 @@
330 332 -1
331 333 +2
332 334 2
333 335 3
334 336 4
335 337 record change 1/3 to 'plain'? [Ynsfdaq?]
336 338 @@ -8,5 +8,3 @@
337 339 8
338 340 9
339 341 10
340 342 -11
341 343 -7264f99c5f5ff3261504828afa4fb4d406c3af54
342 344 record change 2/3 to 'plain'? [Ynsfdaq?]
343 345 diff --git a/plain2 b/plain2
344 346 1 hunks, 1 lines changed
345 347 examine changes to 'plain2'? [Ynsfdaq?]
346 348 @@ -1,1 +1,2 @@
347 349 1
348 350 +2
349 351 record change 3/3 to 'plain2'? [Ynsfdaq?]
350 352
351 353 $ hg tip -p
352 354 changeset: 11:21df83db12b8
353 355 tag: tip
354 356 user: test
355 357 date: Thu Jan 01 00:00:10 1970 +0000
356 358 summary: begin-and-end
357 359
358 360 diff -r ddb8b281c3ff -r 21df83db12b8 plain
359 361 --- a/plain Thu Jan 01 00:00:10 1970 +0000
360 362 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
361 363 @@ -1,4 +1,4 @@
362 364 -1
363 365 +2
364 366 2
365 367 3
366 368 4
367 369 @@ -8,5 +8,3 @@
368 370 8
369 371 9
370 372 10
371 373 -11
372 374 -7264f99c5f5ff3261504828afa4fb4d406c3af54
373 375 diff -r ddb8b281c3ff -r 21df83db12b8 plain2
374 376 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
375 377 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
376 378 @@ -1,1 +1,2 @@
377 379 1
378 380 +2
379 381
380 382
381 383 Trim beginning, modify end
382 384
383 385 $ rm plain
384 386 > for i in 4 5 6 7 8 9 10.new; do
385 387 > echo $i >> plain
386 388 > done
387 389
388 390 Record end
389 391
390 392 $ hg record -d '11 0' -m end-only plain <<EOF
391 393 > y
392 394 > n
393 395 > y
394 396 > EOF
395 397 diff --git a/plain b/plain
396 398 2 hunks, 4 lines changed
397 399 examine changes to 'plain'? [Ynsfdaq?]
398 400 @@ -1,9 +1,6 @@
399 401 -2
400 402 -2
401 403 -3
402 404 4
403 405 5
404 406 6
405 407 7
406 408 8
407 409 9
408 410 record change 1/2 to 'plain'? [Ynsfdaq?]
409 411 @@ -4,7 +1,7 @@
410 412 4
411 413 5
412 414 6
413 415 7
414 416 8
415 417 9
416 418 -10
417 419 +10.new
418 420 record change 2/2 to 'plain'? [Ynsfdaq?]
419 421
420 422 $ hg tip -p
421 423 changeset: 12:99337501826f
422 424 tag: tip
423 425 user: test
424 426 date: Thu Jan 01 00:00:11 1970 +0000
425 427 summary: end-only
426 428
427 429 diff -r 21df83db12b8 -r 99337501826f plain
428 430 --- a/plain Thu Jan 01 00:00:10 1970 +0000
429 431 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
430 432 @@ -7,4 +7,4 @@
431 433 7
432 434 8
433 435 9
434 436 -10
435 437 +10.new
436 438
437 439
438 440 Record beginning
439 441
440 442 $ hg record -d '12 0' -m begin-only plain <<EOF
441 443 > y
442 444 > y
443 445 > EOF
444 446 diff --git a/plain b/plain
445 447 1 hunks, 3 lines changed
446 448 examine changes to 'plain'? [Ynsfdaq?]
447 449 @@ -1,6 +1,3 @@
448 450 -2
449 451 -2
450 452 -3
451 453 4
452 454 5
453 455 6
454 456 record this change to 'plain'? [Ynsfdaq?]
455 457
456 458 $ hg tip -p
457 459 changeset: 13:bbd45465d540
458 460 tag: tip
459 461 user: test
460 462 date: Thu Jan 01 00:00:12 1970 +0000
461 463 summary: begin-only
462 464
463 465 diff -r 99337501826f -r bbd45465d540 plain
464 466 --- a/plain Thu Jan 01 00:00:11 1970 +0000
465 467 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
466 468 @@ -1,6 +1,3 @@
467 469 -2
468 470 -2
469 471 -3
470 472 4
471 473 5
472 474 6
473 475
474 476
475 477 Add to beginning, trim from end
476 478
477 479 $ rm plain
478 480 $ for i in 1 2 3 4 5 6 7 8 9; do
479 481 > echo $i >> plain
480 482 > done
481 483
482 484 Record end
483 485
484 486 $ hg record --traceback -d '13 0' -m end-again plain<<EOF
485 487 > y
486 488 > n
487 489 > y
488 490 > EOF
489 491 diff --git a/plain b/plain
490 492 2 hunks, 4 lines changed
491 493 examine changes to 'plain'? [Ynsfdaq?]
492 494 @@ -1,6 +1,9 @@
493 495 +1
494 496 +2
495 497 +3
496 498 4
497 499 5
498 500 6
499 501 7
500 502 8
501 503 9
502 504 record change 1/2 to 'plain'? [Ynsfdaq?]
503 505 @@ -1,7 +4,6 @@
504 506 4
505 507 5
506 508 6
507 509 7
508 510 8
509 511 9
510 512 -10.new
511 513 record change 2/2 to 'plain'? [Ynsfdaq?]
512 514
513 515 Add to beginning, middle, end
514 516
515 517 $ rm plain
516 518 $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
517 519 > echo $i >> plain
518 520 > done
519 521
520 522 Record beginning, middle
521 523
522 524 $ hg record -d '14 0' -m middle-only plain <<EOF
523 525 > y
524 526 > y
525 527 > y
526 528 > n
527 529 > EOF
528 530 diff --git a/plain b/plain
529 531 3 hunks, 7 lines changed
530 532 examine changes to 'plain'? [Ynsfdaq?]
531 533 @@ -1,2 +1,5 @@
532 534 +1
533 535 +2
534 536 +3
535 537 4
536 538 5
537 539 record change 1/3 to 'plain'? [Ynsfdaq?]
538 540 @@ -1,6 +4,8 @@
539 541 4
540 542 5
541 543 +5.new
542 544 +5.reallynew
543 545 6
544 546 7
545 547 8
546 548 9
547 549 record change 2/3 to 'plain'? [Ynsfdaq?]
548 550 @@ -3,4 +8,6 @@
549 551 6
550 552 7
551 553 8
552 554 9
553 555 +10
554 556 +11
555 557 record change 3/3 to 'plain'? [Ynsfdaq?]
556 558
557 559 $ hg tip -p
558 560 changeset: 15:f34a7937ec33
559 561 tag: tip
560 562 user: test
561 563 date: Thu Jan 01 00:00:14 1970 +0000
562 564 summary: middle-only
563 565
564 566 diff -r 82c065d0b850 -r f34a7937ec33 plain
565 567 --- a/plain Thu Jan 01 00:00:13 1970 +0000
566 568 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
567 569 @@ -1,5 +1,10 @@
568 570 +1
569 571 +2
570 572 +3
571 573 4
572 574 5
573 575 +5.new
574 576 +5.reallynew
575 577 6
576 578 7
577 579 8
578 580
579 581
580 582 Record end
581 583
582 584 $ hg record -d '15 0' -m end-only plain <<EOF
583 585 > y
584 586 > y
585 587 > EOF
586 588 diff --git a/plain b/plain
587 589 1 hunks, 2 lines changed
588 590 examine changes to 'plain'? [Ynsfdaq?]
589 591 @@ -9,3 +9,5 @@
590 592 7
591 593 8
592 594 9
593 595 +10
594 596 +11
595 597 record this change to 'plain'? [Ynsfdaq?]
596 598
597 599 $ hg tip -p
598 600 changeset: 16:f9900b71a04c
599 601 tag: tip
600 602 user: test
601 603 date: Thu Jan 01 00:00:15 1970 +0000
602 604 summary: end-only
603 605
604 606 diff -r f34a7937ec33 -r f9900b71a04c plain
605 607 --- a/plain Thu Jan 01 00:00:14 1970 +0000
606 608 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
607 609 @@ -9,3 +9,5 @@
608 610 7
609 611 8
610 612 9
611 613 +10
612 614 +11
613 615
614 616
615 617 $ mkdir subdir
616 618 $ cd subdir
617 619 $ echo a > a
618 620 $ hg ci -d '16 0' -Amsubdir
619 621 adding subdir/a
620 622
621 623 $ echo a >> a
622 624 $ hg record -d '16 0' -m subdir-change a <<EOF
623 625 > y
624 626 > y
625 627 > EOF
626 628 diff --git a/subdir/a b/subdir/a
627 629 1 hunks, 1 lines changed
628 630 examine changes to 'subdir/a'? [Ynsfdaq?]
629 631 @@ -1,1 +1,2 @@
630 632 a
631 633 +a
632 634 record this change to 'subdir/a'? [Ynsfdaq?]
633 635
634 636 $ hg tip -p
635 637 changeset: 18:61be427a9deb
636 638 tag: tip
637 639 user: test
638 640 date: Thu Jan 01 00:00:16 1970 +0000
639 641 summary: subdir-change
640 642
641 643 diff -r a7ffae4d61cb -r 61be427a9deb subdir/a
642 644 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
643 645 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
644 646 @@ -1,1 +1,2 @@
645 647 a
646 648 +a
647 649
648 650
649 651 $ echo a > f1
650 652 $ echo b > f2
651 653 $ hg add f1 f2
652 654
653 655 $ hg ci -mz -d '17 0'
654 656
655 657 $ echo a >> f1
656 658 $ echo b >> f2
657 659
658 660 Help, quit
659 661
660 662 $ hg record <<EOF
661 663 > ?
662 664 > q
663 665 > EOF
664 666 diff --git a/subdir/f1 b/subdir/f1
665 667 1 hunks, 1 lines changed
666 668 examine changes to 'subdir/f1'? [Ynsfdaq?]
667 669 y - record this change
668 670 n - skip this change
669 671 s - skip remaining changes to this file
670 672 f - record remaining changes to this file
671 673 d - done, skip remaining changes and files
672 674 a - record all changes to all remaining files
673 675 q - quit, recording no changes
674 676 ? - display help
675 677 examine changes to 'subdir/f1'? [Ynsfdaq?]
676 678 abort: user quit
677 679 [255]
678 680
679 681 Skip
680 682
681 683 $ hg record <<EOF
682 684 > s
683 685 > EOF
684 686 diff --git a/subdir/f1 b/subdir/f1
685 687 1 hunks, 1 lines changed
686 688 examine changes to 'subdir/f1'? [Ynsfdaq?]
687 689 diff --git a/subdir/f2 b/subdir/f2
688 690 1 hunks, 1 lines changed
689 691 examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
690 692 [255]
691 693
692 694 No
693 695
694 696 $ hg record <<EOF
695 697 > n
696 698 > EOF
697 699 diff --git a/subdir/f1 b/subdir/f1
698 700 1 hunks, 1 lines changed
699 701 examine changes to 'subdir/f1'? [Ynsfdaq?]
700 702 diff --git a/subdir/f2 b/subdir/f2
701 703 1 hunks, 1 lines changed
702 704 examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
703 705 [255]
704 706
705 707 f, quit
706 708
707 709 $ hg record <<EOF
708 710 > f
709 711 > q
710 712 > EOF
711 713 diff --git a/subdir/f1 b/subdir/f1
712 714 1 hunks, 1 lines changed
713 715 examine changes to 'subdir/f1'? [Ynsfdaq?]
714 716 diff --git a/subdir/f2 b/subdir/f2
715 717 1 hunks, 1 lines changed
716 718 examine changes to 'subdir/f2'? [Ynsfdaq?]
717 719 abort: user quit
718 720 [255]
719 721
720 722 s, all
721 723
722 724 $ hg record -d '18 0' -mx <<EOF
723 725 > s
724 726 > a
725 727 > EOF
726 728 diff --git a/subdir/f1 b/subdir/f1
727 729 1 hunks, 1 lines changed
728 730 examine changes to 'subdir/f1'? [Ynsfdaq?]
729 731 diff --git a/subdir/f2 b/subdir/f2
730 732 1 hunks, 1 lines changed
731 733 examine changes to 'subdir/f2'? [Ynsfdaq?]
732 734
733 735 $ hg tip -p
734 736 changeset: 20:b3df3dda369a
735 737 tag: tip
736 738 user: test
737 739 date: Thu Jan 01 00:00:18 1970 +0000
738 740 summary: x
739 741
740 742 diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2
741 743 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
742 744 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
743 745 @@ -1,1 +1,2 @@
744 746 b
745 747 +b
746 748
747 749
748 750 f
749 751
750 752 $ hg record -d '19 0' -my <<EOF
751 753 > f
752 754 > EOF
753 755 diff --git a/subdir/f1 b/subdir/f1
754 756 1 hunks, 1 lines changed
755 757 examine changes to 'subdir/f1'? [Ynsfdaq?]
756 758
757 759 $ hg tip -p
758 760 changeset: 21:38ec577f126b
759 761 tag: tip
760 762 user: test
761 763 date: Thu Jan 01 00:00:19 1970 +0000
762 764 summary: y
763 765
764 766 diff -r b3df3dda369a -r 38ec577f126b subdir/f1
765 767 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
766 768 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
767 769 @@ -1,1 +1,2 @@
768 770 a
769 771 +a
770 772
771 773
772 774 Preserve chmod +x
773 775
774 776 $ chmod +x f1
775 777 $ echo a >> f1
776 778 $ hg record -d '20 0' -mz <<EOF
777 779 > y
778 780 > y
779 781 > y
780 782 > EOF
781 783 diff --git a/subdir/f1 b/subdir/f1
782 784 old mode 100644
783 785 new mode 100755
784 786 1 hunks, 1 lines changed
785 787 examine changes to 'subdir/f1'? [Ynsfdaq?]
786 788 @@ -1,2 +1,3 @@
787 789 a
788 790 a
789 791 +a
790 792 record this change to 'subdir/f1'? [Ynsfdaq?]
791 793
792 794 $ hg tip --config diff.git=True -p
793 795 changeset: 22:3261adceb075
794 796 tag: tip
795 797 user: test
796 798 date: Thu Jan 01 00:00:20 1970 +0000
797 799 summary: z
798 800
799 801 diff --git a/subdir/f1 b/subdir/f1
800 802 old mode 100644
801 803 new mode 100755
802 804 --- a/subdir/f1
803 805 +++ b/subdir/f1
804 806 @@ -1,2 +1,3 @@
805 807 a
806 808 a
807 809 +a
808 810
809 811
810 812 Preserve execute permission on original
811 813
812 814 $ echo b >> f1
813 815 $ hg record -d '21 0' -maa <<EOF
814 816 > y
815 817 > y
816 818 > y
817 819 > EOF
818 820 diff --git a/subdir/f1 b/subdir/f1
819 821 1 hunks, 1 lines changed
820 822 examine changes to 'subdir/f1'? [Ynsfdaq?]
821 823 @@ -1,3 +1,4 @@
822 824 a
823 825 a
824 826 a
825 827 +b
826 828 record this change to 'subdir/f1'? [Ynsfdaq?]
827 829
828 830 $ hg tip --config diff.git=True -p
829 831 changeset: 23:b429867550db
830 832 tag: tip
831 833 user: test
832 834 date: Thu Jan 01 00:00:21 1970 +0000
833 835 summary: aa
834 836
835 837 diff --git a/subdir/f1 b/subdir/f1
836 838 --- a/subdir/f1
837 839 +++ b/subdir/f1
838 840 @@ -1,3 +1,4 @@
839 841 a
840 842 a
841 843 a
842 844 +b
843 845
844 846
845 847 Preserve chmod -x
846 848
847 849 $ chmod -x f1
848 850 $ echo c >> f1
849 851 $ hg record -d '22 0' -mab <<EOF
850 852 > y
851 853 > y
852 854 > y
853 855 > EOF
854 856 diff --git a/subdir/f1 b/subdir/f1
855 857 old mode 100755
856 858 new mode 100644
857 859 1 hunks, 1 lines changed
858 860 examine changes to 'subdir/f1'? [Ynsfdaq?]
859 861 @@ -2,3 +2,4 @@
860 862 a
861 863 a
862 864 b
863 865 +c
864 866 record this change to 'subdir/f1'? [Ynsfdaq?]
865 867
866 868 $ hg tip --config diff.git=True -p
867 869 changeset: 24:0b082130c20a
868 870 tag: tip
869 871 user: test
870 872 date: Thu Jan 01 00:00:22 1970 +0000
871 873 summary: ab
872 874
873 875 diff --git a/subdir/f1 b/subdir/f1
874 876 old mode 100755
875 877 new mode 100644
876 878 --- a/subdir/f1
877 879 +++ b/subdir/f1
878 880 @@ -2,3 +2,4 @@
879 881 a
880 882 a
881 883 b
882 884 +c
883 885
884 886
885 887 $ cd ..
886 888
887 889 Abort early when a merge is in progress
888 890
889 891 $ hg up 4
890 892 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
891 893
892 894 $ touch iwillmergethat
893 895 $ hg add iwillmergethat
894 896
895 897 $ hg branch thatbranch
896 898 marked working directory as branch thatbranch
897 899
898 900 $ hg ci -m'new head'
899 901
900 902 $ hg up default
901 903 6 files updated, 0 files merged, 2 files removed, 0 files unresolved
902 904
903 905 $ hg merge thatbranch
904 906 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
905 907 (branch merge, don't forget to commit)
906 908
907 909 $ hg record -m'will abort'
908 910 abort: cannot partially commit a merge (use "hg commit" instead)
909 911 [255]
910 912
911 913 $ hg up -C
912 914 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
913 915
914 916 With win32text
915 917
916 918 $ echo '[extensions]' >> .hg/hgrc
917 919 $ echo 'win32text = ' >> .hg/hgrc
918 920 $ echo '[decode]' >> .hg/hgrc
919 921 $ echo '** = cleverdecode:' >> .hg/hgrc
920 922 $ echo '[encode]' >> .hg/hgrc
921 923 $ echo '** = cleverencode:' >> .hg/hgrc
922 924 $ echo '[patch]' >> .hg/hgrc
923 925 $ echo 'eol = crlf' >> .hg/hgrc
924 926
925 927 Ignore win32text deprecation warning for now:
926 928
927 929 $ echo '[win32text]' >> .hg/hgrc
928 930 $ echo 'warn = no' >> .hg/hgrc
929 931
930 932 $ echo d >> subdir/f1
931 933 $ hg record -d '23 0' -mw1 <<EOF
932 934 > y
933 935 > y
934 936 > EOF
935 937 diff --git a/subdir/f1 b/subdir/f1
936 938 1 hunks, 1 lines changed
937 939 examine changes to 'subdir/f1'? [Ynsfdaq?]
938 940 @@ -3,3 +3,4 @@
939 941 a
940 942 b
941 943 c
942 944 +d
943 945 record this change to 'subdir/f1'? [Ynsfdaq?]
944 946
945 947 $ hg tip -p
946 948 changeset: 26:b8306e70edc4
947 949 tag: tip
948 950 parent: 24:0b082130c20a
949 951 user: test
950 952 date: Thu Jan 01 00:00:23 1970 +0000
951 953 summary: w1
952 954
953 955 diff -r 0b082130c20a -r b8306e70edc4 subdir/f1
954 956 --- a/subdir/f1 Thu Jan 01 00:00:22 1970 +0000
955 957 +++ b/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
956 958 @@ -3,3 +3,4 @@
957 959 a
958 960 b
959 961 c
960 962 +d
961 963
@@ -1,274 +1,276 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 $ hg init repo
2 4 $ cd repo
3 5 $ echo 123 > a
4 6 $ echo 123 > c
5 7 $ echo 123 > e
6 8 $ hg add a c e
7 9 $ hg commit -m "first" a c e
8 10
9 11 nothing changed
10 12
11 13 $ hg revert
12 14 abort: no files or directories specified
13 15 (use --all to revert all files)
14 16 [255]
15 17 $ hg revert --all
16 18
17 19 $ echo 123 > b
18 20
19 21 should show b unknown
20 22
21 23 $ hg status
22 24 ? b
23 25 $ echo 12 > c
24 26
25 27 should show b unknown and c modified
26 28
27 29 $ hg status
28 30 M c
29 31 ? b
30 32 $ hg add b
31 33
32 34 should show b added and c modified
33 35
34 36 $ hg status
35 37 M c
36 38 A b
37 39 $ hg rm a
38 40
39 41 should show a removed, b added and c modified
40 42
41 43 $ hg status
42 44 M c
43 45 A b
44 46 R a
45 47 $ hg revert a
46 48
47 49 should show b added, copy saved, and c modified
48 50
49 51 $ hg status
50 52 M c
51 53 A b
52 54 $ hg revert b
53 55
54 56 should show b unknown, and c modified
55 57
56 58 $ hg status
57 59 M c
58 60 ? b
59 61 $ hg revert --no-backup c
60 62
61 63 should show unknown: b
62 64
63 65 $ hg status
64 66 ? b
65 67 $ hg add b
66 68
67 69 should show b added
68 70
69 71 $ hg status b
70 72 A b
71 73 $ rm b
72 74
73 75 should show b deleted
74 76
75 77 $ hg status b
76 78 ! b
77 79 $ hg revert -v b
78 80 forgetting b
79 81
80 82 should not find b
81 83
82 84 $ hg status b
83 85 b: No such file or directory
84 86
85 87 should show a c e
86 88
87 89 $ ls
88 90 a
89 91 c
90 92 e
91 93
92 94 should verbosely save backup to e.orig
93 95
94 96 $ echo z > e
95 97 $ hg revert --all -v
96 98 saving current version of e as e.orig
97 99 reverting e
98 100
99 101 should say no changes needed
100 102
101 103 $ hg revert a
102 104 no changes needed to a
103 105
104 106 should say file not managed
105 107
106 108 $ echo q > q
107 109 $ hg revert q
108 110 file not managed: q
109 111 $ rm q
110 112
111 113 should say file not found
112 114
113 115 $ hg revert notfound
114 116 notfound: no such file in rev 334a9e57682c
115 117 $ touch d
116 118 $ hg add d
117 119 $ hg rm a
118 120 $ hg commit -m "second"
119 121 $ echo z > z
120 122 $ hg add z
121 123 $ hg st
122 124 A z
123 125 ? e.orig
124 126
125 127 should add a, remove d, forget z
126 128
127 129 $ hg revert --all -r0
128 130 adding a
129 131 removing d
130 132 forgetting z
131 133
132 134 should forget a, undelete d
133 135
134 136 $ hg revert --all -rtip
135 137 forgetting a
136 138 undeleting d
137 139 $ rm a *.orig
138 140
139 141 should silently add a
140 142
141 143 $ hg revert -r0 a
142 144 $ hg st a
143 145 A a
144 146 $ hg rm d
145 147 $ hg st d
146 148 R d
147 149
148 150 should silently keep d removed
149 151
150 152 $ hg revert -r0 d
151 153 $ hg st d
152 154 R d
153 155
154 156 $ hg update -C
155 157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 158 $ chmod +x c
157 159 $ hg revert --all
158 160 reverting c
159 161
160 162 should print non-executable
161 163
162 164 $ test -x c || echo non-executable
163 165 non-executable
164 166
165 167 $ chmod +x c
166 168 $ hg commit -m exe
167 169
168 170 $ chmod -x c
169 171 $ hg revert --all
170 172 reverting c
171 173
172 174 should print executable
173 175
174 176 $ test -x c && echo executable
175 177 executable
176 178
177 179 $ cd ..
178 180
179 181
180 182 Issue241: update and revert produces inconsistent repositories
181 183
182 184 $ hg init a
183 185 $ cd a
184 186 $ echo a >> a
185 187 $ hg commit -A -d '1 0' -m a
186 188 adding a
187 189 $ echo a >> a
188 190 $ hg commit -d '2 0' -m a
189 191 $ hg update 0
190 192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 193 $ mkdir b
192 194 $ echo b > b/b
193 195
194 196 should fail - no arguments
195 197
196 198 $ hg revert -rtip
197 199 abort: no files or directories specified
198 200 (use --all to revert all files, or 'hg update 1' to update)
199 201 [255]
200 202
201 203 should succeed
202 204
203 205 $ hg revert --all -rtip
204 206 reverting a
205 207
206 208
207 209 Issue332: confusing message when reverting directory
208 210
209 211 $ hg ci -A -m b
210 212 adding b/b
211 213 created new head
212 214 $ echo foobar > b/b
213 215 $ mkdir newdir
214 216 $ echo foo > newdir/newfile
215 217 $ hg add newdir/newfile
216 218 $ hg revert b newdir
217 219 reverting b/b
218 220 forgetting newdir/newfile
219 221 $ echo foobar > b/b
220 222 $ hg revert .
221 223 reverting b/b
222 224
223 225
224 226 reverting a rename target should revert the source
225 227
226 228 $ hg mv a newa
227 229 $ hg revert newa
228 230 $ hg st a newa
229 231 ? newa
230 232
231 233 $ cd ..
232 234
233 235 $ hg init ignored
234 236 $ cd ignored
235 237 $ echo '^ignored$' > .hgignore
236 238 $ echo '^ignoreddir$' >> .hgignore
237 239 $ echo '^removed$' >> .hgignore
238 240
239 241 $ mkdir ignoreddir
240 242 $ touch ignoreddir/file
241 243 $ touch ignoreddir/removed
242 244 $ touch ignored
243 245 $ touch removed
244 246
245 247 4 ignored files (we will add/commit everything)
246 248
247 249 $ hg st -A -X .hgignore
248 250 I ignored
249 251 I ignoreddir/file
250 252 I ignoreddir/removed
251 253 I removed
252 254 $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
253 255
254 256 $ echo >> ignored
255 257 $ echo >> ignoreddir/file
256 258 $ hg rm removed ignoreddir/removed
257 259
258 260 should revert ignored* and undelete *removed
259 261
260 262 $ hg revert -a --no-backup
261 263 reverting ignored
262 264 reverting ignoreddir/file
263 265 undeleting ignoreddir/removed
264 266 undeleting removed
265 267 $ hg st -mardi
266 268
267 269 $ hg up -qC
268 270 $ echo >> ignored
269 271 $ hg rm removed
270 272
271 273 should silently revert the named files
272 274
273 275 $ hg revert --no-backup ignored removed
274 276 $ hg st -mardi
@@ -1,33 +1,35 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
1 3 $ rm -rf a
2 4 $ hg init a
3 5 $ cd a
4 6
5 7 $ echo foo > foo
6 8 $ hg ci -qAm0
7 9 $ chmod +x foo
8 10 $ hg ci -m1
9 11 $ hg co -q 0
10 12 $ echo dirty > foo
11 13 $ hg up -c
12 14 abort: uncommitted local changes
13 15 [255]
14 16 $ hg up -q
15 17 $ cat foo
16 18 dirty
17 19 $ hg st -A
18 20 M foo
19 21
20 22 Validate update of standalone execute bit change:
21 23
22 24 $ hg up -C 0
23 25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 26 $ chmod -x foo
25 27 $ hg ci -m removeexec
26 28 nothing changed
27 29 [1]
28 30 $ hg up -C 0
29 31 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 32 $ hg up
31 33 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 34 $ hg st
33 35
General Comments 0
You need to be logged in to leave comments. Login now