public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-staging/EdkRepo] [PATCH V2] EkdRepo: Update Checkout Pin to Support Multiple Manifest Repos
@ 2020-05-08 19:14 Ashley E Desimone
  2020-05-10  1:04 ` Nate DeSimone
  2020-05-10  3:25 ` Nate DeSimone
  0 siblings, 2 replies; 3+ messages in thread
From: Ashley E Desimone @ 2020-05-08 19:14 UTC (permalink / raw)
  To: devel
  Cc: Nate DeSimone, Puja Pandya, Erik Bjorge, Bret Barkelew,
	Prince Agyeman

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.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-staging/EdkRepo] [PATCH V2] EkdRepo: Update Checkout Pin to Support Multiple Manifest Repos
  2020-05-08 19:14 [edk2-staging/EdkRepo] [PATCH V2] EkdRepo: Update Checkout Pin to Support Multiple Manifest Repos Ashley E Desimone
@ 2020-05-10  1:04 ` Nate DeSimone
  2020-05-10  3:25 ` Nate DeSimone
  1 sibling, 0 replies; 3+ messages in thread
From: Nate DeSimone @ 2020-05-10  1:04 UTC (permalink / raw)
  To: Desimone, Ashley E, devel@edk2.groups.io
  Cc: Pandya, Puja, Bjorge, Erik C, Bret Barkelew, Agyeman, Prince

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Desimone, Ashley E <ashley.e.desimone@intel.com> 
Sent: Friday, May 8, 2020 12:15 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince <prince.agyeman@intel.com>
Subject: [edk2-staging/EdkRepo] [PATCH V2] EkdRepo: Update Checkout Pin to Support Multiple Manifest Repos

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.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-staging/EdkRepo] [PATCH V2] EkdRepo: Update Checkout Pin to Support Multiple Manifest Repos
  2020-05-08 19:14 [edk2-staging/EdkRepo] [PATCH V2] EkdRepo: Update Checkout Pin to Support Multiple Manifest Repos Ashley E Desimone
  2020-05-10  1:04 ` Nate DeSimone
@ 2020-05-10  3:25 ` Nate DeSimone
  1 sibling, 0 replies; 3+ messages in thread
From: Nate DeSimone @ 2020-05-10  3:25 UTC (permalink / raw)
  To: Desimone, Ashley E, devel@edk2.groups.io
  Cc: Pandya, Puja, Bjorge, Erik C, Bret Barkelew, Agyeman, Prince

Pushed: 98607d087015e8ee5e32950dd9a4d7c3ef2698b3

> -----Original Message-----
> From: Desimone, Ashley E <ashley.e.desimone@intel.com>
> Sent: Friday, May 8, 2020 12:15 PM
> To: devel@edk2.groups.io
> Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
> <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret
> Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince
> <prince.agyeman@intel.com>
> Subject: [edk2-staging/EdkRepo] [PATCH V2] EkdRepo: Update Checkout Pin
> to Support Multiple Manifest Repos
> 
> 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.desimone@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Puja Pandya <puja.pandya@intel.com>
> Cc: Erik Bjorge <erik.c.bjorge@intel.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Prince Agyeman <prince.agyeman@intel.com>
> ---
>  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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-10  3:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-08 19:14 [edk2-staging/EdkRepo] [PATCH V2] EkdRepo: Update Checkout Pin to Support Multiple Manifest Repos Ashley E Desimone
2020-05-10  1:04 ` Nate DeSimone
2020-05-10  3:25 ` Nate DeSimone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox