[PATCH] Fix qpush fail on windows at drive root
Andrei Vermel
avermel at mail.ru
Tue Feb 13 12:41:23 UTC 2007
> This is a bit weird. Do you know what exactly is going on for it to
> fail with a path that uses "\\" instead of "/"? Just replacing
> backslashes would break things for people on Unix with really weird
> directory names...
I was suspecting this :(
This is what gets run and fails
os.popen2('patch -d "x:\\" -p1 <".hg\\patches\\local_changes"')
with the following written to stderr:
patch: **** Can't change to directory 'x:\ -p1' : No such file or directory
Not sure I fully understand this, but this works fine:
os.popen2('patch -d "x:/" -p1 --binary <".hg\\patches\\local_changes"')
, hence the patch.
This one works fine too:
os.popen2('patch -d "x:\\\\" -p1 --binary <".hg\\patches\\local_changes"')
So I believe an alternative patch is to check if there's '\\' symbol at the end to the
string and add an extra one.
Andrei
----- Original Message -----
From: "Alexis S. L. Carvalho" <alexis at cecm.usp.br>
To: <mercurial-devel at selenic.com>
Sent: Tuesday, February 13, 2007 2:39 PM
Subject: Re: [PATCH] Fix qpush fail on windows at drive root
> Thus spake Andrei Vermel:
>> Fix qpush fail on windows at drive root
>>
>> diff -r ed92180fe422 -r 52ce1b23fefa mercurial/patch.py
>> --- a/mercurial/patch.py Tue Feb 13 12:47:22 2007 +0300
>> +++ b/mercurial/patch.py Tue Feb 13 12:47:23 2007 +0300
>> @@ -282,7 +282,7 @@ def patch(patchname, ui, strip=1, cwd=No
>> 'patch')
>> args = []
>> if cwd:
>> - args.append('-d %s' % util.shellquote(cwd))
>> + args.append('-d %s' % util.shellquote(cwd.replace('\\', '/')))
>
> This is a bit weird. Do you know what exactly is going on for it to
> fail with a path that uses "\\" instead of "/"? Just replacing
> backslashes would break things for people on Unix with really weird
> directory names...
>
> Alexis
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
More information about the Mercurial-devel
mailing list