incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [3/3] git commit: [#4961] Fix version check
Date Wed, 02 Jan 2013 17:37:31 GMT
Updated Branches:
  refs/heads/master 1679bca17 -> dafa63a64


[#4961] Fix version check


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/dafa63a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/dafa63a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/dafa63a6

Branch: refs/heads/master
Commit: dafa63a64c70d3163e7f57d70181c4a9450937b3
Parents: 7662a9f
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Thu Dec 13 22:48:09 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Wed Jan 2 16:58:22 2013 +0000

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py                   |    5 ++++-
 ForgeSVN/forgesvn/tests/model/test_repository.py |    4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dafa63a6/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 63deb88..ad81fc5 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -166,8 +166,11 @@ class SVNImplementation(M.RepositoryImplementation):
         if not (asbool(tg.config.get('scm.svn.hotcopy', True)) and
                 source_url.startswith('file://')):
             return False
+        # check for svn version 1.7 or later
         stdout, stderr = self.check_call(['svn', '--version'])
-        return bool(re.search('version 1.7', stdout))
+        pattern = r'version (?P<maj>\d+)\.(?P<min>\d+)'
+        m = re.search(pattern, stdout)
+        return m and (int(m.group('maj')) * 10 + int(m.group('min'))) >= 17
 
     def check_call(self, cmd):
         p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dafa63a6/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 2922c90..b683fd0 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -153,14 +153,14 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         for combo in product(
                 ['file:///myfile', 'http://myfile'],
                 [True, False],
-                ['version 1.7', 'version 1.6']):
+                ['version 1.7', 'version 1.6', 'version 2.0.3']):
             source_url = combo[0]
             tg.config = {'scm.svn.hotcopy': combo[1]}
             stdout = combo[2]
             obj.check_call.return_value = stdout, ''
             expected = (source_url.startswith('file://') and
                     tg.config['scm.svn.hotcopy'] and
-                    stdout == 'version 1.7')
+                    stdout != 'version 1.6')
             result = func(obj, source_url)
             assert result == expected
 


Mime
View raw message