From c0c6f23c2c494cefa01398f6c18e95af4c801d1a Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Wed, 12 Sep 2018 14:12:51 -0400 Subject: 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 Signed-off-by: Trevor Bramwell --- releases/scripts/repos.py | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'releases/scripts/repos.py') 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() -- cgit 1.2.3-korg