Update the checkout pin command to look for pin files only in the workspace's source manifest repository.
Signed-off-by: Ashley E Desimone <ashley.e.desim...@intel.com> Cc: Nate DeSimone <nathaniel.l.desim...@intel.com> Cc: Puja Pandya <puja.pan...@intel.com> Cc: Erik Bjorge <erik.c.bjo...@intel.com> Cc: Bret Barkelew <bret.barke...@microsoft.com> Cc: Prince Agyeman <prince.agye...@intel.com> --- edkrepo/commands/checkout_pin_command.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/edkrepo/commands/checkout_pin_command.py b/edkrepo/commands/checkout_pin_command.py index 31df825..5272236 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 find_project_in_all_indices +from edkrepo.common.workspace_maintenance.humble.manifest_repos_maintenance_humble import PROJ_NOT_IN_REPO, SOURCE_MANIFEST_REPO_NOT_FOUND from edkrepo.config.config_factory import get_workspace_path, get_workspace_manifest from edkrepo_manifest_parser.edk_manifest import ManifestXml @@ -38,12 +40,25 @@ 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, cfg, manifest_path = find_project_in_all_indices (manifest.project_info.codename, + config['cfg_file'], + config['user_cfg_file'], + PROJ_NOT_IN_REPO.format(manifest.project_info.codename), + SOURCE_MANIFEST_REPO_NOT_FOUND.format(manifest.project_info.codename), + args.source_manifest_repo) + if 'user' not in cfg: + manifest_repo_path = config['cfg_file'].manifest_repo_abs_path(manifest_repo) + else: + 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 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#58766): https://edk2.groups.io/g/devel/message/58766 Mute This Topic: https://groups.io/mt/74043047/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-