[edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve state tracking when checking out pin files

Desimone, Ashley E posted 1 patch 4 years ago
Failed in applying to current master (apply log)
edkrepo/commands/checkout_pin_command.py       | 2 +-
edkrepo/commands/humble/checkout_pin_humble.py | 3 ++-
edkrepo_manifest_parser/edk_manifest.py        | 4 ++++
3 files changed, 7 insertions(+), 2 deletions(-)
[edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve state tracking when checking out pin files
Posted by Desimone, Ashley E 4 years ago
Improves the state tracking when checking out onto a pin file
by: (1)moving the call to write_current_combo() after the succesfull
checkout, (2)changing the name of the combo written to the format:
'Pin: {pinfilename}', (3)If the current combo is a knon pin file
(starts with 'Pin:') get_repo_sources() will return the repo sources
from the default combo

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       | 2 +-
 edkrepo/commands/humble/checkout_pin_humble.py | 3 ++-
 edkrepo_manifest_parser/edk_manifest.py        | 4 ++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/edkrepo/commands/checkout_pin_command.py b/edkrepo/commands/checkout_pin_command.py
index a2afc41..619fcf8 100644
--- a/edkrepo/commands/checkout_pin_command.py
+++ b/edkrepo/commands/checkout_pin_command.py
@@ -53,7 +53,6 @@ class CheckoutPinCommand(EdkrepoCommand):
             origin = repo.remotes.origin
             origin.fetch()
         self.__pin_matches_project(pin, manifest, workspace_path)
-        manifest.write_current_combo(pin.general_config.current_combo)
         sparse_enabled = sparse_checkout_enabled(workspace_path, manifest_sources)
         if sparse_enabled:
             print(SPARSE_RESET)
@@ -61,6 +60,7 @@ class CheckoutPinCommand(EdkrepoCommand):
         pin_repo_sources = pin.get_repo_sources(pin.general_config.current_combo)
         try:
             checkout_repos(args.verbose, args.override, pin_repo_sources, workspace_path, manifest)
+            manifest.write_current_combo(humble.PIN_COMBO.format(args.pinfile))
         finally:
             if sparse_enabled:
                 print(SPARSE_CHECKOUT)
diff --git a/edkrepo/commands/humble/checkout_pin_humble.py b/edkrepo/commands/humble/checkout_pin_humble.py
index b5a9cfb..ac7467d 100644
--- a/edkrepo/commands/humble/checkout_pin_humble.py
+++ b/edkrepo/commands/humble/checkout_pin_humble.py
@@ -11,4 +11,5 @@ CHP_EXIT = 'Exiting without checkout out PIN data.'
 NOT_FOUND = 'The selected PIN file was not found.'
 MANIFEST_MISMATCH = ('The selected PIN file does not refer to the same project '
                      'as the local manifest file. {}'.format(CHP_EXIT))
-COMMIT_NOT_FOUND = 'The commit referenced by the PIN file does not exist. {}'.format(CHP_EXIT) 
\ No newline at end of file
+COMMIT_NOT_FOUND = 'The commit referenced by the PIN file does not exist. {}'.format(CHP_EXIT) 
+PIN_COMBO = 'Pin: {}'
\ No newline at end of file
diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_parser/edk_manifest.py
index dd3512b..2d3e79e 100644
--- a/edkrepo_manifest_parser/edk_manifest.py
+++ b/edkrepo_manifest_parser/edk_manifest.py
@@ -311,6 +311,10 @@ class ManifestXml(BaseXmlHelper):
     def get_repo_sources(self, combo_name):
         if combo_name in self.__combo_sources:
             return self._tuple_list(self.__combo_sources[combo_name])
+        elif combo_name.startswith('Pin:'):
+            # If currently checked out onto a pin file reture the sources in the
+            # default combo
+            return self._tuple_list(self.__combo_sources[self.general_config.default_combo])
         else:
             raise ValueError(COMB_INVALIDINPUT_ERROR.format(combo_name))
 
-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56777): https://edk2.groups.io/g/devel/message/56777
Mute This Topic: https://groups.io/mt/72686761/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve state tracking when checking out pin files
Posted by Bjorge, Erik C 4 years ago
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Desimone, Ashley E
Sent: Tuesday, March 31, 2020 2:00 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-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve state tracking when checking out pin files

Improves the state tracking when checking out onto a pin file
by: (1)moving the call to write_current_combo() after the succesfull checkout, (2)changing the name of the combo written to the format:
'Pin: {pinfilename}', (3)If the current combo is a knon pin file (starts with 'Pin:') get_repo_sources() will return the repo sources from the default combo

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       | 2 +-
 edkrepo/commands/humble/checkout_pin_humble.py | 3 ++-
 edkrepo_manifest_parser/edk_manifest.py        | 4 ++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/edkrepo/commands/checkout_pin_command.py b/edkrepo/commands/checkout_pin_command.py
index a2afc41..619fcf8 100644
--- a/edkrepo/commands/checkout_pin_command.py
+++ b/edkrepo/commands/checkout_pin_command.py
@@ -53,7 +53,6 @@ class CheckoutPinCommand(EdkrepoCommand):
             origin = repo.remotes.origin
             origin.fetch()
         self.__pin_matches_project(pin, manifest, workspace_path)
-        manifest.write_current_combo(pin.general_config.current_combo)
         sparse_enabled = sparse_checkout_enabled(workspace_path, manifest_sources)
         if sparse_enabled:
             print(SPARSE_RESET)
@@ -61,6 +60,7 @@ class CheckoutPinCommand(EdkrepoCommand):
         pin_repo_sources = pin.get_repo_sources(pin.general_config.current_combo)
         try:
             checkout_repos(args.verbose, args.override, pin_repo_sources, workspace_path, manifest)
+
+ manifest.write_current_combo(humble.PIN_COMBO.format(args.pinfile))
         finally:
             if sparse_enabled:
                 print(SPARSE_CHECKOUT)
diff --git a/edkrepo/commands/humble/checkout_pin_humble.py b/edkrepo/commands/humble/checkout_pin_humble.py
index b5a9cfb..ac7467d 100644
--- a/edkrepo/commands/humble/checkout_pin_humble.py
+++ b/edkrepo/commands/humble/checkout_pin_humble.py
@@ -11,4 +11,5 @@ CHP_EXIT = 'Exiting without checkout out PIN data.'
 NOT_FOUND = 'The selected PIN file was not found.'
 MANIFEST_MISMATCH = ('The selected PIN file does not refer to the same project '
                      'as the local manifest file. {}'.format(CHP_EXIT)) -COMMIT_NOT_FOUND = 'The commit referenced by the PIN file does not exist. {}'.format(CHP_EXIT) \ No newline at end of file
+COMMIT_NOT_FOUND = 'The commit referenced by the PIN file does not 
+exist. {}'.format(CHP_EXIT) PIN_COMBO = 'Pin: {}'
\ No newline at end of file
diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_parser/edk_manifest.py
index dd3512b..2d3e79e 100644
--- a/edkrepo_manifest_parser/edk_manifest.py
+++ b/edkrepo_manifest_parser/edk_manifest.py
@@ -311,6 +311,10 @@ class ManifestXml(BaseXmlHelper):
     def get_repo_sources(self, combo_name):
         if combo_name in self.__combo_sources:
             return self._tuple_list(self.__combo_sources[combo_name])
+        elif combo_name.startswith('Pin:'):
+            # If currently checked out onto a pin file reture the sources in the
+            # default combo
+            return 
+ self._tuple_list(self.__combo_sources[self.general_config.default_comb
+ o])
         else:
             raise ValueError(COMB_INVALIDINPUT_ERROR.format(combo_name))
 
--
2.16.2.windows.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56796): https://edk2.groups.io/g/devel/message/56796
Mute This Topic: https://groups.io/mt/72686761/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve state tracking when checking out pin files
Posted by Nate DeSimone 4 years ago
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Desimone, Ashley E
Sent: Tuesday, March 31, 2020 2:00 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-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve state tracking when checking out pin files

