Mercurial > hgsubversion
comparison util.py @ 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 | 68aea59116b6 |
| children | f8f9a2993705 |
comparison
equal
deleted
inserted
replaced
| 280:4a327bfc69c6 | 281:8ff0b3261b7f |
|---|---|
| 112 def describe_commit(ui, h, b): | 112 def describe_commit(ui, h, b): |
| 113 ui.note(' committed to "%s" as %s\n' % ((b or 'default'), node.short(h))) | 113 ui.note(' committed to "%s" as %s\n' % ((b or 'default'), node.short(h))) |
| 114 | 114 |
| 115 | 115 |
| 116 def swap_out_encoding(new_encoding="UTF-8"): | 116 def swap_out_encoding(new_encoding="UTF-8"): |
| 117 """ Utility for mercurial incompatibility changes, can be removed after 1.3""" | 117 """ Utility for mercurial incompatibility changes, can be removed after 1.3 |
| 118 try: | 118 """ |
| 119 from mercurial import encoding | 119 from mercurial import encoding |
| 120 old = encoding.encoding | 120 old = encoding.encoding |
| 121 encoding.encoding = new_encoding | 121 encoding.encoding = new_encoding |
| 122 except ImportError: | |
| 123 old = hgutil._encoding | |
| 124 hgutil._encoding = new_encoding | |
| 125 return old | 122 return old |
