summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-09-16 00:16:54 +0000
committerGerrit Code Review <review@openstack.org>2015-09-16 00:16:54 +0000
commitfaa6b9a902fb1aa2963e77b653a1a6fa1281f3e4 (patch)
tree0633413821a5c214cc3398a41e80a16d54f5d8dd
parenta5e4e581b6a751adc1511e91bfaa931cff6414b1 (diff)
parent2ce9a6f3981900e47eeea8bb3834c62c066ed237 (diff)
downloadtempest-lib-faa6b9a902fb1aa2963e77b653a1a6fa1281f3e4.tar.gz
Merge "Write the latest change_id on migration commit"
-rwxr-xr-xtools/migrate_from_tempest.sh15
1 files changed, 4 insertions, 11 deletions
diff --git a/tools/migrate_from_tempest.sh b/tools/migrate_from_tempest.sh
index acafcd6..d0c5b96 100755
--- a/tools/migrate_from_tempest.sh
+++ b/tools/migrate_from_tempest.sh
@@ -49,18 +49,11 @@ git clone $TEMPEST_GIT_URL $tmpdir
cd $tmpdir
for file in $files; do
- # get only commits that touch our files
- commits="$commits $(git log --format=format:%h --no-merges --follow -- $file)"
- # then their merge commits - which works fina since we merge commits
- # individually.
- merge_commits="$merge_commits $(git log --format=format:%h --merges --first-parent -- $file)"
+ # Get the latest change-id for each file
+ change_id=`git log -n1 --grep "Change-Id: " -- $file | grep "Change-Id: " | awk '{print $2}'`
+ CHANGE_LIST=`echo -e "$CHANGE_LIST\n * $file: $change_id"`
done
-pattern="\n$(echo $commits $merge_commits | sed -e 's/ /\\|/g')"
-
-# order them by filtering each one in the order it appears on rev-list
-SHA1_LIST=$(git rev-list --oneline HEAD | grep $pattern)
-
# Move files and commit
cd -
file_list=''
@@ -88,4 +81,4 @@ rm -rf $tmpdir
commit_message="Migrated $file_list from tempest"
pre_list=$"This migrates the above files from tempest. This includes tempest commits:"
post_list=$"to see the commit history for these files refer to the above sha1s in the tempest repository"
-git commit -m "$commit_message" -m "$pre_list" -m "$SHA1_LIST" -m "$post_list"
+git commit -m "$commit_message" -m "$pre_list" -m "$CHANGE_LIST" -m "$post_list"