Mercurial > hgsubversion
comparison fetch_command.py @ 44:85fcac4e2291
Fix an encoding bug that would occur if the local encoding was not utf-8.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Tue, 28 Oct 2008 11:39:36 -0500 |
parents | 485ae93bc358 |
children | a8b9c7e7c2ac |
comparison
equal
deleted
inserted
replaced
43:af7ac6c03452 | 44:85fcac4e2291 |
---|---|
27 def fetch_revisions(ui, svn_url, hg_repo_path, skipto_rev=0, stupid=None, | 27 def fetch_revisions(ui, svn_url, hg_repo_path, skipto_rev=0, stupid=None, |
28 tag_locations='tags', | 28 tag_locations='tags', |
29 **opts): | 29 **opts): |
30 """Pull new revisions from Subversion. | 30 """Pull new revisions from Subversion. |
31 """ | 31 """ |
32 old_encoding = merc_util._encoding | |
33 merc_util._encoding = 'UTF-8' | |
32 skipto_rev=int(skipto_rev) | 34 skipto_rev=int(skipto_rev) |
33 have_replay = not stupid | 35 have_replay = not stupid |
34 if have_replay and not callable(delta.svn_txdelta_apply(None, None, | 36 if have_replay and not callable(delta.svn_txdelta_apply(None, None, |
35 None)[0]): | 37 None)[0]): |
36 ui.status('You are using old Subversion SWIG bindings. Replay will not' | 38 ui.status('You are using old Subversion SWIG bindings. Replay will not' |
99 ' in response to PROPFIND') in e.message: | 101 ' in response to PROPFIND') in e.message: |
100 tries += 1 | 102 tries += 1 |
101 ui.status('Got a 502, retrying (%s)\n' % tries) | 103 ui.status('Got a 502, retrying (%s)\n' % tries) |
102 else: | 104 else: |
103 raise | 105 raise |
106 merc_util._encoding = old_encoding | |
104 | 107 |
105 | 108 |
106 def cleanup_file_handles(svn, count): | 109 def cleanup_file_handles(svn, count): |
107 if count % 50 == 0: | 110 if count % 50 == 0: |
108 svn.init_ra_and_client() | 111 svn.init_ra_and_client() |