comparison push_cmd.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 b3c7b844b782
children 0be16f306a42
comparison
equal deleted inserted replaced
43:af7ac6c03452 44:85fcac4e2291
12 @util.register_subcommand('push') 12 @util.register_subcommand('push')
13 @util.register_subcommand('dcommit') # for git expats 13 @util.register_subcommand('dcommit') # for git expats
14 def push_revisions_to_subversion(ui, repo, hg_repo_path, svn_url, **opts): 14 def push_revisions_to_subversion(ui, repo, hg_repo_path, svn_url, **opts):
15 """Push revisions starting at a specified head back to Subversion. 15 """Push revisions starting at a specified head back to Subversion.
16 """ 16 """
17 oldencoding = merc_util._encoding
18 merc_util._encoding = 'UTF-8'
17 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, 19 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path,
18 ui_=ui) 20 ui_=ui)
19 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), 21 svn_commit_hashes = dict(zip(hge.revmap.itervalues(),
20 hge.revmap.iterkeys())) 22 hge.revmap.iterkeys()))
21 # Strategy: 23 # Strategy:
61 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, ui_=ui) 63 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, ui_=ui)
62 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), 64 svn_commit_hashes = dict(zip(hge.revmap.itervalues(),
63 hge.revmap.iterkeys())) 65 hge.revmap.iterkeys()))
64 outgoing = utility_commands.outgoing_revisions(ui, repo, hge, 66 outgoing = utility_commands.outgoing_revisions(ui, repo, hge,
65 svn_commit_hashes) 67 svn_commit_hashes)
68 merc_util._encoding = oldencoding
66 return 0 69 return 0
67 70
68 71
69 def commit_from_rev(ui, repo, rev_ctx, hg_editor, svn_url, base_revision): 72 def commit_from_rev(ui, repo, rev_ctx, hg_editor, svn_url, base_revision):
70 """Build and send a commit from Mercurial to Subversion. 73 """Build and send a commit from Mercurial to Subversion.