Rev 4577: (jam) Handle bug #382709 by encoding paths as 'mbcs' when spawning in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Jul 29 23:59:24 BST 2009


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

------------------------------------------------------------
revno: 4577 [merge]
revision-id: pqm at pqm.ubuntu.com-20090729225922-ct2n8v4ebyr46xwq
parent: pqm at pqm.ubuntu.com-20090729051909-5t1y5hnh1pb7lalk
parent: john at arbash-meinel.com-20090729213813-30uflf10ba23rced
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-07-29 23:59:22 +0100
message:
  (jam) Handle bug #382709 by encoding paths as 'mbcs' when spawning
  	external diff.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/diff.py                 diff.py-20050309040759-26944fbbf2ebbf36
=== modified file 'NEWS'
--- a/NEWS	2009-07-28 08:14:15 +0000
+++ b/NEWS	2009-07-29 21:38:13 +0000
@@ -60,6 +60,12 @@
   to reading and then rewriting the whole file, such as TahoeLAFS.  (This
   fallback may be slow for some access patterns.)  (Nils Durner, #294709)
 
+* Encode the paths in ``mbcs`` encoding on Windows when spawning an
+  external diff client. This at least allows supporting filenames that are
+  not ascii, but are present in the current locale. Ideally we would be
+  able to pass the Unicode path, but that would be client dependent.
+  (John Arbash Meinel, #382709)
+
 * Fixed a NameError that occurs when merging or pulling from a URL that
   causes a redirection loop when bzr tries to read a URL as a bundle.
   (Andrew Bennetts, #400847)

=== modified file 'bzrlib/diff.py'
--- a/bzrlib/diff.py	2009-06-10 03:56:49 +0000
+++ b/bzrlib/diff.py	2009-07-29 21:35:05 +0000
@@ -171,6 +171,11 @@
 
         if not diff_opts:
             diff_opts = []
+        if sys.platform == 'win32':
+            # Popen doesn't do the proper encoding for external commands
+            # Since we are dealing with an ANSI api, use mbcs encoding
+            old_filename = old_filename.encode('mbcs')
+            new_filename = new_filename.encode('mbcs')
         diffcmd = ['diff',
                    '--label', old_filename,
                    old_abspath,




More information about the bazaar-commits mailing list