[PATCH] Fix qpush fail on windows at drive root

Andrei Vermel avermel at mail.ru
Tue Feb 13 09:11:27 CST 2007


Here's hopefully a safer path tweak.

# HG changeset patch
# User Andrei Vermel <avermel at mail.ru>
# Date 1171379217 -10800
# Node ID 53c6fac7bbb79c9582a527bd3017a65ef913d3ac
# Parent  bc3e502c002c38c22ce88bb0dc6735aa3d884535
Fix qpush fail on windows at drive root

diff -r bc3e502c002c -r 53c6fac7bbb7 mercurial/patch.py
--- a/mercurial/patch.py  Tue Feb 13 18:04:59 2007 +0300
+++ b/mercurial/patch.py  Tue Feb 13 18:06:57 2007 +0300
@@ -282,7 +282,10 @@ def patch(patchname, ui, strip=1, cwd=No
                                     'patch')
         args = []
         if cwd:
-            args.append('-d %s' % util.shellquote(cwd))
+            cwd_fixed=cwd
+            if cwd_fixed.endswith('\\'):
+                cwd_fixed=cwd_fixed+'\\'
+            args.append('-d %s' % util.shellquote(cwd_fixed))
         fp = os.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip,
                                            util.shellquote(patchname)))
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qpush_patch
Type: application/octet-stream
Size: 924 bytes
Desc: not available
Url : http://www.selenic.com/pipermail/mercurial-devel/attachments/20070213/929e063b/qpush_patch.obj


More information about the Mercurial-devel mailing list