Improves the state tracking when checking out onto a pin file
by: (1)moving the call to write_current_combo() after the succesfull checkout, (2)changing the name of the combo written to the format:
'Pin: {pinfilename}', (3)If the current combo is a knon pin file (starts with 'Pin:') get_repo_sources() will return the repo sources from the default combo

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       | 2 +-
 edkrepo/commands/humble/checkout_pin_humble.py | 3 ++-
 edkrepo_manifest_parser/edk_manifest.py        | 4 ++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/edkrepo/commands/checkout_pin_command.py b/edkrepo/commands/checkout_pin_command.py
index a2afc41..619fcf8 100644
--- a/edkrepo/commands/checkout_pin_command.py
+++ b/edkrepo/commands/checkout_pin_command.py
@@ -53,7 +53,6 @@ class CheckoutPinCommand(EdkrepoCommand):
             origin = repo.remotes.origin
             origin.fetch()
         self.__pin_matches_project(pin, manifest, workspace_path)
-        manifest.write_current_combo(pin.general_config.current_combo)
         sparse_enabled = sparse_checkout_enabled(workspace_path, manifest_sources)
         if sparse_enabled:
             print(SPARSE_RESET)
@@ -61,6 +60,7 @@ class CheckoutPinCommand(EdkrepoCommand):
         pin_repo_sources = pin.get_repo_sources(pin.general_config.current_combo)
         try:
             checkout_repos(args.verbose, args.override, pin_repo_sources, workspace_path, manifest)
