diff options
Diffstat (limited to 'subcmds/version.py')
-rw-r--r-- | subcmds/version.py | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/subcmds/version.py b/subcmds/version.py index 71a03608..5c817f17 100644 --- a/subcmds/version.py +++ b/subcmds/version.py | |||
@@ -42,35 +42,28 @@ class Version(Command, MirrorSafeCommand): | |||
42 | # These might not be the same. Report them both. | 42 | # These might not be the same. Report them both. |
43 | src_ver = RepoSourceVersion() | 43 | src_ver = RepoSourceVersion() |
44 | rp_ver = rp.bare_git.describe(HEAD) | 44 | rp_ver = rp.bare_git.describe(HEAD) |
45 | print("repo version %s" % rp_ver) | 45 | print(f"repo version {rp_ver}") |
46 | print(" (from %s)" % rem.url) | 46 | print(f" (from {rem.url})") |
47 | print(" (tracking %s)" % branch.merge) | 47 | print(f" (tracking {branch.merge})") |
48 | print(" (%s)" % rp.bare_git.log("-1", "--format=%cD", HEAD)) | 48 | print(f" ({rp.bare_git.log('-1', '--format=%cD', HEAD)})") |
49 | 49 | ||
50 | if self.wrapper_path is not None: | 50 | if self.wrapper_path is not None: |
51 | print("repo launcher version %s" % self.wrapper_version) | 51 | print(f"repo launcher version {self.wrapper_version}") |
52 | print(" (from %s)" % self.wrapper_path) | 52 | print(f" (from {self.wrapper_path})") |
53 | 53 | ||
54 | if src_ver != rp_ver: | 54 | if src_ver != rp_ver: |
55 | print(" (currently at %s)" % src_ver) | 55 | print(f" (currently at {src_ver})") |
56 | 56 | ||
57 | print("repo User-Agent %s" % user_agent.repo) | 57 | print(f"repo User-Agent {user_agent.repo}") |
58 | print("git %s" % git.version_tuple().full) | 58 | print(f"git {git.version_tuple().full}") |
59 | print("git User-Agent %s" % user_agent.git) | 59 | print(f"git User-Agent {user_agent.git}") |
60 | print("Python %s" % sys.version) | 60 | print(f"Python {sys.version}") |
61 | uname = platform.uname() | 61 | uname = platform.uname() |
62 | if sys.version_info.major < 3: | 62 | if sys.version_info.major < 3: |
63 | # Python 3 returns a named tuple, but Python 2 is simpler. | 63 | # Python 3 returns a named tuple, but Python 2 is simpler. |
64 | print(uname) | 64 | print(uname) |
65 | else: | 65 | else: |
66 | print( | 66 | print(f"OS {uname.system} {uname.release} ({uname.version})") |
67 | "OS %s %s (%s)" % (uname.system, uname.release, uname.version) | 67 | processor = uname.processor if uname.processor else "unknown" |
68 | ) | 68 | print(f"CPU {uname.machine} ({processor})") |
69 | print( | ||
70 | "CPU %s (%s)" | ||
71 | % ( | ||
72 | uname.machine, | ||
73 | uname.processor if uname.processor else "unknown", | ||
74 | ) | ||
75 | ) | ||
76 | print("Bug reports:", Wrapper().BUG_URL) | 69 | print("Bug reports:", Wrapper().BUG_URL) |