Rev 425: Handle unicode characters in filenames (#54736). in file:///home/jelmer/bzr-svn/0.3/

Jelmer Vernooij jelmer at samba.org
Mon Mar 19 16:14:37 GMT 2007


At file:///home/jelmer/bzr-svn/0.3/

------------------------------------------------------------
revno: 425
revision-id: jelmer at samba.org-20070312231130-3q3rr8sgwwf0ikzg
parent: jelmer at samba.org-20070312225122-7uh34ah30dqupuov
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.3
timestamp: Tue 2007-03-13 00:11:30 +0100
message:
  Handle unicode characters in filenames (#54736).
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
  tree.py                        tree.py-20060624222557-dudlwqcmkf22lt2s-1
=== modified file 'NEWS'
--- a/NEWS	2007-03-11 23:18:57 +0000
+++ b/NEWS	2007-03-12 23:11:30 +0000
@@ -9,6 +9,8 @@
 
   * Handle unicode characters in commit messages. Fixes #85551.
 
+  * Handle unicode characters in filenames (#54736)
+
 bzr-svn 0.3.1	2007-01-31
 
   BUG FIXES

=== modified file 'fetch.py'
--- a/fetch.py	2007-03-12 22:51:22 +0000
+++ b/fetch.py	2007-03-12 23:11:30 +0000
@@ -103,6 +103,7 @@
         return generate_file_id(self.revid, new_path)
 
     def delete_entry(self, path, revnum, parent_id, pool):
+        path = path.decode("utf-8")
         del self.inventory[self._get_old_id(parent_id, path)]
 
     def close_directory(self, id):
@@ -194,6 +195,7 @@
             mutter('unsupported file property %r' % name)
 
     def add_file(self, path, parent_id, copyfrom_path, copyfrom_revnum, baton):
+        path = path.decode("utf-8")
         self.is_symlink = False
         self.is_executable = None
         self.file_data = ""

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2007-03-12 22:51:22 +0000
+++ b/tests/test_repos.py	2007-03-12 23:11:30 +0000
@@ -791,6 +791,40 @@
 
 PROPS-END
 
+Node-path: u\xc3\xa1
+Node-path: bla
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 5
+Text-content-md5: 49803c8f7913948eb3e30bae749ae6bd
+Content-length: 15
+
+PROPS-END
+bloe
+
+
+Revision-number: 2
+Prop-content-length: 105
+Content-length: 105
+
+K 7
+svn:log
+V 5
+readd
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-26T00:05:43.584249Z
+PROPS-END
+
+Node-path: x\xc3\xa1
+Node-action: delete
+
 """)
         os.mkdir("old")
 

=== modified file 'tree.py'
--- a/tree.py	2007-01-10 01:50:47 +0000
+++ b/tree.py	2007-03-12 23:11:30 +0000
@@ -90,6 +90,7 @@
         return ROOT_ID
 
     def add_directory(self, path, parent_baton, copyfrom_path, copyfrom_revnum, pool):
+        path = path.decode("utf-8")
         file_id, revision_id = self.tree.id_map[path]
         ie = self.tree._inventory.add_path(path, 'directory', file_id)
         ie.revision = revision_id
@@ -143,6 +144,7 @@
             mutter('unsupported file property %r' % name)
 
     def add_file(self, path, parent_id, copyfrom_path, copyfrom_revnum, baton):
+        path = path.decode("utf-8")
         self.is_symlink = False
         self.is_executable = False
         return path




More information about the bazaar-commits mailing list