diff options
| author | Dan Willemsen <dwillemsen@google.com> | 2015-08-31 15:45:06 -0700 |
|---|---|---|
| committer | Dan Willemsen <dwillemsen@google.com> | 2015-09-29 13:46:34 -0700 |
| commit | 79360640f4c7d5f044973aa1bdb6fb0f8f311f05 (patch) | |
| tree | de0228e9e44b05ad3da07d4e8829a90bebb3871f /main.py | |
| parent | 7b01b2fd01f4e37688242db19c93feb27f9b65c6 (diff) | |
| download | git-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-x | main.py | 9 |
1 files changed, 7 insertions, 2 deletions
| @@ -42,7 +42,7 @@ from git_command import git, GitCommand | |||
| 42 | from git_config import init_ssh, close_ssh | 42 | from git_config import init_ssh, close_ssh |
| 43 | from command import InteractiveCommand | 43 | from command import InteractiveCommand |
| 44 | from command import MirrorSafeCommand | 44 | from command import MirrorSafeCommand |
| 45 | from command import RequiresGitcCommand | 45 | from command import GitcAvailableCommand, GitcClientCommand |
| 46 | from subcmds.version import Version | 46 | from subcmds.version import Version |
| 47 | from editor import Editor | 47 | from editor import Editor |
| 48 | from error import DownloadError | 48 | from 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) |
