Mercurial > kallithea
comparison rhodecode/lib/utils.py @ 3376:e67b2ef07a8e beta
git executable is now configurable via .ini files
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 17 Feb 2013 22:58:09 +0100 |
parents | 7000fc4aa569 |
children | 64c194492aad |
comparison
equal
deleted
inserted
replaced
3375:7000fc4aa569 | 3376:e67b2ef07a8e |
---|---|
742 def check_git_version(): | 742 def check_git_version(): |
743 """ | 743 """ |
744 Checks what version of git is installed in system, and issues a warning | 744 Checks what version of git is installed in system, and issues a warning |
745 if it's too old for RhodeCode to properly work. | 745 if it's too old for RhodeCode to properly work. |
746 """ | 746 """ |
747 import subprocess | 747 from rhodecode import BACKENDS |
748 from rhodecode.lib.vcs.backends.git.repository import GitRepository | |
748 from distutils.version import StrictVersion | 749 from distutils.version import StrictVersion |
749 from rhodecode import BACKENDS | 750 |
750 | 751 stdout, stderr = GitRepository._run_git_command('--version') |
751 p = subprocess.Popen('git --version', shell=True, | 752 |
752 stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
753 stdout, stderr = p.communicate() | |
754 ver = (stdout.split(' ')[-1] or '').strip() or '0.0.0' | 753 ver = (stdout.split(' ')[-1] or '').strip() or '0.0.0' |
755 if len(ver.split('.')) > 3: | 754 if len(ver.split('.')) > 3: |
756 #StrictVersion needs to be only 3 element type | 755 #StrictVersion needs to be only 3 element type |
757 ver = '.'.join(ver.split('.')[:3]) | 756 ver = '.'.join(ver.split('.')[:3]) |
758 try: | 757 try: |