From: "Ashley E Desimone" <ashley.e.desimone@intel.com>
To: devel@edk2.groups.io
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>,
Puja Pandya <puja.pandya@intel.com>,
Erik Bjorge <erik.c.bjorge@intel.com>,
Bret Barkelew <Bret.Barkelew@microsoft.com>,
Prince Agyeman <prince.agyeman@intel.com>
Subject: [edk2-staging/EdkRepo] [PATCH 1/2] EdkRepo: Remove duplicate definition of generate_name_for_obsolete_backup
Date: Fri, 1 May 2020 13:39:45 -0700 [thread overview]
Message-ID: <20200501203946.17620-2-ashley.e.desimone@intel.com> (raw)
In-Reply-To: <20200501203946.17620-1-ashley.e.desimone@intel.com>
Remove the duplicate definition of generate_name_for_obsolete_backup from
common_repo_functions.py and update imports to use the definition in
workspace_maintenance.py
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/sync_command.py | 3 ++-
edkrepo/common/common_repo_functions.py | 21 ---------------------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/edkrepo/commands/sync_command.py b/edkrepo/commands/sync_command.py
index cb9dc4b..82f5247 100644
--- a/edkrepo/commands/sync_command.py
+++ b/edkrepo/commands/sync_command.py
@@ -34,12 +34,13 @@ from edkrepo.common.humble import SYNC_REBASE_CALC_FAIL
from edkrepo.common.pathfix import get_actual_path
from edkrepo.common.common_repo_functions import pull_latest_manifest_repo, clone_repos, sparse_checkout_enabled
from edkrepo.common.common_repo_functions import reset_sparse_checkout, sparse_checkout, verify_manifest_data
-from edkrepo.common.common_repo_functions import generate_name_for_obsolete_backup, checkout_repos, check_dirty_repos
+from edkrepo.common.common_repo_functions import checkout_repos, check_dirty_repos
from edkrepo.common.common_repo_functions import update_editor_config
from edkrepo.common.common_repo_functions import update_repo_commit_template, get_latest_sha
from edkrepo.common.common_repo_functions import has_primary_repo_remote, fetch_from_primary_repo, in_sync_with_primary
from edkrepo.common.common_repo_functions import update_hooks, maintain_submodules, combinations_in_manifest
from edkrepo.common.common_repo_functions import write_included_config, remove_included_config
+from edkrepo.common.workspace_maintenance.workspace_maintenance import generate_name_for_obsolete_backup
from edkrepo.common.ui_functions import init_color_console
from edkrepo.config.config_factory import get_workspace_path, get_workspace_manifest, get_edkrepo_global_data_directory
from edkrepo_manifest_parser.edk_manifest import CiIndexXml, ManifestXml
diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/common_repo_functions.py
index 2aa5f5f..a333489 100644
--- a/edkrepo/common/common_repo_functions.py
+++ b/edkrepo/common/common_repo_functions.py
@@ -393,27 +393,6 @@ def checkout_repos(verbose, override, repos_to_checkout, workspace_path, manifes
if repo_to_checkout.enable_submodule:
maintain_submodules(repo_to_checkout, repo, verbose)
-
-
-def generate_name_for_obsolete_backup(absolute_path):
- if not os.path.exists(absolute_path):
- raise ValueError("{} does not exist".format(absolute_path))
- original_name = os.path.basename(absolute_path)
- dir_name = os.path.dirname(absolute_path)
- unique_name = ""
- unique_name_found = False
- index = 1
- while not unique_name_found:
- if index == 1:
- unique_name = "{}_old".format(original_name)
- else:
- unique_name = "{}_old{}".format(original_name, index)
- if not os.path.exists(os.path.join(dir_name, unique_name)):
- unique_name_found = True
- index += 1
- return unique_name
-
-
def verify_manifest_data(global_manifest_directory, config, verbose=False, verify_all=False, verify_proj=None, verify_archived=False):
# Validate the project individual project selected
if verify_proj:
--
2.16.2.windows.1
next prev parent reply other threads:[~2020-05-01 20:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-01 20:39 [edk2-staging/EdkRepo] [PATCH 0/2] EdkRepo: Remove duplicate function definitions Ashley E Desimone
2020-05-01 20:39 ` Ashley E Desimone [this message]
2020-05-01 20:39 ` [edk2-staging/EdkRepo] [PATCH 2/2] EdkRepo: Remove duplicate definitions of case_insensitive_single_match and case_insensitive_equal Ashley E Desimone
2020-05-05 7:41 ` [edk2-staging/EdkRepo] [PATCH 0/2] EdkRepo: Remove duplicate function definitions Nate DeSimone
2020-05-05 8:06 ` Nate DeSimone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200501203946.17620-2-ashley.e.desimone@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox