diff options
| -rw-r--r-- | subcmds/version.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/subcmds/version.py b/subcmds/version.py index 9fb694df..761172b7 100644 --- a/subcmds/version.py +++ b/subcmds/version.py | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | from __future__ import print_function | 17 | from __future__ import print_function |
| 18 | import sys | 18 | import sys |
| 19 | from command import Command, MirrorSafeCommand | 19 | from command import Command, MirrorSafeCommand |
| 20 | from git_command import git | 20 | from git_command import git, RepoSourceVersion, user_agent |
| 21 | from git_refs import HEAD | 21 | from git_refs import HEAD |
| 22 | 22 | ||
| 23 | class Version(Command, MirrorSafeCommand): | 23 | class Version(Command, MirrorSafeCommand): |
| @@ -34,12 +34,20 @@ class Version(Command, MirrorSafeCommand): | |||
| 34 | rp = self.manifest.repoProject | 34 | rp = self.manifest.repoProject |
| 35 | rem = rp.GetRemote(rp.remote.name) | 35 | rem = rp.GetRemote(rp.remote.name) |
| 36 | 36 | ||
| 37 | print('repo version %s' % rp.work_git.describe(HEAD)) | 37 | # These might not be the same. Report them both. |
| 38 | src_ver = RepoSourceVersion() | ||
| 39 | rp_ver = rp.bare_git.describe(HEAD) | ||
| 40 | print('repo version %s' % rp_ver) | ||
| 38 | print(' (from %s)' % rem.url) | 41 | print(' (from %s)' % rem.url) |
| 39 | 42 | ||
| 40 | if Version.wrapper_path is not None: | 43 | if Version.wrapper_path is not None: |
| 41 | print('repo launcher version %s' % Version.wrapper_version) | 44 | print('repo launcher version %s' % Version.wrapper_version) |
| 42 | print(' (from %s)' % Version.wrapper_path) | 45 | print(' (from %s)' % Version.wrapper_path) |
| 43 | 46 | ||
| 47 | if src_ver != rp_ver: | ||
| 48 | print(' (currently at %s)' % src_ver) | ||
| 49 | |||
| 50 | print('repo User-Agent %s' % user_agent.repo) | ||
| 44 | print('git %s' % git.version_tuple().full) | 51 | print('git %s' % git.version_tuple().full) |
| 52 | print('git User-Agent %s' % user_agent.git) | ||
| 45 | print('Python %s' % sys.version) | 53 | print('Python %s' % sys.version) |
