| |
@@ -20,12 +20,17 @@
|
| |
|
| |
from centpkg.utils import config_get_safely, do_add_remote, do_fork
|
| |
from pyrpkg.cli import cliClient
|
| |
+ from pyrpkg import rpkgError
|
| |
from six.moves.urllib_parse import urlparse
|
| |
|
| |
|
| |
+ _DEFAULT_API_BASE_URL = 'https://gitlab.com'
|
| |
+
|
| |
+
|
| |
class centpkgClient(cliClient):
|
| |
- def __init__(self, config, name=None):
|
| |
- self.DEFAULT_CLI_NAME = 'centpkg'
|
| |
+ def __init__(self, config, name='centpkg'):
|
| |
+ self.DEFAULT_CLI_NAME = name
|
| |
+
|
| |
super(centpkgClient, self).__init__(config, name)
|
| |
|
| |
self.setup_centos_subparsers()
|
| |
@@ -36,7 +41,11 @@
|
| |
def register_do_fork(self):
|
| |
help_msg = 'Create a new fork of the current repository'
|
| |
distgit_section = '{0}.distgit'.format(self.name)
|
| |
- distgit_api_base_url = config_get_safely(self.config, distgit_section, "apibaseurl")
|
| |
+ # uses default dist-git url in case section is not present
|
| |
+ try:
|
| |
+ distgit_api_base_url = config_get_safely(self.config, distgit_section, "apibaseurl")
|
| |
+ except rpkgError:
|
| |
+ distgit_api_base_url = _DEFAULT_API_BASE_URL
|
| |
description = textwrap.dedent('''
|
| |
Create a new fork of the current repository
|
| |
|
| |
@@ -115,17 +124,3 @@
|
| |
else:
|
| |
msg = "Remote with name '{0}' already exists."
|
| |
self.log.info(msg.format(self.cmd.user))
|
| |
-
|
| |
-
|
| |
- class centpkgClientSig(cliClient):
|
| |
- def __init__(self, config, name=None):
|
| |
- self.DEFAULT_CLI_NAME = 'centpkg-sig'
|
| |
- super(centpkgClientSig, self).__init__(config, name)
|
| |
-
|
| |
- self.setup_centos_subparsers()
|
| |
-
|
| |
- def setup_centos_subparsers(self):
|
| |
- self.register_parser()
|
| |
-
|
| |
- def register_parser(self):
|
| |
- pass
|
| |
Some minor changes in the CLI which loads config files based on progname which also allows the usage of symlinks to target different config files.
Changes
sig
bool flagsig
checks