mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-19 12:34:17 +00:00
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
This commit is contained in:
@ -18,12 +18,12 @@ import os
|
||||
import sys
|
||||
|
||||
import gitc_utils
|
||||
from command import RequiresGitcCommand
|
||||
from command import GitcAvailableCommand
|
||||
from manifest_xml import GitcManifest
|
||||
from subcmds import init
|
||||
|
||||
|
||||
class GitcInit(init.Init, RequiresGitcCommand):
|
||||
class GitcInit(init.Init, GitcAvailableCommand):
|
||||
common = True
|
||||
helpSummary = "Initialize a GITC Client."
|
||||
helpUsage = """
|
||||
|
@ -19,7 +19,7 @@ import sys
|
||||
from formatter import AbstractFormatter, DumbWriter
|
||||
|
||||
from color import Coloring
|
||||
from command import PagedCommand, MirrorSafeCommand, RequiresGitcCommand
|
||||
from command import PagedCommand, MirrorSafeCommand, GitcAvailableCommand, GitcClientCommand
|
||||
import gitc_utils
|
||||
|
||||
class Help(PagedCommand, MirrorSafeCommand):
|
||||
@ -57,8 +57,12 @@ Displays detailed usage information about a command.
|
||||
print('The most commonly used repo commands are:')
|
||||
|
||||
def gitc_supported(cmd):
|
||||
if not isinstance(cmd, RequiresGitcCommand):
|
||||
if not isinstance(cmd, GitcAvailableCommand) and not isinstance(cmd, GitcClientCommand):
|
||||
return True
|
||||
if self.manifest.isGitcClient:
|
||||
return True
|
||||
if isinstance(cmd, GitcClientCommand):
|
||||
return False
|
||||
if gitc_utils.get_gitc_manifest_dir():
|
||||
return True
|
||||
return False
|
||||
|
Reference in New Issue
Block a user