180 # https://bugs.python.org/issue13524#msg148850 |
180 # https://bugs.python.org/issue13524#msg148850 |
181 env['SystemRoot'] = os.environ['SystemRoot'] |
181 env['SystemRoot'] = os.environ['SystemRoot'] |
182 |
182 |
183 if os.path.isdir('.hg'): |
183 if os.path.isdir('.hg'): |
184 cmd = [sys.executable, 'hg', 'log', '-r', '.', '--template', '{tags}\n'] |
184 cmd = [sys.executable, 'hg', 'log', '-r', '.', '--template', '{tags}\n'] |
185 numerictags = [t for t in runhg(cmd, env).split() if t[0].isdigit()] |
185 numerictags = [t for t in runhg(cmd, env).split() if t[0:1].isdigit()] |
186 hgid = runhg([sys.executable, 'hg', 'id', '-i'], env).strip() |
186 hgid = runhg([sys.executable, 'hg', 'id', '-i'], env).strip() |
187 if numerictags: # tag(s) found |
187 if numerictags: # tag(s) found |
188 version = numerictags[-1] |
188 version = numerictags[-1] |
189 if hgid.endswith('+'): # propagate the dirty status to the tag |
189 if hgid.endswith('+'): # propagate the dirty status to the tag |
190 version += '+' |
190 version += '+' |