From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.1934.1588965305480380213 for ; Fri, 08 May 2020 12:15:05 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: ashley.e.desimone@intel.com) IronPort-SDR: uE/JEEa9bYwk9DILiH3LYTAeGCnlyEifOD8FpfuWGZW8cG2g5AGHDJyWYLlWeiiEQ907lJiSoJ ndSrtclJH4TA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 12:15:03 -0700 IronPort-SDR: ssnV2KvLeI/Xe3aecsu5I4MdCfGSenSHredBuaEXSTUdfVjaC1jCK8ufa4ziCGc8cmctu8AHF+ VUTcuT4imw9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,368,1583222400"; d="scan'208";a="250551539" Received: from aedesimo-desk.amr.corp.intel.com ([10.212.16.147]) by fmsmga007.fm.intel.com with ESMTP; 08 May 2020 12:15:03 -0700 From: "Ashley E Desimone" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew , Prince Agyeman Subject: [edk2-staging/EdkRepo] [PATCH V2] EkdRepo: Update Checkout Pin to Support Multiple Manifest Repos Date: Fri, 8 May 2020 12:14:56 -0700 Message-Id: <20200508191456.10508-1-ashley.e.desimone@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 Update the checkout pin command to look for pin files only in the workspace's source manifest repository. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- edkrepo/commands/checkout_pin_command.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/edkrepo/commands/checkout_pin_command.py b/edkrepo/commands/checkout_pin_command.py index 31df825..4aaf2b5 100644 --- a/edkrepo/commands/checkout_pin_command.py +++ b/edkrepo/commands/checkout_pin_command.py @@ -11,13 +11,15 @@ import os from git import Repo -from edkrepo.commands.edkrepo_command import EdkrepoCommand, OverrideArgument +from edkrepo.commands.edkrepo_command import EdkrepoCommand, OverrideArgument, SourceManifestRepoArgument import edkrepo.commands.arguments.checkout_pin_args as arguments import edkrepo.commands.humble.checkout_pin_humble as humble from edkrepo.common.common_repo_functions import sparse_checkout_enabled, reset_sparse_checkout, sparse_checkout from edkrepo.common.common_repo_functions import check_dirty_repos, checkout_repos, combinations_in_manifest from edkrepo.common.humble import SPARSE_CHECKOUT, SPARSE_RESET from edkrepo.common.edkrepo_exception import EdkrepoInvalidParametersException, EdkrepoProjectMismatchException +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance import list_available_manifest_repos +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance import find_source_manifest_repo from edkrepo.config.config_factory import get_workspace_path, get_workspace_manifest from edkrepo_manifest_parser.edk_manifest import ManifestXml @@ -38,12 +40,21 @@ class CheckoutPinCommand(EdkrepoCommand): 'required' : True, 'help-text' : arguments.PIN_FILE_HELP}) args.append(OverrideArgument) + args.append(SourceManifestRepoArgument) return metadata def run_command(self, args, config): workspace_path = get_workspace_path() manifest = get_workspace_manifest() - pin_path = self.__get_pin_path(args, workspace_path, config['cfg_file'].manifest_repo_abs_local_path, manifest) + + manifest_repo = find_source_manifest_repo(manifest, config['cfg_file'], config['user_cfg_file'], args.source_manifest_repo) + cfg, user_cfg, conflicts = list_available_manifest_repos(config['cfg_file'], config['user_cfg_file']) + if manifest_repo in cfg: + manifest_repo_path = config['cfg_file'].manifest_repo_abs_path(manifest_repo) + elif manifest_repo in user_cfg: + manifest_repo_path = config['user_cfg_file'].manifest_repo_abs_path(manifest_repo) + + pin_path = self.__get_pin_path(args, workspace_path, manifest_repo_path, manifest) pin = ManifestXml(pin_path) manifest_sources = manifest.get_repo_sources(manifest.general_config.current_combo) check_dirty_repos(manifest, workspace_path) -- 2.16.2.windows.1