Show More
@@ -933,8 +933,10 b' def selectfile(afile_orig, bfile_orig, h' | |||
|
933 | 933 | missing = not goodb and not gooda and not createfunc() |
|
934 | 934 | |
|
935 | 935 | # some diff programs apparently produce create patches where the |
|
936 |
# afile is not /dev/null, but |
|
|
937 | if missing and afile == bfile: | |
|
936 | # afile is not /dev/null, but afile starts with bfile | |
|
937 | abasedir = afile[:afile.rfind('/') + 1] | |
|
938 | bbasedir = bfile[:bfile.rfind('/') + 1] | |
|
939 | if missing and abasedir == bbasedir and afile.startswith(bfile): | |
|
938 | 940 | # this isn't very pretty |
|
939 | 941 | hunk.create = True |
|
940 | 942 | if createfunc(): |
@@ -351,10 +351,22 b' diff -Naur proj-orig/foo proj-new/foo' | |||
|
351 | 351 | @@ -0,0 +1,1 @@ |
|
352 | 352 | +a |
|
353 | 353 | EOF |
|
354 | # some people have patches like the following too | |
|
355 | cat > create2.patch <<EOF | |
|
356 | diff -Naur proj-orig/foo proj-new/foo | |
|
357 | --- proj-orig/foo.orig 1969-12-31 16:00:00.000000000 -0800 | |
|
358 | +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700 | |
|
359 | @@ -0,0 +1,1 @@ | |
|
360 | +a | |
|
361 | EOF | |
|
354 | 362 | hg init oddcreate |
|
355 | 363 | cd oddcreate |
|
356 | 364 | hg import --no-commit ../create.patch |
|
357 | 365 | cat foo |
|
366 | rm foo | |
|
367 | hg revert foo | |
|
368 | hg import --no-commit ../create2.patch | |
|
369 | cat foo | |
|
358 | 370 | |
|
359 | 371 | echo % 'first line mistaken for email headers (issue 1859)' |
|
360 | 372 | hg init emailconfusion |
General Comments 0
You need to be logged in to leave comments.
Login now