# HG changeset patch # User Augie Fackler # Date 1225211976 18000 # Node ID 85fcac4e22911154521e94e225a7804bbe05ba8b # Parent af7ac6c03452523eeedc2fd9f50acb3bd3362ced Fix an encoding bug that would occur if the local encoding was not utf-8. diff --git a/fetch_command.py b/fetch_command.py --- a/fetch_command.py +++ b/fetch_command.py @@ -29,6 +29,8 @@ def fetch_revisions(ui, svn_url, hg_repo **opts): """Pull new revisions from Subversion. """ + old_encoding = merc_util._encoding + merc_util._encoding = 'UTF-8' skipto_rev=int(skipto_rev) have_replay = not stupid if have_replay and not callable(delta.svn_txdelta_apply(None, None, @@ -101,6 +103,7 @@ def fetch_revisions(ui, svn_url, hg_repo ui.status('Got a 502, retrying (%s)\n' % tries) else: raise + merc_util._encoding = old_encoding def cleanup_file_handles(svn, count): diff --git a/push_cmd.py b/push_cmd.py --- a/push_cmd.py +++ b/push_cmd.py @@ -14,6 +14,8 @@ import utility_commands def push_revisions_to_subversion(ui, repo, hg_repo_path, svn_url, **opts): """Push revisions starting at a specified head back to Subversion. """ + oldencoding = merc_util._encoding + merc_util._encoding = 'UTF-8' hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, ui_=ui) svn_commit_hashes = dict(zip(hge.revmap.itervalues(), @@ -63,6 +65,7 @@ def push_revisions_to_subversion(ui, rep hge.revmap.iterkeys())) outgoing = utility_commands.outgoing_revisions(ui, repo, hge, svn_commit_hashes) + merc_util._encoding = oldencoding return 0