diff 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
line wrap: on
line diff
--- a/push_cmd.py
+++ b/push_cmd.py
@@ -24,8 +24,7 @@ def push_revisions_to_subversion(ui, rep
                                  stupid=False, **opts):
     """push revisions starting at a specified head back to Subversion.
     """
-    oldencoding = merc_util._encoding
-    merc_util._encoding = 'UTF-8'
+    old_encoding = util.swap_out_encoding()
     hge = hg_delta_editor.HgChangeReceiver(hg_repo_path,
                                            ui_=ui)
     svn_commit_hashes = dict(zip(hge.revmap.itervalues(),
@@ -101,7 +100,7 @@ def push_revisions_to_subversion(ui, rep
                         rebasesrc = node.bin(child.extra().get('rebase_source', node.hex(node.nullid)))
         hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, ui_=ui)
         svn_commit_hashes = dict(zip(hge.revmap.itervalues(), hge.revmap.iterkeys()))
-    merc_util._encoding = oldencoding
+    util.swap_out_encoding(old_encoding)
     return 0
 push_revisions_to_subversion = util.register_subcommand('push')(push_revisions_to_subversion)
 # for git expats