diff options
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -42,6 +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 subcmds.version import Version | 46 | from subcmds.version import Version |
46 | from editor import Editor | 47 | from editor import Editor |
47 | from error import DownloadError | 48 | from error import DownloadError |
@@ -51,7 +52,8 @@ from error import ManifestParseError | |||
51 | from error import NoManifestException | 52 | from error import NoManifestException |
52 | from error import NoSuchProjectError | 53 | from error import NoSuchProjectError |
53 | from error import RepoChangedException | 54 | from error import RepoChangedException |
54 | from manifest_xml import XmlManifest | 55 | import gitc_utils |
56 | from manifest_xml import GitcManifest, XmlManifest | ||
55 | from pager import RunPager | 57 | from pager import RunPager |
56 | from wrapper import WrapperPath, Wrapper | 58 | from wrapper import WrapperPath, Wrapper |
57 | 59 | ||
@@ -129,6 +131,12 @@ class _Repo(object): | |||
129 | 131 | ||
130 | cmd.repodir = self.repodir | 132 | cmd.repodir = self.repodir |
131 | cmd.manifest = XmlManifest(cmd.repodir) | 133 | cmd.manifest = XmlManifest(cmd.repodir) |
134 | cmd.gitc_manifest = None | ||
135 | gitc_client_name = gitc_utils.parse_clientdir(os.getcwd()) | ||
136 | if gitc_client_name: | ||
137 | cmd.gitc_manifest = GitcManifest(cmd.repodir, gitc_client_name) | ||
138 | cmd.manifest.isGitcClient = True | ||
139 | |||
132 | Editor.globalConfig = cmd.manifest.globalConfig | 140 | Editor.globalConfig = cmd.manifest.globalConfig |
133 | 141 | ||
134 | if not isinstance(cmd, MirrorSafeCommand) and cmd.manifest.IsMirror: | 142 | if not isinstance(cmd, MirrorSafeCommand) and cmd.manifest.IsMirror: |
@@ -136,6 +144,11 @@ class _Repo(object): | |||
136 | file=sys.stderr) | 144 | file=sys.stderr) |
137 | return 1 | 145 | return 1 |
138 | 146 | ||
147 | if isinstance(cmd, RequiresGitcCommand) and not gitc_utils.get_gitc_manifest_dir(): | ||
148 | print("fatal: '%s' requires GITC to be available" % name, | ||
149 | file=sys.stderr) | ||
150 | return 1 | ||
151 | |||
139 | try: | 152 | try: |
140 | copts, cargs = cmd.OptionParser.parse_args(argv) | 153 | copts, cargs = cmd.OptionParser.parse_args(argv) |
141 | copts = cmd.ReadEnvironmentOptions(copts) | 154 | copts = cmd.ReadEnvironmentOptions(copts) |