Commit 239483ad authored by Michal Čihař's avatar Michal Čihař

Gracefully handle invalid version string from mercurial

Issue #697
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 68d85b9b
...@@ -852,7 +852,12 @@ class HgRepository(Repository): ...@@ -852,7 +852,12 @@ class HgRepository(Repository):
Returns VCS program version. Returns VCS program version.
""" """
output = cls._popen(['version', '-q']) output = cls._popen(['version', '-q'])
return cls.VERSION_RE.match(output).group(1) matches = cls.VERSION_RE.match(output)
if matches is None:
raise OSError(
u'Failed to parse version string: {0}'.format(output)
)
return matches.group(1)
def commit(self, message, author=None, timestamp=None, files=None): def commit(self, message, author=None, timestamp=None, files=None):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment