1 |
commit: 83d1bd1a2b01e3b89caca3ff48e4308176c208f0 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 29 16:10:36 2015 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 29 16:10:36 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=83d1bd1a |
7 |
|
8 |
version.py: Copy what was needed of the old format_version code to fix versioning |
9 |
|
10 |
The new get_version code from snakeoil is not compatible with teh rest of |
11 |
the catlyst code. It will need a lot more conversion to use the new system. |
12 |
I do think it could be better once completed. |
13 |
|
14 |
catalyst/version.py | 18 +++++++++++++++--- |
15 |
1 file changed, 15 insertions(+), 3 deletions(-) |
16 |
|
17 |
diff --git a/catalyst/version.py b/catalyst/version.py |
18 |
index 8c0b267..c274a11 100644 |
19 |
--- a/catalyst/version.py |
20 |
+++ b/catalyst/version.py |
21 |
@@ -10,16 +10,28 @@ |
22 |
|
23 |
import os |
24 |
|
25 |
-from snakeoil.version import get_version as get_ver |
26 |
+from snakeoil.version import get_git_version as get_ver |
27 |
|
28 |
-__version__="rewrite-git" |
29 |
+__version__="git" |
30 |
_ver = None |
31 |
|
32 |
|
33 |
def get_git_version(version=__version__): |
34 |
"""Return: a string describing our version.""" |
35 |
global _ver |
36 |
- _ver = get_ver('catalyst-%s' % version, __file__) |
37 |
+ cwd = os.path.dirname(os.path.abspath(__file__)) |
38 |
+ version_info = get_ver(cwd) |
39 |
+ |
40 |
+ if not version_info: |
41 |
+ s = "extended version info unavailable" |
42 |
+ elif version_info['tag'] == api_version: |
43 |
+ s = 'released %s' % (version_info['date'],) |
44 |
+ else: |
45 |
+ s = ('vcs version %s, date %s' % |
46 |
+ (version_info['rev'], version_info['date'])) |
47 |
+ |
48 |
+ _ver = '%s %s\n%s' % (project, api_version, s) |
49 |
+ |
50 |
return _ver |