changeset 2911:b14850a72bc2 beta

fixed check git version function, git sometimes uses 4 element version numbering which breaks the system that function
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 09 Oct 2012 01:32:07 +0200
parents 3dfa25f35482
children 976e2b032650
files rhodecode/lib/utils.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/utils.py	Tue Oct 09 01:00:26 2012 +0200
+++ b/rhodecode/lib/utils.py	Tue Oct 09 01:32:07 2012 +0200
@@ -684,9 +684,12 @@
     from rhodecode import BACKENDS
 
     p = subprocess.Popen('git --version', shell=True,
-                         stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+                        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     stdout, stderr = p.communicate()
     ver = (stdout.split(' ')[-1] or '').strip() or '0.0.0'
+    if len(ver.split('.')) > 3:
+        #StrictVersion needs to be only 3 element type
+        ver = '.'.join(ver.split('.')[:3])
     try:
         _ver = StrictVersion(ver)
     except: