# HG changeset patch # User Matt Harbison # Date 1577515877 18000 # Node ID c1ccefb513e4857bf371dab54ba569be0f0a9f06 # Parent 6d3b67a837a6729247407bd6bcdb7b5c2f016f17 cleanup: drop redundant character escapes outside of `[]` Flagged by PyCharm. `@`, `:`, `<`, `>`, and `{` aren't special characters. (I'm a bit surprised that it doesn't also want to unescape `}` in schemes.py.) Differential Revision: https://phab.mercurial-scm.org/D7767 diff -r 6d3b67a837a6 -r c1ccefb513e4 hgext/convert/subversion.py --- a/hgext/convert/subversion.py Sat Dec 28 01:35:05 2019 -0500 +++ b/hgext/convert/subversion.py Sat Dec 28 01:51:17 2019 -0500 @@ -643,7 +643,7 @@ if not re.match( r'svn:[0-9a-f]{8,8}-[0-9a-f]{4,4}-' r'[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]' - r'{12,12}(.*)\@[0-9]+$', + r'{12,12}(.*)@[0-9]+$', revstr, ): raise error.Abort( @@ -1303,7 +1303,7 @@ self.wc = os.path.realpath(path) self.run0(b'update') else: - if not re.search(br'^(file|http|https|svn|svn\+ssh)\://', path): + if not re.search(br'^(file|http|https|svn|svn\+ssh)://', path): path = os.path.realpath(path) if os.path.isdir(os.path.dirname(path)): if not os.path.exists( diff -r 6d3b67a837a6 -r c1ccefb513e4 hgext/schemes.py --- a/hgext/schemes.py Sat Dec 28 01:35:05 2019 -0500 +++ b/hgext/schemes.py Sat Dec 28 01:51:17 2019 -0500 @@ -63,7 +63,7 @@ # leave the attribute unspecified. testedwith = b'ships-with-hg-core' -_partre = re.compile(br'\{(\d+)\}') +_partre = re.compile(br'{(\d+)\}') class ShortRepository(object): diff -r 6d3b67a837a6 -r c1ccefb513e4 mercurial/utils/stringutil.py --- a/mercurial/utils/stringutil.py Sat Dec 28 01:35:05 2019 -0500 +++ b/mercurial/utils/stringutil.py Sat Dec 28 01:51:17 2019 -0500 @@ -593,7 +593,7 @@ ) -_correctauthorformat = remod.compile(br'^[^<]+\s\<[^<>]+@[^<>]+\>$') +_correctauthorformat = remod.compile(br'^[^<]+\s<[^<>]+@[^<>]+>$') def isauthorwellformed(author):