summaryrefslogtreecommitdiffstats
path: root/subcmds/gitc_init.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/gitc_init.py')
-rw-r--r--subcmds/gitc_init.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/subcmds/gitc_init.py b/subcmds/gitc_init.py
index e99affa5..c243bb3b 100644
--- a/subcmds/gitc_init.py
+++ b/subcmds/gitc_init.py
@@ -19,6 +19,7 @@ import sys
19 19
20import gitc_utils 20import gitc_utils
21from command import RequiresGitcCommand 21from command import RequiresGitcCommand
22from manifest_xml import GitcManifest
22from subcmds import init 23from subcmds import init
23 24
24 25
@@ -34,7 +35,7 @@ with the GITC file system.
34 35
35This command will setup the client directory, initialize repo, just 36This command will setup the client directory, initialize repo, just
36like repo init does, and then downloads the manifest collection 37like repo init does, and then downloads the manifest collection
37and installs in in the .repo/directory of the GITC client. 38and installs it in the .repo/directory of the GITC client.
38 39
39Once this is done, a GITC manifest is generated by pulling the HEAD 40Once this is done, a GITC manifest is generated by pulling the HEAD
40SHA for each project and generates the properly formatted XML file 41SHA for each project and generates the properly formatted XML file
@@ -68,15 +69,16 @@ use for this GITC client.
68 os.mkdir(self.client_dir) 69 os.mkdir(self.client_dir)
69 super(GitcInit, self).Execute(opt, args) 70 super(GitcInit, self).Execute(opt, args)
70 71
71 for name, remote in self.manifest.remotes.iteritems(): 72 manifest_file = self.manifest.manifestFile
72 remote.fetchUrl = remote.resolvedFetchUrl
73
74 if opt.manifest_file: 73 if opt.manifest_file:
75 if not os.path.exists(opt.manifest_file): 74 if not os.path.exists(opt.manifest_file):
76 print('fatal: Specified manifest file %s does not exist.' % 75 print('fatal: Specified manifest file %s does not exist.' %
77 opt.manifest_file) 76 opt.manifest_file)
78 sys.exit(1) 77 sys.exit(1)
79 self.manifest.Override(opt.manifest_file) 78 manifest_file = opt.manifest_file
80 gitc_utils.generate_gitc_manifest(self.client_dir, self.manifest) 79
80 manifest = GitcManifest(self.repodir, opt.gitc_client)
81 manifest.Override(manifest_file)
82 gitc_utils.generate_gitc_manifest(None, manifest)
81 print('Please run `cd %s` to view your GITC client.' % 83 print('Please run `cd %s` to view your GITC client.' %
82 os.path.join(gitc_utils.GITC_FS_ROOT_DIR, opt.gitc_client)) 84 os.path.join(gitc_utils.GITC_FS_ROOT_DIR, opt.gitc_client))