See PHI294. The behavior of Git and Mercurial differs when applying patches like this:
diff --git a/X Y.txt b/X Y.txt new file mode 100644 --- /dev/null +++ b/X Y.txt @@ -0,0 +1 @@ +quack
Git creates a file named X Y.txt.
Mercurial creates a filed named X.
So this is something Mercurial could perhaps improve on. However, Git can't generate this diff itself, so this is our fault (see also T13023).
Instead, Git generates this line:
+++ b/I Love Spaces.txt\t
That is, the filename is terminated with a tab literal. This only happens sometimes. We need to:
- Figure out what the rule for adding a tab is.
- Add those tabs ourselves.
- Probably get some test coverage.
- Maybe file a bug with Mercurial; this isn't really a bug and definitely isn't very important, but maybe worth a mention. It seems reasonable to imagine that semantic trailing tabs might sometimes lead to confusing behavior.
I wasn't able to find any existing similar issues in the Mercurial bugtracker by searching for spaces, tab, or import.
Original Description
In a Mercurial repository, I got a differential revision with "Logo A.svg" and "Logo B.svg".
When we try arc patch D..., we have the following message:
Patch Failed! Exception Command failed with error #255! COMMAND HGPLAIN=1 hg import --no-commit - STDOUT applying patch from stdin STDERR file logos/2015-refresh/Logo already exists 1 out of 1 hunks FAILED -- saving rejects to file logos/2015-refresh/Logo.rej abort: patch failed to apply