[edk2-devel][edk2-staging/EdkRepo][PATCH v2 6/8] EdkRepo: Argument Strings Refactor - Sync Command

Nate DeSimone nathaniel.l.desimone at intel.com
Wed Nov 6 22:44:32 UTC 2019


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

-----Original Message-----
From: Desimone, Ashley E <ashley.e.desimone at intel.com> 
Sent: Wednesday, November 6, 2019 2:40 PM
To: devel at edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone at intel.com>; Pandya, Puja <puja.pandya at intel.com>
Subject: [edk2-devel][edk2-staging/EdkRepo][PATCH v2 6/8] EdkRepo: Argument Strings Refactor - Sync Command

Move all argument strings for sync_command.py to edkrepo/commands/arguments/sparse_args.py

Signed-off-by: Ashley E Desimone <ashley.e.desimone at intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Cc: Puja Pandya <puja.pandya at intel.com>
---
 edkrepo/commands/arguments/sync_args.py | 17 +++++++++++++++++
 edkrepo/commands/sync_command.py        | 13 +++++--------
 edkrepo/common/argument_strings.py      |  8 --------
 3 files changed, 22 insertions(+), 16 deletions(-)  create mode 100644 edkrepo/commands/arguments/sync_args.py

diff --git a/edkrepo/commands/arguments/sync_args.py b/edkrepo/commands/arguments/sync_args.py
new file mode 100644
index 0000000..9961f85
--- /dev/null
+++ b/edkrepo/commands/arguments/sync_args.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+#
+## @file
+# sync_args.py
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> # 
+SPDX-License-Identifier: BSD-2-Clause-Patent #
+
+''' Contains the help and description strings for arguments in the sync 
+command meta data.
+'''
+
+COMMAND_DESCRIPTION = 'Updates the local copy of the current combination\'s target branches by pulling the latest changes from the server. Does not update local branches.'
+FETCH_HELP = 'Performs a fetch only sync, no changes will be made to the local workspace.'
+UPDATE_LOCAL_MANIFEST_HELP = 'Updates the local copy of the project manifest file prior to performing sync operations.'
+OVERRIDE_HELP = 'Ignore warnings and proceed with sync operations.'
\ No newline at end of file
diff --git a/edkrepo/commands/sync_command.py b/edkrepo/commands/sync_command.py
index 13f0536..8509bce 100644
--- a/edkrepo/commands/sync_command.py
+++ b/edkrepo/commands/sync_command.py
@@ -19,11 +19,10 @@ from git import Repo  # Our modules  from edkrepo.commands.edkrepo_command import EdkrepoCommand  from edkrepo.commands.edkrepo_command import DryRunArgument, SubmoduleSkipArgument
+import edkrepo.commands.arguments.sync_args as arguments
 from edkrepo.common.progress_handler import GitProgressHandler  from edkrepo.common.edkrepo_exception import EdkrepoUncommitedChangesException, EdkrepoManifestNotFoundException  from edkrepo.common.edkrepo_exception import EdkrepoManifestChangedException -from edkrepo.common.argument_strings import SYNC_COMMAND_DESCRIPTION, FETCH_DESCRIPTION, FETCH_HELP, SYNC_OVERRIDE_HELP -from edkrepo.common.argument_strings import UPDATE_LOCAL_MANIFEST_HELP, UPDATE_LOCAL_MANIFEST_DESCRIPTION  from edkrepo.common.humble import SYNC_UNCOMMITED_CHANGES, SYNC_MANIFEST_NOT_FOUND, SYNC_URL_CHANGE, SYNC_COMBO_CHANGE  from edkrepo.common.humble import SYNC_SOURCE_MOVE_WARNING, SYNC_REMOVE_WARNING, SYNC_REMOVE_LIST_END_FORMATTING  from edkrepo.common.humble import SYNC_MANIFEST_DIFF_WARNING, SYNC_MANIFEST_UPDATE @@ -54,24 +53,22 @@ class SyncCommand(EdkrepoCommand):
     def get_metadata(self):
         metadata = {}
         metadata['name'] = 'sync'
-        metadata['help-text'] = SYNC_COMMAND_DESCRIPTION
+        metadata['help-text'] = arguments.COMMAND_DESCRIPTION
         args = []
         metadata['arguments'] = args
         args.append({'name' : 'fetch',
                      'positional' : False,
                      'required' : False,
-                     'description': FETCH_DESCRIPTION,
-                     'help-text' : FETCH_HELP})
+                     'help-text': arguments.FETCH_HELP})
         args.append({'name' : 'update-local-manifest',
                      'short-name': 'u',
                      'required' : False,
-                     'description' : UPDATE_LOCAL_MANIFEST_DESCRIPTION,
-                     'help-text' : UPDATE_LOCAL_MANIFEST_HELP})
+                     'help-text' : 
+ arguments.UPDATE_LOCAL_MANIFEST_HELP})
         args.append({'name' : 'override',
                      'short-name': 'o',
                      'positional' : False,
                      'required' : False,
-                     'help-text' : SYNC_OVERRIDE_HELP})
+                     'help-text' : arguments.OVERRIDE_HELP})
         args.append(SubmoduleSkipArgument)
         return metadata
 
diff --git a/edkrepo/common/argument_strings.py b/edkrepo/common/argument_strings.py
index 50e25ee..b001441 100644
--- a/edkrepo/common/argument_strings.py
+++ b/edkrepo/common/argument_strings.py
@@ -33,11 +33,3 @@ SPARSE_HELP = 'Enables a sparse checkout based on the contents of the DSC file(s  NO_SPARSE_DESCRIPTION = 'Disables sparse checkout support.'
 NO_SPARSE_HELP = 'Disables sparse checkout if enabled by default in the manifest.\n'
 
-#Args for sync_command.py
-SYNC_COMMAND_DESCRIPTION = 'Updates the local copy of the current combination\'s target branches with the latest changes from the server. Does not update local branches.'
-FETCH_DESCRIPTION = 'Downloads the changes from the remote server to the local workspace with out performing a merge'
-FETCH_HELP = 'Performs a fetch only sync, no changes will be made to the local workspace'
-UPDATE_LOCAL_MANIFEST_DESCRIPTION = 'Updates the global manifest repository and local manifest file prior to performing a sync'
-UPDATE_LOCAL_MANIFEST_HELP = 'Updates the local manifest file found in the <workspace>/repo directory prior to performing sync operations.'
-SYNC_OVERRIDE_HELP = 'Without this flag sync operations will not be completed if the updated manifest adds/removes repositories or if there are local commits on the target branch.'
-
--
2.16.2.windows.1


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

View/Reply Online (#50097): https://edk2.groups.io/g/devel/message/50097
Mute This Topic: https://groups.io/mt/44653263/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list