+
+ manifest.write_current_combo(humble.PIN_COMBO.format(args.pinfile))
         finally:
             if sparse_enabled:
                 print(SPARSE_CHECKOUT)
diff --git a/edkrepo/commands/humble/checkout_pin_humble.py b/edkrepo/commands/humble/checkout_pin_humble.py
index b5a9cfb..ac7467d 100644
--- a/edkrepo/commands/humble/checkout_pin_humble.py
+++ b/edkrepo/commands/humble/checkout_pin_humble.py
@@ -11,4 +11,5 @@ CHP_EXIT = 'Exiting without checkout out PIN data.'
 NOT_FOUND = 'The selected PIN file was not found.'
 MANIFEST_MISMATCH = ('The selected PIN file does not refer to the same project '
                      'as the local manifest file. {}'.format(CHP_EXIT)) -COMMIT_NOT_FOUND = 'The commit referenced by the PIN file does not exist. {}'.format(CHP_EXIT) \ No newline at end of file
+COMMIT_NOT_FOUND = 'The commit referenced by the PIN file does not 
+exist. {}'.format(CHP_EXIT) PIN_COMBO = 'Pin: {}'
\ No newline at end of file
diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_parser/edk_manifest.py
index dd3512b..2d3e79e 100644
--- a/edkrepo_manifest_parser/edk_manifest.py
+++ b/edkrepo_manifest_parser/edk_manifest.py
@@ -311,6 +311,10 @@ class ManifestXml(BaseXmlHelper):
     def get_repo_sources(self, combo_name):
         if combo_name in self.__combo_sources:
             return self._tuple_list(self.__combo_sources[combo_name])
+        elif combo_name.startswith('Pin:'):
+            # If currently checked out onto a pin file reture the sources in the
+            # default combo
+            return 
+ self._tuple_list(self.__combo_sources[self.general_config.default_comb
+ o])
         else:
             raise ValueError(COMB_INVALIDINPUT_ERROR.format(combo_name))
 
