diff options
author | Aric Gardner <agardner@linuxfoundation.org> | 2018-09-12 14:12:51 -0400 |
---|---|---|
committer | Trevor Bramwell <tbramwell@linuxfoundation.org> | 2018-09-18 15:47:17 -0700 |
commit | c0c6f23c2c494cefa01398f6c18e95af4c801d1a (patch) | |
tree | a4bb9d5684146dc4151442ccc6b2c5adfcf533c4 /releases/scripts/repos.py | |
parent | 0ee36b71b34afa6f54415a8ed7bcd25222591a4e (diff) |
Create branches via ssh rather than the https
Previously we created the branches over Gerrit's HTTPS interface. One or
two projects from the previous release did not have their stable
branches created at the correct place.
Switch to using ssh for branch creation will be more reliable and easier
for us to verify.
Change-Id: If7f24d2b19e74513b59889bd64d25919aa048e4c
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Diffstat (limited to 'releases/scripts/repos.py')
-rw-r--r-- | releases/scripts/repos.py | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/releases/scripts/repos.py b/releases/scripts/repos.py index 47ce42d88..91c4e9300 100644 --- a/releases/scripts/repos.py +++ b/releases/scripts/repos.py @@ -63,20 +63,28 @@ def main(): type=str, help="Only print" "SHAs for the specified release") + parser.add_argument('--branches', '-b', + action='store_true', + default=False, + help="Print Branch info") + args = parser.parse_args() project = yaml.safe_load(args.file) - list_repos(project, args) + if args.branches: + list_branches(project, args) + else: + list_repos(project, args) def list_repos(project, args): """List repositories in the project file""" lookup = project.get('releases', []) + if 'releases' not in project: exit(0) - repos = set() for item in lookup: repo, ref = next(iter(item['location'].items())) @@ -90,5 +98,24 @@ def list_repos(project, args): print(repo) +def list_branches(project, args): + """List branches in the project file""" + + lookup = project.get('branches', []) + + if 'branches' not in project: + exit(0) + repos = set() + for item in lookup: + repo, ref = next(iter(item['location'].items())) + if args.names: + repos.add(Repo(repo)) + elif args.release and item['name'] == args.release: + repos.add(Repo(repo, ref)) + elif not args.release: + repos.add(Repo(repo, item['name'], ref)) + for repo in repos: + print(repo) + if __name__ == "__main__": main() |