From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com []) by mx.groups.io with SMTP id smtpd.web10.83.1573079992831490407 for ; Wed, 06 Nov 2019 14:39:53 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: ashley.e.desimone@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 14:39:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,275,1569308400"; d="scan'208";a="205481887" Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga003.jf.intel.com with ESMTP; 06 Nov 2019 14:39:51 -0800 From: "Desimone, Ashley E" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya Subject: [edk2-devel][edk2-staging/EdkRepo][PATCH v2 6/8] EdkRepo: Argument Strings Refactor - Sync Command Date: Wed, 6 Nov 2019 14:39:42 -0800 Message-Id: <20191106223944.18036-6-ashley.e.desimone@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20191106223944.18036-1-ashley.e.desimone@intel.com> References: <20191106223944.18036-1-ashley.e.desimone@intel.com> Move all argument strings for sync_command.py to edkrepo/commands/arguments/sparse_args.py Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya --- 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.
+# 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 /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