comparison mercurial/subrepo.py @ 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 f3075ffa6b30
children af8c4929931c
comparison
equal deleted inserted replaced
12059:0de6cfdcaad8 12060:63eab3b74ba6
408 if extchanged: 408 if extchanged:
409 # Do not try to commit externals 409 # Do not try to commit externals
410 raise util.Abort(_('cannot commit svn externals')) 410 raise util.Abort(_('cannot commit svn externals'))
411 commitinfo = self._svncommand(['commit', '-m', text]) 411 commitinfo = self._svncommand(['commit', '-m', text])
412 self._ui.status(commitinfo) 412 self._ui.status(commitinfo)
413 newrev = re.search('Committed revision ([\d]+).', commitinfo) 413 newrev = re.search('Committed revision ([0-9]+).', commitinfo)
414 if not newrev: 414 if not newrev:
415 raise util.Abort(commitinfo.splitlines()[-1]) 415 raise util.Abort(commitinfo.splitlines()[-1])
416 newrev = newrev.groups()[0] 416 newrev = newrev.groups()[0]
417 self._ui.status(self._svncommand(['update', '-r', newrev])) 417 self._ui.status(self._svncommand(['update', '-r', newrev]))
418 return newrev 418 return newrev
425 self._ui.note(_('removing subrepo %s\n') % self._path) 425 self._ui.note(_('removing subrepo %s\n') % self._path)
426 shutil.rmtree(self._ctx.repo.join(self._path)) 426 shutil.rmtree(self._ctx.repo.join(self._path))
427 427
428 def get(self, state): 428 def get(self, state):
429 status = self._svncommand(['checkout', state[0], '--revision', state[1]]) 429 status = self._svncommand(['checkout', state[0], '--revision', state[1]])
430 if not re.search('Checked out revision [\d]+.', status): 430 if not re.search('Checked out revision [0-9]+.', status):
431 raise util.Abort(status.splitlines()[-1]) 431 raise util.Abort(status.splitlines()[-1])
432 self._ui.status(status) 432 self._ui.status(status)
433 433
434 def merge(self, state): 434 def merge(self, state):
435 old = int(self._state[1]) 435 old = int(self._state[1])