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

version: prefer live version number

running setup.py --version in a live repo will create a __version__.py
that will be quickly out of date.

Changeset 96601bd9273e

Parent 37b8f3b4fa13

by Steve Borho

Changes to one file · Browse files at 96601bd9273e Showing diff from parent 37b8f3b4fa13 Diff from another changeset...

 
6
7
8
9
 
10
11
12
 
14
15
16
17
 
18
19
20
 
36
37
38
 
 
 
 
39
40
41
42
43
44
45
 
46
47
 
6
7
8
 
9
10
11
12
 
14
15
16
 
17
18
19
20
 
36
37
38
39
40
41
42
43
44
45
 
 
 
 
46
47
48
@@ -6,7 +6,7 @@
 # GNU General Public License version 2, incorporated herein by reference.    import os -from mercurial import ui, hg, commands +from mercurial import ui, hg, commands, error  from tortoisehg.util.i18n import _    def liveversion(): @@ -14,7 +14,7 @@
  utilpath = os.path.dirname(os.path.realpath(__file__))   thgpath = os.path.dirname(os.path.dirname(utilpath))   if not os.path.isdir(os.path.join(thgpath, '.hg')): - return _('unknown') + raise error.RepoError(_('repository %s not found') % thgpath)     u = ui.ui()   repo = hg.repository(u, path=thgpath) @@ -36,12 +36,13 @@
   def version():   try: + return liveversion() + except: + pass + try:   import __version__   return __version__.version   except ImportError: - try: - return liveversion() - except: - return _('unknown') + return _('unknown')