Mercurial > hg
comparison tests/test-import @ 9328:648d6a1a1cf2
patch: create file even if source is not /dev/null
as long as the first hunk is -0,0 and the source and destination have the
same name. Matt found a patch like this, and /usr/bin/patch accepts it.
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Fri, 07 Aug 2009 19:27:54 -0700 |
parents | 5b7da468531b |
children | c156bf947e26 012f1244cd4c |
comparison
equal
deleted
inserted
replaced
9327:9a69ab6d7cf7 | 9328:648d6a1a1cf2 |
---|---|
330 diff --git a/b b/b | 330 diff --git a/b b/b |
331 new file mode 100644 | 331 new file mode 100644 |
332 EOF | 332 EOF |
333 hg import --no-commit a.patch | 333 hg import --no-commit a.patch |
334 cd .. | 334 cd .. |
335 | |
336 echo '% create file when source is not /dev/null' | |
337 cat > create.patch <<EOF | |
338 diff -Naur proj-orig/foo proj-new/foo | |
339 --- proj-orig/foo 1969-12-31 16:00:00.000000000 -0800 | |
340 +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700 | |
341 @@ -0,0 +1,1 @@ | |
342 +a | |
343 EOF | |
344 hg init oddcreate | |
345 cd oddcreate | |
346 hg import --no-commit ../create.patch | |
347 cat foo |