comparison push_cmd.py @ 223:330f0b15d417

issue67: mercurial 1.3 util incompatibility with encoding swap
author Luke Opperman <luke@loppear.com>
date Tue, 07 Apr 2009 13:30:05 -0500
parents 06eb60f9a026
children 4c3bad24f950
comparison
equal deleted inserted replaced
222:f2c65dd3d5c0 223:330f0b15d417
22 22
23 def push_revisions_to_subversion(ui, repo, hg_repo_path, svn_url, 23 def push_revisions_to_subversion(ui, repo, hg_repo_path, svn_url,
24 stupid=False, **opts): 24 stupid=False, **opts):
25 """push revisions starting at a specified head back to Subversion. 25 """push revisions starting at a specified head back to Subversion.
26 """ 26 """
27 oldencoding = merc_util._encoding 27 old_encoding = util.swap_out_encoding()
28 merc_util._encoding = 'UTF-8'
29 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, 28 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path,
30 ui_=ui) 29 ui_=ui)
31 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), 30 svn_commit_hashes = dict(zip(hge.revmap.itervalues(),
32 hge.revmap.iterkeys())) 31 hge.revmap.iterkeys()))
33 # Strategy: 32 # Strategy:
99 if children: 98 if children:
100 child = children[0] 99 child = children[0]
101 rebasesrc = node.bin(child.extra().get('rebase_source', node.hex(node.nullid))) 100 rebasesrc = node.bin(child.extra().get('rebase_source', node.hex(node.nullid)))
102 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, ui_=ui) 101 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, ui_=ui)
103 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), hge.revmap.iterkeys())) 102 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), hge.revmap.iterkeys()))
104 merc_util._encoding = oldencoding 103 util.swap_out_encoding(old_encoding)
105 return 0 104 return 0
106 push_revisions_to_subversion = util.register_subcommand('push')(push_revisions_to_subversion) 105 push_revisions_to_subversion = util.register_subcommand('push')(push_revisions_to_subversion)
107 # for git expats 106 # for git expats
108 push_revisions_to_subversion = util.register_subcommand('dcommit')(push_revisions_to_subversion) 107 push_revisions_to_subversion = util.register_subcommand('dcommit')(push_revisions_to_subversion)
109 108