# HG changeset patch # User Thomas Arendsen Hein # Date 2012-10-04 14:52:20 # Node ID 35674bd95200867b6356e8aac4689093aae465e5 # Parent 70efdc22b1882ef623183356308f6067f241a68c subrepo, hghave: use "svn --version --quiet" to determine version number svn --version --quiet is implemented since svn 0.14.1 (August 2002) and prints just the version number, not the long output (21 lines) of "svn --version". Additionally I expect this output format to be more stable, at least it is not changed with different translations. diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -674,8 +674,8 @@ class svnsubrepo(abstractsubrepo): @propertycache def _svnversion(self): - output, err = self._svncommand(['--version'], filename=None) - m = re.search(r'^svn,\s+version\s+(\d+)\.(\d+)', output) + output, err = self._svncommand(['--version', '--quiet'], filename=None) + m = re.search(r'^(\d+)\.(\d+)', output) if not m: raise util.Abort(_('cannot retrieve svn tool version')) return (int(m.group(1)), int(m.group(2))) diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -152,7 +152,7 @@ def has_docutils(): return False def getsvnversion(): - m = matchoutput('svn --version 2>&1', r'^svn,\s+version\s+(\d+)\.(\d+)') + m = matchoutput('svn --version --quiet 2>&1', r'^(\d+)\.(\d+)') if not m: return (0, 0) return (int(m.group(1)), int(m.group(2)))