From 409407a73172b31efcee947db66ae099515eeaab Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Tue, 5 Apr 2022 21:21:56 +0000 Subject: init: add multi-manifest support This moves more of the manifest project handling into ManifestProject. Change-Id: Iecdafbec18cccdfd8e625753c3bd1bcddf2b227f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334520 Tested-by: LaMont Jones Reviewed-by: Mike Frysinger --- subcmds/init.py | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'subcmds/init.py') diff --git a/subcmds/init.py b/subcmds/init.py index 13085fae..2cb3ff38 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -32,7 +32,7 @@ from wrapper import Wrapper class Init(InteractiveCommand, MirrorSafeCommand): COMMON = True - MULTI_MANIFEST_SUPPORT = False + MULTI_MANIFEST_SUPPORT = True helpSummary = "Initialize a repo client checkout in the current directory" helpUsage = """ %prog [options] [manifest url] @@ -107,26 +107,6 @@ to update the working directory files. return {'REPO_MANIFEST_URL': 'manifest_url', 'REPO_MIRROR_LOCATION': 'reference'} - def _CloneSuperproject(self, opt): - """Clone the superproject based on the superproject's url and branch. - - Args: - opt: Program options returned from optparse. See _Options(). - """ - superproject = git_superproject.Superproject(self.manifest, - self.repodir, - self.git_event_log, - quiet=opt.quiet) - sync_result = superproject.Sync() - if not sync_result.success: - print('warning: git update of superproject failed, repo sync will not ' - 'use superproject to fetch source; while this error is not fatal, ' - 'and you can continue to run repo sync, please run repo init with ' - 'the --no-use-superproject option to stop seeing this warning', - file=sys.stderr) - if sync_result.fatal and opt.use_superproject is not None: - sys.exit(1) - def _SyncManifest(self, opt): """Call manifestProject.Sync with arguments from opt. @@ -154,19 +134,8 @@ to update the working directory files. verbose=opt.verbose, current_branch_only=opt.current_branch_only, tags=opt.tags, - depth=opt.depth): - sys.exit(1) - - def _LinkManifest(self, name): - if not name: - print('fatal: manifest name (-m) is required.', file=sys.stderr) - sys.exit(1) - - try: - self.manifest.Link(name) - except ManifestParseError as e: - print("fatal: manifest '%s' not available" % name, file=sys.stderr) - print('fatal: %s' % str(e), file=sys.stderr) + depth=opt.depth, + manifest_name=opt.manifest_name): sys.exit(1) def _Prompt(self, prompt, value): @@ -343,10 +312,6 @@ to update the working directory files. git_require((2, 15, 0), fail=True, msg='git gc worktree corruption') self._SyncManifest(opt) - self._LinkManifest(opt.manifest_name) - - if self.manifest.manifestProject.use_superproject: - self._CloneSuperproject(opt) if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror: if opt.config_name or self._ShouldConfigureUser(opt): -- cgit v1.2.3-54-g00ecf