Rev 1163: Fix use of unicode filenames in working tree paths. in file:///data/jelmer/bzr-svn/0.4/
Jelmer Vernooij
jelmer at samba.org
Wed May 14 20:03:34 BST 2008
At file:///data/jelmer/bzr-svn/0.4/
------------------------------------------------------------
revno: 1163
revision-id: jelmer at samba.org-20080514190314-ietgh14fzdlymilq
parent: jelmer at samba.org-20080514185825-6euz7qzz36twwofj
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Wed 2008-05-14 21:03:14 +0200
message:
Fix use of unicode filenames in working tree paths.
modified:
tree.py tree.py-20060624222557-dudlwqcmkf22lt2s-1
workingtree.py workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file 'tree.py'
--- a/tree.py 2008-05-02 20:24:01 +0000
+++ b/tree.py 2008-05-14 19:03:14 +0000
@@ -277,7 +277,7 @@
self._repository = workingtree.branch.repository
def add_file_to_inv(relpath, id, revid, wc):
- props = svn.wc.get_prop_diffs(self.workingtree.abspath(relpath), wc)
+ props = svn.wc.get_prop_diffs(self.workingtree.abspath(relpath).encode("utf-8"), wc)
if isinstance(props, list): # Subversion 1.5
props = props[1]
if props.has_key(svn.core.SVN_PROP_SPECIAL):
@@ -301,7 +301,7 @@
if entry.schedule in (svn.wc.schedule_normal,
svn.wc.schedule_delete,
svn.wc.schedule_replace):
- return self.id_map[workingtree.branch.unprefix(relpath)]
+ return self.id_map[workingtree.branch.unprefix(relpath.decode("utf-8"))]
return (None, None)
def add_dir_to_inv(relpath, wc, parent_id):
@@ -314,16 +314,19 @@
# First handle directory itself
ie = self._inventory.add_path(relpath, 'directory', id)
ie.revision = revid
- if relpath == "":
+ if relpath == u"":
self._inventory.revision_id = revid
- for name in entries:
- if name == "":
+ for name, entry in entries.items():
+ name = name.decode("utf-8")
+ if name == u"":
continue
+ assert isinstance(relpath, unicode)
+ assert isinstance(name, unicode)
+
subrelpath = os.path.join(relpath, name)
- entry = entries[name]
assert entry
if entry.kind == svn.core.svn_node_dir:
@@ -341,12 +344,12 @@
wc = workingtree._get_wc()
try:
- add_dir_to_inv("", wc, None)
+ add_dir_to_inv(u"", wc, None)
finally:
svn.wc.adm_close(wc)
def _abspath(self, relpath):
- return svn.wc.get_pristine_copy_path(self.workingtree.abspath(relpath))
+ return svn.wc.get_pristine_copy_path(self.workingtree.abspath(relpath).encode("utf-8"))
def get_file_lines(self, file_id):
base_copy = self._abspath(self.id2path(file_id))
=== modified file 'workingtree.py'
--- a/workingtree.py 2008-05-11 14:51:04 +0000
+++ b/workingtree.py 2008-05-14 19:03:14 +0000
@@ -75,6 +75,7 @@
def __init__(self, bzrdir, local_path, branch):
self._format = SvnWorkingTreeFormat()
self.basedir = local_path
+ assert isinstance(self.basedir, unicode)
self.bzrdir = bzrdir
self._branch = branch
self.base_revnum = 0
More information about the bazaar-commits
mailing list