summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian DC <radian.dc@gmail.com>2016-09-08 18:25:02 +0200
committerAdrian DC <radian.dc@gmail.com>2016-12-04 12:04:36 +0100
commit86152e68a701195a2269892561e67133961e51ac (patch)
tree37d4d399f72e5f7e37dae25494e3b6c858f92823
parent0730edceb5b5454b84260856e064a701276b2c8b (diff)
downloadbuild-86152e68a701195a2269892561e67133961e51ac.zip
build-86152e68a701195a2269892561e67133961e51ac.tar.gz
build-86152e68a701195a2269892561e67133961e51ac.tar.bz2
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
-rwxr-xr-xtools/repopick.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/repopick.py b/tools/repopick.py
index 8031a6a..9bf26bd 100755
--- a/tools/repopick.py
+++ b/tools/repopick.py
@@ -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