--
2.16.2.windows.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56883): https://edk2.groups.io/g/devel/message/56883
Mute This Topic: https://groups.io/mt/72686761/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve state tracking when checking out pin files
Posted by Nate DeSimone 4 years ago
Pushed: https://github.com/tianocore/edk2-staging/commit/e5d9630e

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Desimone, Ashley E
Sent: Tuesday, March 31, 2020 2:00 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-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve state tracking when checking out pin files

Improves the state tracking when checking out onto a pin file
by: (1)moving the call to write_current_combo() after the succesfull checkout, (2)changing the name of the combo written to the format:
'Pin: {pinfilename}', (3)If the current combo is a knon pin file (starts with 'Pin:') get_repo_sources() will return the repo sources from the default combo

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       | 2 +-
 edkrepo/commands/humble/checkout_pin_humble.py | 3 ++-
 edkrepo_manifest_parser/edk_manifest.py        | 4 ++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/edkrepo/commands/checkout_pin_command.py b/edkrepo/commands/checkout_pin_command.py
index a2afc41..619fcf8 100644
--- a/edkrepo/commands/checkout_pin_command.py
+++ b/edkrepo/commands/checkout_pin_command.py
@@ -53,7 +53,6 @@ class CheckoutPinCommand(EdkrepoCommand):
             origin = repo.remotes.origin
             origin.fetch()
         self.__pin_matches_project(pin, manifest, workspace_path)
-        manifest.write_current_combo(pin.general_config.current_combo)
         sparse_enabled = sparse_checkout_enabled(workspace_path, manifest_sources)
         if sparse_enabled:
             print(SPARSE_RESET)
@@ -61,6 +60,7 @@ class CheckoutPinCommand(EdkrepoCommand):
         pin_repo_sources = pin.get_repo_sources(pin.general_config.current_combo)
         try:
             checkout_repos(args.verbose, args.override, pin_repo_sources, workspace_path, manifest)
+
+ manifest.write_current_combo(humble.PIN_COMBO.format(args.pinfile))
         finally:
             if sparse_enabled:
                 print(SPARSE_CHECKOUT)
diff --git a/edkrepo/commands/humble/checkout_pin_humble.py b/edkrepo/commands/humble/checkout_pin_humble.py
index b5a9cfb..ac7467d 100644
--- a/edkrepo/commands/humble/checkout_pin_humble.py
+++ b/edkrepo/commands/humble/checkout_pin_humble.py
@@ -11,4 +11,5 @@ CHP_EXIT = 'Exiting without checkout out PIN data.'
 NOT_FOUND = 'The selected PIN file was not found.'
 MANIFEST_MISMATCH = ('The selected PIN file does not refer to the same project '
                      'as the local manifest file. {}'.format(CHP_EXIT)) -COMMIT_NOT_FOUND = 'The commit referenced by the PIN file does not exist. {}'.format(CHP_EXIT) \ No newline at end of file
+COMMIT_NOT_FOUND = 'The commit referenced by the PIN file does not 
+exist. {}'.format(CHP_EXIT) PIN_COMBO = 'Pin: {}'
\ No newline at end of file
diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_parser/edk_manifest.py
index dd3512b..2d3e79e 100644
--- a/edkrepo_manifest_parser/edk_manifest.py
+++ b/edkrepo_manifest_parser/edk_manifest.py
@@ -311,6 +311,10 @@ class ManifestXml(BaseXmlHelper):
     def get_repo_sources(self, combo_name):
         if combo_name in self.__combo_sources:
             return self._tuple_list(self.__combo_sources[combo_name])
+        elif combo_name.startswith('Pin:'):
+            # If currently checked out onto a pin file reture the sources in the
+            # default combo
+            return 
+ self._tuple_list(self.__combo_sources[self.general_config.default_comb
+ o])
         else:
             raise ValueError(COMB_INVALIDINPUT_ERROR.format(combo_name))
 
--
2.16.2.windows.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56955): https://edk2.groups.io/g/devel/message/56955
Mute This Topic: https://groups.io/mt/72686761/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-