mirror of
https://github.com/openharmony/third_party_cryptsetup.git
synced 2026-07-19 11:53:07 -04:00
feat(config) add --global option
This commit is contained in:
+3
-1
@@ -1434,7 +1434,9 @@ class Project(object):
|
||||
namespace = self._GiteeNamespace()
|
||||
token = self.manifest.manifestProject.config.GetString('repo.token')
|
||||
if not token:
|
||||
raise PullRequestError('repo.token is None, Please set it before pushing, you need `repo config -h`')
|
||||
token = GitConfig.ForUser().GetString('repo.token')
|
||||
if not token:
|
||||
raise PullRequestError('repo.token is None, Please set it before pushing, you need `repo config -h`')
|
||||
post_url = gitee_url + namespace + '/' + self.name + '/' + 'pulls'
|
||||
pushurl = self.manifest.manifestProject.config.GetString('repo.pushurl')
|
||||
if not pushurl:
|
||||
|
||||
@@ -33,6 +33,9 @@ class Config(Command):
|
||||
p.add_option('--bool',
|
||||
dest='bool', action='store_true',
|
||||
help='git config will ensure that the output is "true" or "false"')
|
||||
p.add_option('--global',
|
||||
dest='Global', action='store_true',
|
||||
help='git config use global config file')
|
||||
|
||||
def Execute(self, opt, args):
|
||||
if not args:
|
||||
@@ -53,6 +56,9 @@ class Config(Command):
|
||||
if opt.bool:
|
||||
command.append('--bool')
|
||||
|
||||
if opt.Global:
|
||||
command.append('--global')
|
||||
|
||||
command.extend(args)
|
||||
|
||||
if GitCommand(mp, command).Wait() != 0:
|
||||
|
||||
+5
-3
@@ -17,6 +17,7 @@ import sys
|
||||
import requests
|
||||
import json
|
||||
from command import Command
|
||||
from git_config import GitConfig
|
||||
from git_command import GitCommand
|
||||
from error import GitError
|
||||
|
||||
@@ -64,10 +65,11 @@ class GiteePr(Command):
|
||||
sys.exit(1)
|
||||
name_space = project._GiteeNamespace()
|
||||
token = self.manifest.manifestProject.config.GetString('repo.token')
|
||||
|
||||
if not token:
|
||||
sys.stderr.write('repo.token is None, Please set it, you need `repo config -h`\n')
|
||||
sys.exit(1)
|
||||
token = GitConfig.ForUser().GetString('repo.token')
|
||||
if not token:
|
||||
sys.stderr.write('repo.token is None, Please set it, you need `repo config -h`\n')
|
||||
sys.exit(1)
|
||||
p_list = {'project_name': project_name, 'base': base_branch, 'head': branch_name}
|
||||
url = 'https://gitee.com/api/v5/repos/%s/%s/pulls' % (name_space, project_name)
|
||||
payload = {'base': base_branch, 'head': branch_name, 'page': 0, 'access_token': token, 'state': 'open'}
|
||||
|
||||
Reference in New Issue
Block a user