Mercurial > public > mercurial-scm > hg-stable
diff hgext/lfs/pointer.py @ 38479:67dc32d4e790
cleanup: migrate from re.escape to stringutil.reescape
This has consistent behavior on Python 2.7, 3.6, and 3.7 and has the
benefit of probably being a little faster. Test output changes are
largely because / used to be pointlessly escaped.
Differential Revision: https://phab.mercurial-scm.org/D3842
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 26 Jun 2018 10:36:23 -0400 |
parents | aa10675c5dd6 |
children | b63dee7bd0d9 |
line wrap: on
line diff
--- a/hgext/lfs/pointer.py Tue Jun 26 10:33:52 2018 -0400 +++ b/hgext/lfs/pointer.py Tue Jun 26 10:36:23 2018 -0400 @@ -56,7 +56,7 @@ _requiredre = { 'size': re.compile(br'\A[0-9]+\Z'), 'oid': re.compile(br'\Asha256:[0-9a-f]{64}\Z'), - 'version': re.compile(br'\A%s\Z' % re.escape(VERSION)), + 'version': re.compile(br'\A%s\Z' % stringutil.reescape(VERSION)), } def validate(self):