Rev 4819: (jam) Fix bug #485771, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Nov 20 18:51:11 GMT 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4819 [merge]
revision-id: pqm at pqm.ubuntu.com-20091120185110-7muay17qmdqvrg7z
parent: pqm at pqm.ubuntu.com-20091120135849-rxmryotfq30r6q79
parent: john at arbash-meinel.com-20091120164228-aa9agsdfomwzqshc
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2009-11-20 18:51:10 +0000
message:
  (jam) Fix bug #485771,
  	only change slashes on arguments that are being globbed.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/test_win32utils.py test_win32utils.py-20070713181630-8xsrjymd3e8mgw23-108
  bzrlib/win32utils.py           win32console.py-20051021033308-123c6c929d04973d
=== modified file 'NEWS'
--- a/NEWS	2009-11-19 17:45:27 +0000
+++ b/NEWS	2009-11-20 16:42:28 +0000
@@ -40,6 +40,11 @@
 * Lots of bugfixes for the test suite on Windows. We should once again
   have a test suite with no failures on Windows. (John Arbash Meinel)
 
+* The new glob expansion on Windows would replace all ``\`` characters
+  with ``/`` even if it there wasn't a glob to expand, the arg was quoted,
+  etc. Now only change slashes if there is something being glob expanded.
+  (John Arbash Meinel, #485771)
+
 Improvements
 ************
 

=== modified file 'bzrlib/tests/test_win32utils.py'
--- a/bzrlib/tests/test_win32utils.py	2009-11-16 20:52:38 +0000
+++ b/bzrlib/tests/test_win32utils.py	2009-11-20 16:42:28 +0000
@@ -373,10 +373,13 @@
         self.assertCommandLine([u"'a/*.c'"], "'a/*.c'")
 
     def test_slashes_changed(self):
-        self.assertCommandLine([u'a/*.c'], '"a\\*.c"')
-        # Expands the glob, but nothing matches
+        # Quoting doesn't change the supplied args
+        self.assertCommandLine([u'a\\*.c'], '"a\\*.c"')
+        # Expands the glob, but nothing matches, swaps slashes
         self.assertCommandLine([u'a/*.c'], 'a\\*.c')
-        self.assertCommandLine([u'a/foo.c'], 'a\\foo.c')
+        self.assertCommandLine([u'a/?.c'], 'a\\?.c')
+        # No glob, doesn't touch slashes
+        self.assertCommandLine([u'a\\foo.c'], 'a\\foo.c')
 
     def test_no_single_quote_supported(self):
         self.assertCommandLine(["add", "let's-do-it.txt"],

=== modified file 'bzrlib/win32utils.py'
--- a/bzrlib/win32utils.py	2009-11-06 10:00:10 +0000
+++ b/bzrlib/win32utils.py	2009-11-20 16:42:28 +0000
@@ -631,7 +631,7 @@
     args = []
     for is_quoted, arg in s:
         if is_quoted or not glob.has_magic(arg):
-            args.append(arg.replace(u'\\', u'/'))
+            args.append(arg)
         else:
             args.extend(glob_one(arg))
     return args




More information about the bazaar-commits mailing list