summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers/git-remote-bzr
diff options
context:
space:
mode:
authorLibravatar Christophe Simonis <christophe@kn.gl>2013-04-08 13:36:38 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-04-08 14:09:31 -0700
commit5ff4fc649e18c02bc475ec5785a985ac5f6e0688 (patch)
treeb31c05a4e526c570790e816d1a77d826f00c372d /contrib/remote-helpers/git-remote-bzr
parentRevert 4b7f53da7618 (simplify-merges: drop merge from irrelevant side branch,... (diff)
downloadtgif-5ff4fc649e18c02bc475ec5785a985ac5f6e0688.tar.xz
remote-bzr: fix utf-8 support for fetching
The previous patches didn't deal with all the scenarios. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers/git-remote-bzr')
-rwxr-xr-xcontrib/remote-helpers/git-remote-bzr19
1 files changed, 11 insertions, 8 deletions
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index fad4a48cdc..55ebf195be 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -183,21 +183,24 @@ def get_filechanges(cur, prev):
changes = cur.changes_from(prev)
+ def u(s):
+ return s.encode('utf-8')
+
for path, fid, kind in changes.added:
- modified[path] = fid
+ modified[u(path)] = fid
for path, fid, kind in changes.removed:
- removed[path] = None
+ removed[u(path)] = None
for path, fid, kind, mod, _ in changes.modified:
- modified[path] = fid
+ modified[u(path)] = fid
for oldpath, newpath, fid, kind, mod, _ in changes.renamed:
- removed[oldpath] = None
+ removed[u(oldpath)] = None
if kind == 'directory':
lst = cur.list_files(from_dir=newpath, recursive=True)
for path, file_class, kind, fid, entry in lst:
if kind != 'directory':
- modified[newpath + '/' + path] = fid
+ modified[u(newpath + '/' + path)] = fid
else:
- modified[newpath] = fid
+ modified[u(newpath)] = fid
return modified, removed
@@ -223,7 +226,7 @@ def export_files(tree, files):
# is the blog already exported?
if h in filenodes:
mark = filenodes[h]
- final.append((mode, mark, path.encode('utf-8')))
+ final.append((mode, mark, path))
continue
d = tree.get_file_text(fid)
@@ -240,7 +243,7 @@ def export_files(tree, files):
print "data %d" % len(d)
print d
- final.append((mode, mark, path.encode('utf-8')))
+ final.append((mode, mark, path))
return final