Mercurial > hg
changeset 12060:63eab3b74ba6
subrepo: use [0-9] instead of [\d] in svn subrepo regex
The \d was used in a normal (not raw) string and was only passed
through to re.search because Python does not define that escape
character itself. Using 0-9 makes it clearer what is happening.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Fri, 27 Aug 2010 13:03:57 +0200 |
parents | 0de6cfdcaad8 |
children | f7557345b199 |
files | mercurial/subrepo.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/subrepo.py Thu Aug 26 23:38:13 2010 +0200 +++ b/mercurial/subrepo.py Fri Aug 27 13:03:57 2010 +0200 @@ -410,7 +410,7 @@ raise util.Abort(_('cannot commit svn externals')) commitinfo = self._svncommand(['commit', '-m', text]) self._ui.status(commitinfo) - newrev = re.search('Committed revision ([\d]+).', commitinfo) + newrev = re.search('Committed revision ([0-9]+).', commitinfo) if not newrev: raise util.Abort(commitinfo.splitlines()[-1]) newrev = newrev.groups()[0] @@ -427,7 +427,7 @@ def get(self, state): status = self._svncommand(['checkout', state[0], '--revision', state[1]]) - if not re.search('Checked out revision [\d]+.', status): + if not re.search('Checked out revision [0-9]+.', status): raise util.Abort(status.splitlines()[-1]) self._ui.status(status)