Package gbp :: Package scripts :: Module create_remote_repo
[hide private]
[frames] | no frames]

Module create_remote_repo

Create a remote Git repository based on the current one

Functions [hide private]
 
print_config(remote, branches)
Print out the git config to push to the newly created repo.
 
parse_url(remote_url, name, pkg, template_dir=None, bare=True)
Sanity check our remote URL
 
build_remote_script(remote, branch)
Create the script that will be run on the remote side
 
build_cmd(remote)
Build the command we pass the script to
 
read_yn()
 
setup_branch_tracking(repo, remote, branches)
 
push_branches(remote, branches)
 
build_parser(name, sections=[])
 
parse_args(argv, sections=[])
Parse the command line arguments and config files.
 
main(argv)
Variables [hide private]
  __package__ = 'gbp.scripts'
Function Details [hide private]

print_config(remote, branches)

 

Print out the git config to push to the newly created repo.

>>> print_config({'name': 'name', 'url': 'url'}, ['foo', 'bar'])
[remote "name"]
        url = url
        fetch = +refs/heads/*:refs/remotes/name/*
        push = foo
        push = bar
[branch "foo"]
        remote = name
        merge = refs/heads/foo
[branch "bar"]
        remote = name
        merge = refs/heads/bar

build_cmd(remote)

 

Build the command we pass the script to

>>> build_cmd({'scheme': ''})
['sh']
>>> build_cmd({'scheme': 'ssh', 'host': 'host', 'port': 80})
['ssh', '-p', 80, 'host', 'sh']

parse_args(argv, sections=[])

 

Parse the command line arguments and config files.

Parameters:
  • argv (list of str) - the command line arguments
  • sections (list of str) - additional sections to add to the config file parser besides the command name