Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

version: introduce version.package_version()

Numbering scheme for Windows packages: major.minor.micro
Where micro is either a small number 0..3 for timed releases, or
N1xxx for stable nightly builds (N is the timed release number) or
N5xxx for unstable nightly builds (N is the timed release number).

For instance:
the package version for tagged release 0.9.4 would be 0.9.4
the package version for stable nightly 0.9.4+8-#hash# would be 0.9.41008
the package version for unstable nightly 0.9.4+42-#hash# would be 0.9.45042

Changeset f0bb84bac2f3

Parent 1c79d85d9d4c

by Steve Borho

Changes to 2 files · Browse files at f0bb84bac2f3 Showing diff from parent 1c79d85d9d4c Diff from another changeset...

Change 1 of 2 Show Entire File setup.py Stacked
 
183
184
185
186
 
187
188
189
 
213
214
215
216
 
 
217
218
219
 
183
184
185
 
186
187
188
189
 
213
214
215
 
216
217
218
219
220
@@ -183,7 +183,7 @@
   if os.path.isdir('.hg'):   from tortoisehg.util import version as _version - version = _version.liveversion() + branch, version = _version.liveversion()   if version.endswith('+'):   version += time.strftime('%Y%m%d')  elif os.path.exists('.hg_archival.txt'): @@ -213,7 +213,8 @@
  desc = 'Windows shell extension for Mercurial VCS'   # Windows binary file versions for exe/dll files must have the   # form W.X.Y.Z, where W,X,Y,Z are numbers in the range 0..65535 - setupversion = version.split('+', 1)[0] + from tortoisehg.util.version import package_version + setupversion = package_version()   productname = 'TortoiseHg'  else:   (scripts, packages, data_files, extra) = setup_posix()
 
32
33
34
35
 
36
37
38
39
 
 
40
41
42
 
45
46
47
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
33
34
 
35
36
37
38
 
39
40
41
42
43
 
46
47
48
 
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@@ -32,11 +32,12 @@
  u.pushbuffer()   commands.parents(u, repo, template='{latesttag}+{latesttagdistance}-')   version = u.popbuffer() + l[0] - return version + return repo[None].branch(), version    def version():   try: - return liveversion() + branch, version = liveversion() + return version   except:   pass   try: @@ -45,4 +46,20 @@
  except ImportError:   return _('unknown')   - +def package_version(): + try: + branch, version = liveversion() + if '+' in version: + version, extra = version.split('+', 1) + major, minor, periodic = version.split('.') + tagdistance = int(extra.split('-', 1)[0]) + periodic = int(periodic) * 10000 + if branch == 'default': + periodic += tagdistance + 5000 + else: + periodic += tagdistance + 1000 + version = '.'.join([major, minor, str(periodic)]) + return version + except: + pass + return _('unknown')