summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorSumit Kumar <sumit_kumar@in.ibm.com>2018-06-05 05:05:06 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2018-06-05 06:53:39 -0400
commitc6e317a13c35386b3f023cb8b57e344463d4fcb8 (patch)
tree1434e66a2c0d82aee59464750b8d7c36c59f311c /src/tools
parentd73e4c11febed4a029ea67456f72f7a213fdfb43 (diff)
downloadtalos-sbe-c6e317a13c35386b3f023cb8b57e344463d4fcb8.tar.gz
talos-sbe-c6e317a13c35386b3f023cb8b57e344463d4fcb8.zip
gitRelease: Fix to include master branch
The fix include to check for master branch if commit not found in release branch other than master Change-Id: I4330b1a8cf4dd33375c137069948fa24bf787784 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59932 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Sumit Kumar <sumit_kumar@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/tools')
-rwxr-xr-xsrc/tools/utils/gitRelease.pl52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/tools/utils/gitRelease.pl b/src/tools/utils/gitRelease.pl
index 17895195..30475148 100755
--- a/src/tools/utils/gitRelease.pl
+++ b/src/tools/utils/gitRelease.pl
@@ -6,7 +6,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2016
+# Contributors Listed Below - COPYRIGHT 2016,2018
# [+] International Business Machines Corp.
#
#
@@ -1646,39 +1646,43 @@ sub gerrit_query
sub gerrit_query_commit
{
my $commit = shift;
+ my $flag = 0; ## use to check for commit in master branch if needed
- my $project = config_project();
+ my $project = config_project();
+ my $query_result = gerrit_query( "$commit project:$project " . "branch:" . $globals{"branch"} );
- my $query_result = gerrit_query("$commit project:$project ".
- "branch:".$globals{"branch"});
-
- if ($query_result eq "")
- {
- $query_result = gerrit_query("$commit project:$project ".
- "branch:master");
- }
-
- foreach my $result (@{$query_result})
+ do
{
- if ($result->{id} eq $commit ||
- $result->{currentPatchSet}->{revision} =~ m/$commit/)
+ foreach my $result ( @{$query_result} )
{
- return $result;
- }
- else
- {
- # If all patchsets queried, search all of them for the commit
- foreach my $patchset (@{$result->{patchSets}})
+ if ( $result->{id} eq $commit
+ || $result->{currentPatchSet}->{revision} =~ m/$commit/ )
{
- if ($patchset->{revision} =~ m/$commit/)
+ return $result;
+ }
+ else
+ {
+ # If all patchsets queried, search all of them for the commit
+ foreach my $patchset ( @{ $result->{patchSets} } )
{
- return $result;
+ if ( $patchset->{revision} =~ m/$commit/ )
+ {
+ return $result;
+ }
}
}
}
- }
- die "Cannot find $commit in $project/$globals{\"branch\"}";
+ if ( $flag == 0 )
+ {
+ $query_result = gerrit_query( "$commit project:$project " . "branch:master" );
+ $flag = 1;
+ }
+ else
+ {
+ die "Cannot find $commit in $project/$globals{\"branch\"}";
+ }
+ } while (1);
}
# sub gerrit_is_patch
OpenPOWER on IntegriCloud