From: Ian Jackson Subject: [OSSTEST PATCH 2/3] sg-check-tested: support --git-ancestor-of Date: Mon, 14 Apr 2014 11:33:29 +0100 Message-ID: <1397471610-25399-3-git-send-email-ian.jackson@eu.citrix.com> References: <1397471610-25399-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WZeCx-0001Ym-6x for xen-devel@lists.xenproject.org; Mon, 14 Apr 2014 10:33:47 +0000 In-Reply-To: <1397471610-25399-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org This will be used for the linux-next branch, whose baseline is the most recently tested linux-linus which is an ancestor of the being-tested linux-next. We do not provide this for any VCS other than git. Hopefully we will never need to. Signed-off-by: Ian Jackson --- sg-check-tested | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sg-check-tested b/sg-check-tested index 9e78448..8cdc8a9 100755 --- a/sg-check-tested +++ b/sg-check-tested @@ -20,10 +20,13 @@ use strict; use DBI; use Osstest; +use IO::Handle; our @conds; our @conds_vars; our $prrev; +our $ancestorof; +our %ancestors; open DEBUG, ">/dev/null" or die $!; @@ -84,6 +87,16 @@ END } elsif (m/^--print-revision=(.*)$/) { die if $prrev; $prrev= $1; + } elsif (m/^--git-ancestor-of=(.*)$/) { + # set GIT_DIR appropriately when using this + $ancestorof=$1; + open GA, "git rev-list $ancestorof |" or die $!; + while () { + chomp or die; + $ancestors{$_} = 1; + } + GA->error and die $!; + $!=$?=0; close GA or die "$? $!"; } elsif (m/^--debug$/) { open DEBUG, ">&2" or die $!; } else { @@ -93,6 +106,7 @@ END die if @ARGV; die unless @conds; +die if defined($ancestorof) && !$prrev; csreadconfig(); @@ -162,6 +176,12 @@ END print DEBUG "also $val2\n"; next FLIGHT; } + if (defined $ancestorof) { + if (!$ancestors{$val1}) { + print DEBUG "not an ancestor of $ancestorof\n"; + next FLIGHT; + } + } print "$val1\n"; exit 0; } -- 1.7.10.4