equal
deleted
inserted
replaced
41 raise NotImplementedError() |
41 raise NotImplementedError() |
42 |
42 |
43 def gettags(self): |
43 def gettags(self): |
44 """Return the tags as a dictionary of name: revision""" |
44 """Return the tags as a dictionary of name: revision""" |
45 raise NotImplementedError() |
45 raise NotImplementedError() |
|
46 |
|
47 def recode(self, s, encoding=None): |
|
48 if not encoding: |
|
49 encoding = hasattr(self, 'encoding') and self.encoding or 'utf-8' |
|
50 |
|
51 try: |
|
52 return s.decode(encoding).encode("utf-8") |
|
53 except: |
|
54 try: |
|
55 return s.decode("latin-1").encode("utf-8") |
|
56 except: |
|
57 return s.decode(encoding, "replace").encode("utf-8") |
46 |
58 |
47 class converter_sink(object): |
59 class converter_sink(object): |
48 """Conversion sink (target) interface""" |
60 """Conversion sink (target) interface""" |
49 |
61 |
50 def __init__(self, ui, path): |
62 def __init__(self, ui, path): |