summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-08-31 15:45:06 -0700
committerDan Willemsen <dwillemsen@google.com>2015-09-29 13:46:34 -0700
commit79360640f4c7d5f044973aa1bdb6fb0f8f311f05 (patch)
treede0228e9e44b05ad3da07d4e8829a90bebb3871f /main.py
parent7b01b2fd01f4e37688242db19c93feb27f9b65c6 (diff)
downloadgit-repo-79360640f4c7d5f044973aa1bdb6fb0f8f311f05.tar.gz
Add GitcClientCommand class for GITC-specific commands
These won't show up as common commands in the help text unless in a GITC client, and will refuse to execute. Change-Id: Iffe82adcc9d6ddde9cb4b204f83ff018042bdab0
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.py b/main.py
index a5979a87..4f4eb9fc 100755
--- a/main.py
+++ b/main.py
@@ -42,7 +42,7 @@ from git_command import git, GitCommand
42from git_config import init_ssh, close_ssh 42from git_config import init_ssh, close_ssh
43from command import InteractiveCommand 43from command import InteractiveCommand
44from command import MirrorSafeCommand 44from command import MirrorSafeCommand
45from command import RequiresGitcCommand 45from command import GitcAvailableCommand, GitcClientCommand
46from subcmds.version import Version 46from subcmds.version import Version
47from editor import Editor 47from editor import Editor
48from error import DownloadError 48from error import DownloadError
@@ -144,11 +144,16 @@ class _Repo(object):
144 file=sys.stderr) 144 file=sys.stderr)
145 return 1 145 return 1
146 146
147 if isinstance(cmd, RequiresGitcCommand) and not gitc_utils.get_gitc_manifest_dir(): 147 if isinstance(cmd, GitcAvailableCommand) and not gitc_utils.get_gitc_manifest_dir():
148 print("fatal: '%s' requires GITC to be available" % name, 148 print("fatal: '%s' requires GITC to be available" % name,
149 file=sys.stderr) 149 file=sys.stderr)
150 return 1 150 return 1
151 151
152 if isinstance(cmd, GitcClientCommand) and not gitc_client_name:
153 print("fatal: '%s' requires a GITC client" % name,
154 file=sys.stderr)
155 return 1
156
152 try: 157 try:
153 copts, cargs = cmd.OptionParser.parse_args(argv) 158 copts, cargs = cmd.OptionParser.parse_args(argv)
154 copts = cmd.ReadEnvironmentOptions(copts) 159 copts = cmd.ReadEnvironmentOptions(copts)