| |
@@ -323,16 +323,13 @@
|
| |
|
| |
def register_request_tests_repo(self):
|
| |
help_msg = 'Request a new tests dist-git repository'
|
| |
- pagure_section = '{0}.pagure'.format(self.name)
|
| |
- pagure_url = config_get_safely(self.config, pagure_section, 'url')
|
| |
- pagure_url_parsed = urlparse(pagure_url).netloc
|
| |
anongiturl = self.config.get(
|
| |
self.name, 'anongiturl', vars={'repo': 'any', 'module': 'any'}
|
| |
)
|
| |
description = textwrap.dedent('''
|
| |
Request a new dist-git repository in tests shared namespace
|
| |
|
| |
- {2}/projects/tests/*
|
| |
+ {1}/projects/tests/*
|
| |
|
| |
For more information about tests shared namespace see
|
| |
|
| |
@@ -348,7 +345,7 @@
|
| |
|
| |
Note that the space name needs to reflect the intent of the tests and will
|
| |
undergo a manual review.
|
| |
- '''.format(self.name, pagure_url_parsed, get_dist_git_url(anongiturl)))
|
| |
+ '''.format(self.name, get_dist_git_url(anongiturl)))
|
| |
|
| |
request_tests_repo_parser = self.subparsers.add_parser(
|
| |
'request-tests-repo',
|
| |
@@ -415,7 +412,8 @@
|
| |
required=False,
|
| |
dest='repo_ns_for_branch',
|
| |
choices=self.get_distgit_namespaces(),
|
| |
- help='Repository name the new branch is requested for.'
|
| |
+ help=("Repository name the new branch is requested for. Requires "
|
| |
+ "filling the '--repo' argument")
|
| |
)
|
| |
request_branch_parser.add_argument(
|
| |
'--sl', nargs='*',
|
| |
@@ -439,6 +437,13 @@
|
| |
'--all-releases', default=False, action='store_true',
|
| |
help='Make a new branch request for every active Fedora release'
|
| |
)
|
| |
+ request_branch_parser.add_argument(
|
| |
+ '--without-playground', default=False, action='store_true',
|
| |
+ help=("In case of requesting 'epelX' branch (where X is >7), "
|
| |
+ "'epelX-playground' branch will not be automatically "
|
| |
+ "requested. Branch will be created in pdc; user has to "
|
| |
+ "create git branch manually afterwards.")
|
| |
+ )
|
| |
request_branch_parser.set_defaults(command=self.request_branch)
|
| |
|
| |
def register_do_fork(self):
|
| |
@@ -646,15 +651,15 @@
|
| |
# Target functions go here
|
| |
def _format_update_clog(self, clog):
|
| |
''' Format clog for the update template. '''
|
| |
- lines = [l for l in clog.split('\n') if l]
|
| |
+ lines = [ln for ln in clog.split('\n') if ln]
|
| |
if len(lines) == 0:
|
| |
return "- Rebuilt.", ""
|
| |
elif len(lines) == 1:
|
| |
return lines[0], ""
|
| |
log = ["# Changelog:"]
|
| |
log.append('# - ' + lines[0])
|
| |
- for l in lines[1:]:
|
| |
- log.append('# ' + l)
|
| |
+ for ln in lines[1:]:
|
| |
+ log.append('# ' + ln)
|
| |
log.append('#')
|
| |
return lines[0], "\n".join(log)
|
| |
|
| |
@@ -930,8 +935,10 @@
|
| |
active_branch=active_branch,
|
| |
repo_name=self.cmd.repo_name,
|
| |
ns=self.cmd.ns,
|
| |
- no_git_branch=self.args.no_git_branch,
|
| |
+ # 'without_playground' option also disables creating git branch
|
| |
+ no_git_branch=self.args.without_playground or self.args.no_git_branch,
|
| |
no_auto_module=self.args.no_auto_module,
|
| |
+ without_playground=self.args.without_playground,
|
| |
name=self.name,
|
| |
config=self.config,
|
| |
)
|
| |
@@ -939,7 +946,7 @@
|
| |
@staticmethod
|
| |
def _request_branch(service_levels, all_releases, branch, active_branch,
|
| |
repo_name, ns, no_git_branch, no_auto_module,
|
| |
- name, config):
|
| |
+ without_playground, name, config):
|
| |
""" Implementation of `request_branch`.
|
| |
|
| |
Submits a request for a new branch of a given dist-git repo.
|
| |
@@ -960,6 +967,8 @@
|
| |
:param no_auto_module: A boolean flag. If True, requests for
|
| |
non-standard branches should not automatically result in additional
|
| |
requests for matching modules.
|
| |
+ :param without_playground: A boolean flag. If True, 'epelX-playground'
|
| |
+ branch will not be requested together with epelX in SCM.
|
| |
:param name: A string representing which section of the config should be
|
| |
used. Typically the value of `self.name`.
|
| |
:param config: A dict containing the configuration, loaded from file.
|
| |
@@ -990,7 +999,8 @@
|
| |
# Check if the requested branch is an epel branch
|
| |
match = re.match(r'^epel(?P<epel_version>\d+)$', branch)
|
| |
if match:
|
| |
- epel_playground = True
|
| |
+ # do not request playground branch when without_playground is active
|
| |
+ epel_playground = not without_playground
|
| |
epel_version = int(match.groupdict()["epel_version"])
|
| |
|
| |
if is_epel(branch):
|
| |
@@ -1096,6 +1106,7 @@
|
| |
ns='modules',
|
| |
no_git_branch=no_git_branch,
|
| |
no_auto_module=True, # Avoid infinite recursion.
|
| |
+ without_playground=without_playground,
|
| |
name=name,
|
| |
config=config,
|
| |
)
|
| |
@@ -1241,8 +1252,8 @@
|
| |
server_url = self.config.get('{0}.pdc'.format(self.name), 'url')
|
| |
releases = get_release_branches(server_url)
|
| |
|
| |
- def _join(l):
|
| |
- return ' '.join(l)
|
| |
+ def _join(ln):
|
| |
+ return ' '.join(ln)
|
| |
|
| |
if self.args.show_epel_only:
|
| |
print(_join(releases['epel']))
|
| |
When 'fedpkg request-branch' requests for an 'epel8' (or higher),
Fedora SCM will create also 'epel8-playground' branch and place
initial commit containing 'package.cfg' into 'epel8'. This allows
avoiding the creation of the extra 'epel8-playground' branch
and the commit. New argument '--without-playground' was added.
JIRA: RHELCMP-589
Resolves: rhbz#1746314
Signed-off-by: Ondrej Nosek onosek@redhat.com