Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 31451:53865692a354
util: wrap s.encode('string_escape') call for future py3 compatibility
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 15 Mar 2017 23:06:50 +0900 |
parents | 756175623f2e |
children | 3b7a6941a6ef |
comparison
equal
deleted
inserted
replaced
31450:b3b4c487707c | 31451:53865692a354 |
---|---|
2127 (100, 1 << 10, _('%.0f KB')), | 2127 (100, 1 << 10, _('%.0f KB')), |
2128 (10, 1 << 10, _('%.1f KB')), | 2128 (10, 1 << 10, _('%.1f KB')), |
2129 (1, 1 << 10, _('%.2f KB')), | 2129 (1, 1 << 10, _('%.2f KB')), |
2130 (1, 1, _('%.0f bytes')), | 2130 (1, 1, _('%.0f bytes')), |
2131 ) | 2131 ) |
2132 | |
2133 def escapestr(s): | |
2134 return s.encode('string_escape') | |
2132 | 2135 |
2133 def uirepr(s): | 2136 def uirepr(s): |
2134 # Avoid double backslash in Windows path repr() | 2137 # Avoid double backslash in Windows path repr() |
2135 return repr(s).replace('\\\\', '\\') | 2138 return repr(s).replace('\\\\', '\\') |
2136 | 2139 |