Merge lp:~songofacandy/bzr-fastimport/fix-unicode-error into lp:bzr-fastimport

Proposed by methane
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 302
Merged at revision: 302
Proposed branch: lp:~songofacandy/bzr-fastimport/fix-unicode-error
Merge into: lp:bzr-fastimport
Diff against target: 47 lines (+8/-8)
1 file modified
bzr_commit_handler.py (+8/-8)
To merge this branch: bzr merge lp:~songofacandy/bzr-fastimport/fix-unicode-error
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
Review via email: mp+47183@code.launchpad.net

Description of the change

Fix the UnicodeDecodeError when importing .fi file contains non-ASCII paths.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzr_commit_handler.py'
2--- bzr_commit_handler.py 2010-12-12 03:53:15 +0000
3+++ bzr_commit_handler.py 2011-01-23 09:41:23 +0000
4@@ -603,22 +603,22 @@
5 data = filecmd.data
6 self.debug("modifying %s", filecmd.path)
7 (kind, is_executable) = mode_to_kind(filecmd.mode)
8- self._modify_item(filecmd.path, kind,
9+ self._modify_item(filecmd.path.decode('utf8'), kind,
10 is_executable, data, self.inventory)
11
12 def delete_handler(self, filecmd):
13 self.debug("deleting %s", filecmd.path)
14- self._delete_item(filecmd.path, self.inventory)
15+ self._delete_item(filecmd.path.decode('utf8'), self.inventory)
16
17 def copy_handler(self, filecmd):
18- src_path = filecmd.src_path
19- dest_path = filecmd.dest_path
20+ src_path = filecmd.src_path.decode('utf8')
21+ dest_path = filecmd.dest_path.decode('utf8')
22 self.debug("copying %s to %s", src_path, dest_path)
23 self._copy_item(src_path, dest_path, self.inventory)
24
25 def rename_handler(self, filecmd):
26- old_path = filecmd.old_path
27- new_path = filecmd.new_path
28+ old_path = filecmd.old_path.decode('utf8')
29+ new_path = filecmd.new_path.decode('utf8')
30 self.debug("renaming %s to %s", old_path, new_path)
31 self._rename_item(old_path, new_path, self.inventory)
32
33@@ -884,12 +884,12 @@
34 else:
35 data = filecmd.data
36 self.debug("modifying %s", filecmd.path)
37- self._modify_item(filecmd.path, kind,
38+ self._modify_item(filecmd.path.decode('utf8'), kind,
39 executable, data, self.basis_inventory)
40
41 def delete_handler(self, filecmd):
42 self.debug("deleting %s", filecmd.path)
43- self._delete_item(filecmd.path, self.basis_inventory)
44+ self._delete_item(filecmd.path.decode('utf8'), self.basis_inventory)
45
46 def copy_handler(self, filecmd):
47 src_path = filecmd.src_path.decode("utf8")

Subscribers

People subscribed via source and target branches