comparison tests/test-import-git.t @ 16910:ad229181ddbe

tests: remove 'hghave symlink' from test-import-git.t The test had a long chain of commits depending on execbits in some of first commits. The hashes are checked throughout the file, so there was no elegant way to make it pass both with and without execbits. We now rollback the execbits-or-not commits and make a stable change instead. The hash chain is thus updated once but is now a bit more stable. The test coverage should be unaltered.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 10 Jun 2012 18:59:51 +0200
parents bb91c602d4ad
children 4f8054d3171b
comparison
equal deleted inserted replaced
16909:b6fd2f8909ff 16910:ad229181ddbe
1 $ "$TESTDIR/hghave" symlink || exit 80 1 $ hg init repo
2 2 $ cd repo
3 $ hg init
4 3
5 New file: 4 New file:
6 5
7 $ hg import -d "1000000 0" -mnew - <<EOF 6 $ hg import -d "1000000 0" -mnew - <<EOF
8 > diff --git a/new b/new 7 > diff --git a/new b/new
39 > old mode 100644 38 > old mode 100644
40 > new mode 100755 39 > new mode 100755
41 > EOF 40 > EOF
42 applying patch from stdin 41 applying patch from stdin
43 42
43 #if execbit
44 $ hg tip -q 44 $ hg tip -q
45 2:3a34410f282e 45 2:3a34410f282e
46
47 $ test -x new 46 $ test -x new
48 47 $ hg rollback -q
49 Copy: 48 #else
50 49 $ hg tip -q
51 $ hg import -d "1000000 0" -mcopy - <<EOF 50 1:ab199dc869b5
51 #endif
52
53 Copy and removing x bit:
54
55 $ hg import -f -d "1000000 0" -mcopy - <<EOF
52 > diff --git a/new b/copy 56 > diff --git a/new b/copy
53 > old mode 100755 57 > old mode 100755
54 > new mode 100644 58 > new mode 100644
55 > similarity index 100% 59 > similarity index 100%
56 > copy from new 60 > copy from new
60 > copy from new 64 > copy from new
61 > copy to copyx 65 > copy to copyx
62 > EOF 66 > EOF
63 applying patch from stdin 67 applying patch from stdin
64 68
65 $ hg tip -q 69 $ test -f copy
66 3:37bacb7ca14d
67
68 #if execbit 70 #if execbit
69 $ test -f copy
70 $ test ! -x copy 71 $ test ! -x copy
71 $ test -x copyx 72 $ test -x copyx
73 $ hg tip -q
74 2:21dfaae65c71
72 #else 75 #else
76 $ hg tip -q
77 2:0efdaa8e3bf3
78 #endif
79
80 $ hg up -qCr1
81 $ hg rollback -q
82
83 Copy (like above but independent of execbit):
84
85 $ hg import -d "1000000 0" -mcopy - <<EOF
86 > diff --git a/new b/copy
87 > similarity index 100%
88 > copy from new
89 > copy to copy
90 > diff --git a/new b/copyx
91 > similarity index 100%
92 > copy from new
93 > copy to copyx
94 > EOF
95 applying patch from stdin
96
97 $ hg tip -q
98 2:0efdaa8e3bf3
73 $ test -f copy 99 $ test -f copy
74 #endif
75 100
76 $ cat copy 101 $ cat copy
77 a 102 a
78 103
79 $ hg cat copy 104 $ hg cat copy
88 > rename to rename 113 > rename to rename
89 > EOF 114 > EOF
90 applying patch from stdin 115 applying patch from stdin
91 116
92 $ hg tip -q 117 $ hg tip -q
93 4:47b81a94361d 118 3:b1f57753fad2
94 119
95 $ hg locate 120 $ hg locate
96 copyx 121 copyx
97 empty 122 empty
98 new 123 new
110 > -a 135 > -a
111 > EOF 136 > EOF
112 applying patch from stdin 137 applying patch from stdin
113 138
114 $ hg tip -q 139 $ hg tip -q
115 5:d9b001d98336 140 4:1bd1da94b9b2
116 141
117 $ hg locate 142 $ hg locate
118 empty 143 empty
119 new 144 new
120 rename 145 rename
137 > +a 162 > +a
138 > EOF 163 > EOF
139 applying patch from stdin 164 applying patch from stdin
140 165
141 $ hg tip -q 166 $ hg tip -q
142 6:ebe901e7576b 167 5:46fe99cb3035
143 168
144 Copy and modify: 169 Copy and modify:
145 170
146 $ hg import -d "1000000 0" -mcopymod - <<EOF 171 $ hg import -d "1000000 0" -mcopymod - <<EOF
147 > diff --git a/rename b/copy2 172 > diff --git a/rename b/copy2
160 > a 185 > a
161 > EOF 186 > EOF
162 applying patch from stdin 187 applying patch from stdin
163 188
164 $ hg tip -q 189 $ hg tip -q
165 7:18f368958ecd 190 6:ffeb3197c12d
166 191
167 $ hg cat copy2 192 $ hg cat copy2
168 a 193 a
169 a 194 a
170 b 195 b
190 > a 215 > a
191 > EOF 216 > EOF
192 applying patch from stdin 217 applying patch from stdin
193 218
194 $ hg tip -q 219 $ hg tip -q
195 8:c32b0d7e6f44 220 7:401aede9e6bb
196 221
197 $ hg locate copy2 222 $ hg locate copy2
198 [1] 223 [1]
199 $ hg cat rename2 224 $ hg cat rename2
200 a 225 a
214 > rename to rename3-2 239 > rename to rename3-2
215 > EOF 240 > EOF
216 applying patch from stdin 241 applying patch from stdin
217 242
218 $ hg tip -q 243 $ hg tip -q
219 9:034a6bf95330 244 8:2ef727e684e8
220 245
221 $ hg log -vr. --template '{rev} {files} / {file_copies}\n' 246 $ hg log -vr. --template '{rev} {files} / {file_copies}\n'
222 9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2) 247 8 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
223 248
224 $ hg locate rename2 rename3 rename3-2 249 $ hg locate rename2 rename3 rename3-2
225 rename3 250 rename3
226 rename3-2 251 rename3-2
227 252
258 > rename to foo2 283 > rename to foo2
259 > EOF 284 > EOF
260 applying patch from stdin 285 applying patch from stdin
261 286
262 $ hg tip -q 287 $ hg tip -q
263 11:c39bce63e786 288 10:27377172366e
264 289
265 $ cat foo2 290 $ cat foo2
266 foo 291 foo
267 292
268 $ hg manifest --debug | grep binary 293 $ hg manifest --debug | grep binary
287 > 312 >
288 > EOF 313 > EOF
289 applying patch from stdin 314 applying patch from stdin
290 315
291 $ hg tip -q 316 $ hg tip -q
292 12:30b530085242 317 11:18b73a84b4ab
293 318
294 $ hg manifest --debug | grep mbinary 319 $ hg manifest --debug | grep mbinary
295 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1 320 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1
296 a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2 321 a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2
297 322
307 > +foo 332 > +foo
308 > EOF 333 > EOF
309 applying patch from stdin 334 applying patch from stdin
310 335
311 $ hg tip -q 336 $ hg tip -q
312 13:04750ef42fb3 337 12:47500ce1614e
313 338
314 $ cat "foo bar" 339 $ cat "foo bar"
315 foo 340 foo
316 341
317 Copy then modify the original file: 342 Copy then modify the original file:
330 > copy to foo3 355 > copy to foo3
331 > EOF 356 > EOF
332 applying patch from stdin 357 applying patch from stdin
333 358
334 $ hg tip -q 359 $ hg tip -q
335 14:c4cd9cdeaa74 360 13:6757efb07ea9
336 361
337 $ cat foo3 362 $ cat foo3
338 foo 363 foo
339 364
340 Move text file and patch as binary 365 Move text file and patch as binary
365 R text2 390 R text2
366 391
367 Invalid base85 content 392 Invalid base85 content
368 393
369 $ hg rollback 394 $ hg rollback
370 repository tip rolled back to revision 15 (undo import) 395 repository tip rolled back to revision 14 (undo import)
371 working directory now based on revision 15 396 working directory now based on revision 14
372 $ hg revert -aq 397 $ hg revert -aq
373 $ hg import -d "1000000 0" -m invalid-binary - <<"EOF" 398 $ hg import -d "1000000 0" -m invalid-binary - <<"EOF"
374 > diff --git a/text2 b/binary2 399 > diff --git a/text2 b/binary2
375 > rename from text2 400 > rename from text2
376 > rename to binary2 401 > rename to binary2
531 abort: patch failed to apply 556 abort: patch failed to apply
532 [255] 557 [255]
533 $ cat b 558 $ cat b
534 b 559 b
535 560
561 #if symlink
562
536 $ ln -s b linkb 563 $ ln -s b linkb
537 $ hg add linkb 564 $ hg add linkb
538 $ hg ci -m addlinkb 565 $ hg ci -m addlinkb
539 $ hg import --no-commit - <<EOF 566 $ hg import --no-commit - <<EOF
540 > diff --git a/linkb b/linkb 567 > diff --git a/linkb b/linkb
553 [255] 580 [255]
554 $ hg st 581 $ hg st
555 ? b.rej 582 ? b.rej
556 ? linkb.rej 583 ? linkb.rej
557 584
585 #endif
586
558 Test corner case involving copies and multiple hunks (issue3384) 587 Test corner case involving copies and multiple hunks (issue3384)
559 588
560 $ hg revert -qa 589 $ hg revert -qa
561 $ hg import --no-commit - <<EOF 590 $ hg import --no-commit - <<EOF
562 > diff --git a/a b/c 591 > diff --git a/a b/c