Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df45e9fc authored by jrior001's avatar jrior001 Committed by Tom Powell
Browse files

repopick: skip abandoned commits

Change-Id: I7f203fc4f790bf26acce1112c5c24c703acd9326
parent 00cbe089
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ if __name__ == '__main__':
    parser.add_argument('-b', '--auto-branch', action='store_true', help='shortcut to "--start-branch auto --abandon-first --ignore-missing"')
    parser.add_argument('-q', '--quiet', action='store_true', help='print as little as possible')
    parser.add_argument('-v', '--verbose', action='store_true', help='print extra information to aid in debug')
    parser.add_argument('-f', '--force', action='store_true', help='force cherry pick even if commit has been merged')
    parser.add_argument('-f', '--force', action='store_true', help='force cherry pick even if change is closed')
    parser.add_argument('-p', '--pull', action='store_true', help='execute pull instead of cherry-pick')
    parser.add_argument('-t', '--topic', help='pick all commits from a specified topic')
    parser.add_argument('-Q', '--query', help='pick all commits using the specified query')
@@ -247,12 +247,12 @@ if __name__ == '__main__':

    for item in mergables:
        print('Applying change number {0}...'.format(item['id']))
        # Check if commit has already been merged and exit if it has, unless -f is specified
        if item['status'] == 'MERGED':
        # Check if change is open and exit if it's not, unless -f is specified
        if item['status'] != 'OPEN' and not args.query:
            if args.force:
                print('!! Force-picking a merged commit !!\n')
                print('!! Force-picking a closed change !!\n')
            else:
                print('Commit already merged. Skipping the cherry pick.\nUse -f to force this pick.')
                print('Change is closed. Skipping the cherry pick.\nUse -f to force this pick.')
                continue

        # Convert the project name to a project path