From patchwork Wed Jan 8 19:50:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7767: cleanup: drop redundant character escapes outside of `[]` From: phabricator X-Patchwork-Id: 44199 Message-Id: <76fe05f4ec3a6643fc12f43ca611fb64@localhost.localdomain> To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 8 Jan 2020 19:50:34 +0000 Closed by commit rHGc1ccefb513e4: cleanup: drop redundant character escapes outside of `[]` (authored by mharbison72). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7767?vs=18998&id=19096 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7767/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7767 AFFECTED FILES hgext/convert/subversion.py hgext/schemes.py mercurial/utils/stringutil.py CHANGE DETAILS To: mharbison72, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/utils/stringutil.py b/mercurial/utils/stringutil.py --- a/mercurial/utils/stringutil.py +++ b/mercurial/utils/stringutil.py @@ -593,7 +593,7 @@ ) -_correctauthorformat = remod.compile(br'^[^<]+\s\<[^<>]+@[^<>]+\>$') +_correctauthorformat = remod.compile(br'^[^<]+\s<[^<>]+@[^<>]+>$') def isauthorwellformed(author): diff --git a/hgext/schemes.py b/hgext/schemes.py --- a/hgext/schemes.py +++ b/hgext/schemes.py @@ -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 --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -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(