hgext/convert/common.py
changeset 4809 c2d529f288a1
parent 4806 15a3cbfc6568
child 4811 a5209b0487e0
--- a/hgext/convert/common.py
+++ b/hgext/convert/common.py
@@ -17,7 +17,11 @@ class converter_source(object):
     def __init__(self, ui, path, rev=None):
         """Initialize conversion source (or raise NoRepo("message")
         exception if path is not a valid repository)"""
-        pass
+        self.ui = ui
+        self.path = path
+        self.rev = rev
+
+        self.encoding = 'utf-8'
 
     def getheads(self):
         """Return a list of this repository's heads"""
@@ -48,7 +52,7 @@ class converter_source(object):
 
     def recode(self, s, encoding=None):
         if not encoding:
-            encoding = hasattr(self, 'encoding') and self.encoding or 'utf-8'
+            encoding = self.encoding or 'utf-8'
             
         try:
             return s.decode(encoding).encode("utf-8")