Rev 1135: Fix encoding issue. in http://people.samba.org/bzr/jelmer/bzr-svn/cext

Jelmer Vernooij jelmer at samba.org
Mon Aug 25 06:09:46 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/cext

------------------------------------------------------------
revno: 1135
revision-id: jelmer at samba.org-20080825050944-h5sm27n92i6qiijy
parent: jelmer at samba.org-20080825050007-yo3x8m3cdym2pmia
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: cext
timestamp: Mon 2008-08-25 07:09:44 +0200
message:
  Fix encoding issue.
modified:
  mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
  workingtree.py                 workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file 'mapping.py'
--- a/mapping.py	2008-08-25 01:58:11 +0000
+++ b/mapping.py	2008-08-25 05:09:44 +0000
@@ -455,7 +455,7 @@
     ret = {}
     for line in text.splitlines():
         (path, key) = line.split("\t", 1)
-        ret[urllib.unquote(path)] = osutils.safe_file_id(key)
+        ret[urllib.unquote(path).decode("utf-8")] = osutils.safe_file_id(key)
     return ret
 
 

=== modified file 'workingtree.py'
--- a/workingtree.py	2008-08-25 05:00:07 +0000
+++ b/workingtree.py	2008-08-25 05:09:44 +0000
@@ -356,12 +356,14 @@
                 if entry.kind == core.NODE_DIR:
                     subwc = WorkingCopy(wc, self.abspath(subrelpath))
                     try:
+                        assert isinstance(subrelpath, unicode)
                         add_dir_to_inv(subrelpath, subwc, id)
                     finally:
                         subwc.close()
                 else:
                     (subid, subrevid) = find_ids(entry, rootwc)
                     if subid:
+                        assert isinstance(subrelpath, unicode)
                         add_file_to_inv(subrelpath, subid, subrevid, id)
                     else:
                         mutter('no id for %r', entry.url)
@@ -412,7 +414,7 @@
                               svn_revprops[properties.PROP_REVISION_DATE], 
                               svn_revprops[properties.PROP_REVISION_AUTHOR])
 
-                child_path = os.path.join(path, name)
+                child_path = os.path.join(path, name.decode("utf-8"))
 
                 if newrevtree.inventory[newrevtree.inventory.path2id(child_path)].kind == 'directory':
                     subwc = WorkingCopy(wc, self.abspath(child_path).rstrip("/"), write_lock=True)




More information about the bazaar-commits mailing list