From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web12.10573.1583800553234918099 for ; Mon, 09 Mar 2020 17:35:53 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ashley.e.desimone@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2020 17:35:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,535,1574150400"; d="scan'208";a="245517658" Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga006.jf.intel.com with ESMTP; 09 Mar 2020 17:35:52 -0700 From: "Desimone, Ashley E" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Correct when a sparse reset is triggered during checkout Date: Mon, 9 Mar 2020 17:35:49 -0700 Message-Id: <20200310003549.6552-1-ashley.e.desimone@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 Correct an error case in the checkout function defined in: common/common_repo_functions.py where the need to perform a sparse reset was not correctly calculated. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge --- edkrepo/common/common_repo_functions.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/common_repo_functions.py index d857d09..b9c28e6 100644 --- a/edkrepo/common/common_repo_functions.py +++ b/edkrepo/common/common_repo_functions.py @@ -571,13 +571,22 @@ def checkout(combination_or_sha, verbose=False, override=False, log=None): # Disable sparse checkout current_repos = initial_repo_sources sparse_enabled = sparse_checkout_enabled(workspace_path, initial_repo_sources) + sparse_diff = False + for source in initial_repo_sources: + for src in repo_sources: + if source.root == src.root: + if source.sparse != src.sparse: + sparse_diff = True + if sparse_diff: + break # Sparse checkout only needs to be recomputed if # the dynamic sparse list is being used instead of the static sparse list + # or the sparse settings between two combinations differ if sparse_enabled: sparse_settings = manifest.sparse_settings if sparse_settings is not None: sparse_enabled = False - if sparse_enabled: + if sparse_enabled or sparse_diff: print(SPARSE_RESET) reset_sparse_checkout(workspace_path, current_repos) @@ -595,7 +604,7 @@ def checkout(combination_or_sha, verbose=False, override=False, log=None): # Return to the initial combo, since there was an issue with cheking out the selected combo checkout_repos(verbose, override, initial_repo_sources, workspace_path, manifest) finally: - if sparse_enabled: + if sparse_enabled or sparse_diff: print(SPARSE_CHECKOUT) sparse_checkout(workspace_path, current_repos, manifest) -- 2.16.2.windows.1