Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

stable setup: use latesttag templates to build version numbers

Changeset 0563f76e0575

Parent a65819ee8b5e

by Steve Borho

Changes to one file · Browse files at 0563f76e0575 Showing diff from parent a65819ee8b5e Diff from another changeset...

Change 1 of 2 Show Entire File setup.py Stacked
 
10
11
12
 
13
14
15
 
158
159
160
 
 
161
162
 
163
164
165
 
 
 
 
 
 
 
166
167
168
 
10
11
12
13
14
15
16
 
159
160
161
162
163
164
 
165
166
167
 
168
169
170
171
172
173
174
175
176
177
@@ -10,6 +10,7 @@
 import time  import sys  import os +import subprocess  from distutils.core import setup  from distutils.command.build import build  from distutils.spawn import spawn, find_executable @@ -158,11 +159,19 @@
  (scripts, packages, data_files, extra) = setup_posix()   desc='TortoiseHg dialogs for Mercurial VCS'   +version = '' +  try: - l = os.popen('hg -R . id -it').read().split() + l = os.popen('hg -R . id -i -t').read().split()   while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags   l.pop() - version = l and l[-1] or 'unknown' # latest tag or revision number + if len(l) > 1: # tag found + version = l[-1] + if l[0].endswith('+'): # propagate the dirty status to the tag + version += '+' + elif len(l) == 1: # no tag found + cmd = 'hg parents --template {latesttag}+{latesttagdistance}-' + version = os.popen(cmd).read() + l[0]   if version.endswith('+'):   version += time.strftime('%Y%m%d')  except OSError: