def process(args): # XXX: only supports 'origin' remote at present clone = phlsys_git.GitClone('.') _fetch_log(clone, args.update, args.no_update, args.prompt_update) log = abdt_landinglog.get_log(clone) log_dict = {i.review_sha1: (i.name, i.landed_sha1) for i in log} local_branches = phlgit_branch.get_local_with_sha1(clone) if args.force: did_something = _prune_branches( clone, args, prune_force, log_dict, local_branches) if not did_something: print "nothing to do." else: print "done." else: assert args.interactive would_do_something = _prune_branches( clone, args, prune_dryrun, log_dict, local_branches) if not would_do_something: print "nothing to do." else: choice = phlsys_choice.yes_or_no("perform the pruning?", 'no') print if choice: _prune_branches( clone, args, prune_force, log_dict, local_branches) print "done." else: print "stopped."
def process(args): # XXX: only supports 'origin' remote at present print """ ::DEPRECATION NOTICE:: the 'refs/arcyd/landinglog' ref is no longer being updated, for new branches do: git fetch origin refs/arcyd/landed:refs/arcyd/landed git branch --merged refs/arcyd/landed | grep -v '*' | xargs git branch -D """.strip() print repo = phlsys_git.Repo('.') _fetch_log(repo, args.update, args.no_update, args.prompt_update) log = abdt_landinglog.get_log(repo) log_dict = {i.review_sha1: (i.name, i.landed_sha1) for i in log} local_branches = phlgit_branch.get_local_with_sha1(repo) if args.force: did_something = _prune_branches( repo, args, prune_force, log_dict, local_branches) if not did_something: print "nothing to do." else: print "done." else: assert args.interactive would_do_something = _prune_branches( repo, args, prune_dryrun, log_dict, local_branches) if not would_do_something: print "nothing to do." else: choice = phlsys_choice.yes_or_no("perform the pruning?", 'no') print if choice: _prune_branches( repo, args, prune_force, log_dict, local_branches) print "done." else: print "stopped."
def process(args): # XXX: only supports 'origin' remote at present print(""" ::DEPRECATION NOTICE:: the 'refs/arcyd/landinglog' ref is no longer being updated, for new branches do: git fetch origin refs/arcyd/landed:refs/arcyd/landed git branch --merged refs/arcyd/landed | grep -v '*' | xargs git branch -D """.strip()) print() repo = phlsys_git.Repo('.') _fetch_log(repo, args.update, args.no_update, args.prompt_update) log = abdt_landinglog.get_log(repo) log_dict = {i.review_sha1: (i.name, i.landed_sha1) for i in log} local_branches = phlgit_branch.get_local_with_sha1(repo) if args.force: did_something = _prune_branches( repo, args, prune_force, log_dict, local_branches) if not did_something: print("nothing to do.") else: print("done.") else: assert args.interactive would_do_something = _prune_branches( repo, args, prune_dryrun, log_dict, local_branches) if not would_do_something: print("nothing to do.") else: choice = phlsys_choice.yes_or_no("perform the pruning?", 'no') print() if choice: _prune_branches( repo, args, prune_force, log_dict, local_branches) print("done.") else: print("stopped.")