Merge lp://qastaging/~gagern/bzr-cvsps-import/lp437295 into lp://qastaging/bzr-cvsps-import

Proposed by Martin von Gagern
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 64
Merged at revision: 64
Proposed branch: lp://qastaging/~gagern/bzr-cvsps-import/lp437295
Merge into: lp://qastaging/bzr-cvsps-import
Diff against target: 72 lines
1 file modified
cvsps/importer.py (+11/-6)
To merge this branch: bzr merge lp://qastaging/~gagern/bzr-cvsps-import/lp437295
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
Review via email: mp+12536@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Sorry it took so long to review this. It would be great to have some tests to prevent regressions in the future, but I think this is uncommon enough (and this MP has been waiting long enough) that we should just merge it.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cvsps/importer.py'
2--- cvsps/importer.py 2008-11-13 07:25:41 +0000
3+++ cvsps/importer.py 2009-09-28 18:00:29 +0000
4@@ -172,11 +172,11 @@
5 for line in fp:
6 line = line.rstrip()
7 cvs_filename, bzr_file_id = line.split('\0')
8- self._map[cvs_filename] = bzr_file_id
9+ self._map[cvs_filename.decode('utf-8')] = bzr_file_id
10
11 def _write_mapping(self, fp):
12 for path in sorted(self._map.keys()):
13- fp.write('%s\0%s\n' % (path, self._map[path]))
14+ fp.write('%s\0%s\n' % (path.encode('utf-8'), self._map[path]))
15
16
17 class MinimalTree(object):
18@@ -493,6 +493,8 @@
19 def __init__(self, cvs_root, cvs_module, use_cvs_for_text=True):
20 self._cvs_root = cvs_root
21 self._cvs_module = cvs_module
22+ self._cvs_modpath = osutils.pathjoin(cvs_root, cvs_module) \
23+ .encode(sys.getfilesystemencoding() or 'utf-8')
24 self._use_cvs_for_text = use_cvs_for_text # Do we use 'cvs' or 'co'?
25 if self._cvs_module == '.':
26 self._cvs_module = ''
27@@ -603,8 +605,7 @@
28 This just looks in the matching path, or in Attic if it isn't found.
29 :return: cvs_path for cvs control file.
30 """
31- rcs_file = osutils.pathjoin(self._cvs_root, self._cvs_module,
32- filename + ',v')
33+ rcs_file = osutils.pathjoin(self._cvs_modpath, filename + ',v')
34 if not os.path.isfile(rcs_file):
35 # Look in the Attic
36 cvs_dir, cvs_basename = os.path.split(rcs_file)
37@@ -692,7 +693,8 @@
38
39 def __init__(self, bzr_repo, cvs_root, cvs_module, map_file,
40 verify=True, use_cvs_for_text=True,
41- file_id_map_file=None, only_branches=None):
42+ file_id_map_file=None, only_branches=None,
43+ cvs_fs_encoding=None):
44 self._bzr_repo = bzr_repo
45 self._map_file = map_file
46 self._cvs_root = cvs_root
47@@ -703,6 +705,7 @@
48 self._only_branches_regex = re.compile(only_branches)
49 else:
50 self._only_branches_regex = None
51+ self._cvs_fs_encoding = cvs_fs_encoding
52
53 self._working_path = osutils.pathjoin(
54 self._bzr_repo.bzrdir.root_transport.local_abspath('.'),
55@@ -990,6 +993,7 @@
56
57 for member, revision in patchset.members:
58 txt, executable = self._cvs_updater.get_text(member, revision)
59+ member = member.decode(self._cvs_fs_encoding)
60 if txt is None:
61 try:
62 self._cur_tree.remove_file(member)
63@@ -1265,7 +1269,8 @@
64 map_file, verify=self._verify,
65 use_cvs_for_text=self._use_cvs_for_text,
66 file_id_map_file=file_id_map_file,
67- only_branches=self._only_branches)
68+ only_branches=self._only_branches,
69+ cvs_fs_encoding=self._encoding)
70 start_time = time.time()
71 pb = ui.ui_factory.nested_progress_bar()
72 try:

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: