From ee0bd3bf869038474cab58a063988eb64a886fac Mon Sep 17 00:00:00 2001 From: mprahl Date: Mar 26 2018 13:14:22 +0000 Subject: Support local module builds when there are uncommitted changes Signed-off-by: mprahl --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 74cdbfc..2b0e4cc 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -2797,17 +2797,19 @@ class Commands(object): state_names[None] = 'undefined' return state_names - def module_get_scm_info(self, scm_url=None, branch=None): + def module_get_scm_info(self, scm_url=None, branch=None, check_repo=True): """ Determines the proper SCM URL and branch based on the arguments. If the user doesn't specify an SCM URL and branch, then the git repo the user is currently in is used instead. :kwarg scm_url: a string of the module's SCM URL :kwarg branch: a string of the module's branch + :kwarg check_repo: a boolean that determines if check_repo should be + run when an scm_url is not provided. :return: a tuple containing a string of the SCM URL and a string of the branch """ - if not scm_url: + if not scm_url and check_repo: # Make sure the local repo is clean (no unpushed changes) if the # user didn't specify an SCM URL self.check_repo() diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index b165e64..8d4894a 100644 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -1484,7 +1484,7 @@ see API KEY section of copr-cli(1) man page. self.module_validate_config() if not self.args.stream: - _, stream = self.cmd.module_get_scm_info() + _, stream = self.cmd.module_get_scm_info(check_repo=False) else: stream = self.args.stream