changeset 281:8ff0b3261b7f

util: drop 1.2 support in the encoding swap.
author Augie Fackler <durin42@gmail.com>
date Fri, 24 Apr 2009 21:07:59 -0500
parents 4a327bfc69c6
children 77892f67b1cd
files util.py
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/util.py
+++ b/util.py
@@ -114,12 +114,9 @@ def describe_commit(ui, h, b):
 
 
 def swap_out_encoding(new_encoding="UTF-8"):
-    """ Utility for mercurial incompatibility changes, can be removed after 1.3"""
-    try:
-        from mercurial import encoding
-        old = encoding.encoding
-        encoding.encoding = new_encoding
-    except ImportError:
-        old = hgutil._encoding
-        hgutil._encoding = new_encoding
+    """ Utility for mercurial incompatibility changes, can be removed after 1.3
+    """
+    from mercurial import encoding
+    old = encoding.encoding
+    encoding.encoding = new_encoding
     return old