From 26dce1d6ef83294c184fc513232130dbbd8f19dc Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 18 Jun 2015 16:56:51 +0100 Subject: Determine whether to include_local_changes from app.settings Previously callers to DefinitionsRepoWithApp.source_pool() could override the user's value, but that's not actually used anywhere. Change-Id: I43b53e7b9fc937886c8e6e95947e5e2b6776d085 --- morphlib/definitions_repo.py | 6 +++--- morphlib/plugins/build_plugin.py | 4 +--- morphlib/plugins/deploy_plugin.py | 4 +--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/morphlib/definitions_repo.py b/morphlib/definitions_repo.py index 07c2dbb6..24b88a7e 100644 --- a/morphlib/definitions_repo.py +++ b/morphlib/definitions_repo.py @@ -325,14 +325,14 @@ class DefinitionsRepoWithApp(DefinitionsRepo): git_user_email=self._git_user_email, status_cb=self.app.status,) - def source_pool(self, ref, system_filename, - include_local_changes=False): + def source_pool(self, ref, system_filename): '''Equivalent to DefinitionsRepo.source_pool().''' + local_changes = self.app.settings['local-changes'] return DefinitionsRepo.source_pool( self, self._lrc, self._rrc, self.app.settings['cachedir'], ref, system_filename, - include_local_changes=include_local_changes, + include_local_changes=(local_changes == 'include'), push_local_changes=self.app.settings['push-build-branches'], build_ref_prefix=self.app.settings['build-ref-prefix'], git_user_name=self._git_user_name, diff --git a/morphlib/plugins/build_plugin.py b/morphlib/plugins/build_plugin.py index c1fa64a7..0e695691 100644 --- a/morphlib/plugins/build_plugin.py +++ b/morphlib/plugins/build_plugin.py @@ -286,10 +286,8 @@ class BuildPlugin(cliapp.Plugin): self.app.settings['cachedir'], self.app.settings['cachedir-min-space']) - local_changes = self.app.settings['local-changes'] source_pool_context = definitions_repo.source_pool( - definitions_repo.HEAD, filename, - include_local_changes=(local_changes == 'include')) + definitions_repo.HEAD, filename) with source_pool_context as source_pool: self._build(source_pool, filename, component_names=component_names) diff --git a/morphlib/plugins/deploy_plugin.py b/morphlib/plugins/deploy_plugin.py index d3c61bf0..89b88373 100644 --- a/morphlib/plugins/deploy_plugin.py +++ b/morphlib/plugins/deploy_plugin.py @@ -452,12 +452,10 @@ class DeployPlugin(cliapp.Plugin): # temporary branch, for each system and subsystem being deployed. # We could do a much better job if a source pool could contain # multiple systems of different architectures. - include_local_changes = (self.app.settings['local-changes']=='include') morph = morphlib.util.sanitise_morphology_path(system['morph']) source_pool_context = definitions_repo.source_pool( - definitions_repo.HEAD, morph, - include_local_changes=include_local_changes) + definitions_repo.HEAD, morph) with source_pool_context as source_pool: self.deploy_system_with_source_pool( deploy_tempdir, definitions_repo, source_pool, system, -- cgit v1.2.1