|
|
@ -155,6 +155,7 @@ if __name__ == '__main__':
|
|
|
|
parser.add_argument('-Q', '--query', help='pick all commits using the specified query')
|
|
|
|
parser.add_argument('-Q', '--query', help='pick all commits using the specified query')
|
|
|
|
parser.add_argument('-g', '--gerrit', default=default_gerrit, help='Gerrit Instance to use. Form proto://[user@]host[:port]')
|
|
|
|
parser.add_argument('-g', '--gerrit', default=default_gerrit, help='Gerrit Instance to use. Form proto://[user@]host[:port]')
|
|
|
|
parser.add_argument('-e', '--exclude', nargs=1, help='exclude a list of commit numbers separated by a ,')
|
|
|
|
parser.add_argument('-e', '--exclude', nargs=1, help='exclude a list of commit numbers separated by a ,')
|
|
|
|
|
|
|
|
parser.add_argument('-c', '--check-picked', type=int, default=10, help='pass the amount of commits to check for already picked changes')
|
|
|
|
args = parser.parse_args()
|
|
|
|
args = parser.parse_args()
|
|
|
|
if not args.start_branch and args.abandon_first:
|
|
|
|
if not args.start_branch and args.abandon_first:
|
|
|
|
parser.error('if --abandon-first is set, you must also give the branch name with --start-branch')
|
|
|
|
parser.error('if --abandon-first is set, you must also give the branch name with --start-branch')
|
|
|
@ -326,7 +327,7 @@ if __name__ == '__main__':
|
|
|
|
subprocess.check_output(['repo', 'start', args.start_branch[0], project_path])
|
|
|
|
subprocess.check_output(['repo', 'start', args.start_branch[0], project_path])
|
|
|
|
|
|
|
|
|
|
|
|
# Determine the maximum commits to check already picked changes
|
|
|
|
# Determine the maximum commits to check already picked changes
|
|
|
|
check_picked_count = 10
|
|
|
|
check_picked_count = args.check_picked
|
|
|
|
branch_commits_count = int(subprocess.check_output(['git', 'rev-list', '--count', 'HEAD'], cwd=project_path))
|
|
|
|
branch_commits_count = int(subprocess.check_output(['git', 'rev-list', '--count', 'HEAD'], cwd=project_path))
|
|
|
|
if branch_commits_count <= check_picked_count:
|
|
|
|
if branch_commits_count <= check_picked_count:
|
|
|
|
check_picked_count = branch_commits_count - 1
|
|
|
|
check_picked_count = branch_commits_count - 1
|
|
|
|