Module gbp_create_remote_repo
[hide private]
[frames] | no frames]

Module gbp_create_remote_repo

Create a remote repo based on the current one

Functions [hide private]
 
print_config(remote, branches)
 
parse_remote(remote_url, name, pkg)
Sanity check our remote URL
 
read_yn()
 
setup_branch_tracking(remote, branches)
 
push_branches(remote, branches)
 
main(argv)
Variables [hide private]
  __package__ = None
hash(x)
Function Details [hide private]

parse_remote(remote_url, name, pkg)

 

Sanity check our remote URL

>>> parse_remote("ssh://host/path/%(pkg)s", "origin", "package")
{'name': 'origin', 'url': 'ssh://host/path/package', 'host': 'host', 'base': '', 'pkg': 'package', 'port': None, 'dir': '/path/package'}
>>> parse_remote("ssh://host:22/path/repo.git", "origin", "package")
{'name': 'origin', 'url': 'ssh://host:22/path/repo.git', 'host': 'host', 'base': '', 'pkg': 'package', 'port': '22', 'dir': '/path/repo.git'}
>>> parse_remote("ssh://host:22/~/path/%(pkg)s.git", "origin", "package")
{'name': 'origin', 'url': 'ssh://host:22/~/path/package.git', 'host': 'host', 'base': '~/', 'pkg': 'package', 'port': '22', 'dir': 'path/package.git'}
>>> parse_remote("ssh://host:22/~user/path/%(pkg)s.git", "origin", "package")
{'name': 'origin', 'url': 'ssh://host:22/~user/path/package.git', 'host': 'host', 'base': '~user/', 'pkg': 'package', 'port': '22', 'dir': 'path/package.git'}
>>> parse_remote("git://host/repo.git", "origin", "package")
Traceback (most recent call last):
    ...
GbpError: Remote URL must use ssh protocol.
>>> parse_remote("ssh://host/path/repo", "origin", "package")
Traceback (most recent call last):
    ...
GbpError: Remote URL needs to contain either a repository name or '%(pkg)s'
>>> parse_remote("ssh://host:asdf/path/%(pkg)s.git", "origin", "package")
Traceback (most recent call last):
    ...
GbpError: Remote URL contains invalid port.
>>> parse_remote("ssh://host/~us er/path/%(pkg)s.git", "origin", "package")
Traceback (most recent call last):
    ...
GbpError: Remote URL contains invalid ~username expansion.