help/version: sprinkle bug report URL around
Make it a bit easier for people to locate bug reporting info.
Change-Id: If9c8939c84ebd52eb96b353c1797afa25868bb85
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/303943
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Raman Tenneti <rtenneti@google.com>
diff --git a/error.py b/error.py
index 25ff80d..cbefcb7 100644
--- a/error.py
+++ b/error.py
@@ -13,10 +13,6 @@
# limitations under the License.
-# URL to file bug reports for repo tool issues.
-BUG_REPORT_URL = 'https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue'
-
-
class ManifestParseError(Exception):
"""Failed to parse the manifest file.
"""
diff --git a/git_superproject.py b/git_superproject.py
index 8932097..2516545 100644
--- a/git_superproject.py
+++ b/git_superproject.py
@@ -26,9 +26,9 @@
import os
import sys
-from error import BUG_REPORT_URL
from git_command import GitCommand
from git_refs import R_HEADS
+from wrapper import Wrapper
_SUPERPROJECT_GIT_NAME = 'superproject.git'
_SUPERPROJECT_MANIFEST_NAME = 'superproject_override.xml'
@@ -273,7 +273,7 @@
projects_missing_commit_ids.append(path)
if projects_missing_commit_ids:
print('error: please file a bug using %s to report missing commit_ids for: %s' %
- (BUG_REPORT_URL, projects_missing_commit_ids), file=sys.stderr)
+ (Wrapper().BUG_URL, projects_missing_commit_ids), file=sys.stderr)
return None
manifest_path = self._WriteManfiestFile()
diff --git a/repo b/repo
index d9c97de..b3f3673 100755
--- a/repo
+++ b/repo
@@ -145,6 +145,8 @@
REPO_REV = os.environ.get('REPO_REV')
if not REPO_REV:
REPO_REV = 'stable'
+# URL to file bug reports for repo tool issues.
+BUG_URL = 'https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue'
# increment this whenever we make important changes to this script
VERSION = (2, 14)
@@ -1171,6 +1173,7 @@
For access to the full online help, install repo ("repo init").
""")
+ print('Bug reports:', BUG_URL)
sys.exit(0)
@@ -1204,6 +1207,7 @@
print('OS %s %s (%s)' % (uname.system, uname.release, uname.version))
print('CPU %s (%s)' %
(uname.machine, uname.processor if uname.processor else 'unknown'))
+ print('Bug reports:', BUG_URL)
sys.exit(0)
diff --git a/subcmds/help.py b/subcmds/help.py
index 6a767e6..0989b99 100644
--- a/subcmds/help.py
+++ b/subcmds/help.py
@@ -20,6 +20,7 @@
from color import Coloring
from command import PagedCommand, MirrorSafeCommand, GitcAvailableCommand, GitcClientCommand
import gitc_utils
+from wrapper import Wrapper
class Help(PagedCommand, MirrorSafeCommand):
@@ -78,6 +79,7 @@
print(
"See 'repo help <command>' for more information on a specific command.\n"
"See 'repo help --all' for a complete list of recognized commands.")
+ print('Bug reports:', Wrapper().BUG_URL)
def _PrintCommandHelp(self, cmd, header_prefix=''):
class _Out(Coloring):
diff --git a/subcmds/version.py b/subcmds/version.py
index e95a86d..1d9abb5 100644
--- a/subcmds/version.py
+++ b/subcmds/version.py
@@ -18,6 +18,7 @@
from command import Command, MirrorSafeCommand
from git_command import git, RepoSourceVersion, user_agent
from git_refs import HEAD
+from wrapper import Wrapper
class Version(Command, MirrorSafeCommand):
@@ -62,3 +63,4 @@
print('OS %s %s (%s)' % (uname.system, uname.release, uname.version))
print('CPU %s (%s)' %
(uname.machine, uname.processor if uname.processor else 'unknown'))
+ print('Bug reports:', Wrapper().BUG_URL)