comparison src/tools/utils.py @ 1857:2d2617930f97

core (tools): fixed bad call to "hg id" when hg is not working to guest revision, which was the cause of an Exception
author Goffi <goffi@goffi.org>
date Sun, 28 Feb 2016 01:57:51 +0100
parents d17772b0fe22
children 06e13ae616cf
comparison
equal deleted inserted replaced
1856:d7e29a12ec2c 1857:2d2617930f97
78 hg_data_raw = subprocess.check_output(["hg","log", "-r", "-1", "--template","{node}\n{node|short}\n{branch}\n{date|isodate}\n{latesttag}"]) 78 hg_data_raw = subprocess.check_output(["hg","log", "-r", "-1", "--template","{node}\n{node|short}\n{branch}\n{date|isodate}\n{latesttag}"])
79 except subprocess.CalledProcessError: 79 except subprocess.CalledProcessError:
80 hg_data = {} 80 hg_data = {}
81 else: 81 else:
82 hg_data = dict(zip(KEYS, hg_data_raw.split('\n'))) 82 hg_data = dict(zip(KEYS, hg_data_raw.split('\n')))
83 try: 83 try:
84 hg_data['modified'] = '+' in subprocess.check_output(["hg","id","-i"]) 84 hg_data['modified'] = '+' in subprocess.check_output(["hg","id","-i"])
85 except subprocess.CalledProcessError: 85 except subprocess.CalledProcessError:
86 pass 86 pass
87 else: 87 else:
88 hg_data = {} 88 hg_data = {}
89 89
90 if not hg_data: 90 if not hg_data:
91 log.debug(u"Mercurial not available or working, trying to get data from dirstate") 91 log.debug(u"Mercurial not available or working, trying to get data from dirstate")