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

Unverified Commit 3502bb92 authored by Adrian DC's avatar Adrian DC
Browse files

build: repopick: Support squashed commits for Change-Id detection

 * Commits are identified by their last Change-Id,
    but the parser only considers the first one found

 * Reverse the list to find the last Change-Id
    and avoid multiple repopick attempts on the same commit

RM-290

Change-Id: Ie0204245a47799f8ead21148e0b4e9356cf271eb
parent 24fd46ba
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -330,7 +330,11 @@ if __name__ == '__main__':
        for i in range(0, check_picked_count):
            output = subprocess.check_output(['git', 'show', '-q', 'HEAD~{0}'.format(i)], cwd=project_path).split()
            if 'Change-Id:' in output:
                head_change_id = output[output.index('Change-Id:')+1]
                head_change_id = ''
                for j,t in enumerate(reversed(output)):
                    if t == 'Change-Id:':
                        head_change_id = output[len(output) - j]
                        break
                if head_change_id.strip() == item['change_id']:
                    print('Skipping {0} - already picked in {1} as HEAD~{2}'.format(item['id'], project_path, i))
                    found_change = True