From patchwork Mon Oct 11 19:00:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 67473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 60FC7B70A9 for ; Tue, 12 Oct 2010 06:01:12 +1100 (EST) Received: (qmail 367 invoked by alias); 11 Oct 2010 19:01:11 -0000 Received: (qmail 352 invoked by uid 22791); 11 Oct 2010 19:01:10 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Oct 2010 19:01:03 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id B17C6C67; Mon, 11 Oct 2010 21:01:01 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6Dm8eSHdzdKv; Mon, 11 Oct 2010 21:00:59 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id BAEB6C66; Mon, 11 Oct 2010 21:00:59 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id o9BJ0xa1023278; Mon, 11 Oct 2010 21:00:59 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Paolo Bonzini Subject: [build] Fix gcc_update -r with mercurial Date: Mon, 11 Oct 2010 21:00:59 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org When trying to update a mainline hg tree to an older revision to work around a bootstrap failure, I noticed that gcc_update -rREV with mercurial doesn't work. Instead, one needs to separate the hg pull and the hg update -rREV, which is exactly what this patch does. Tested by running gcc_update with and without -r and observing that it works as expected. Ok for mainline? Rainer 2010-10-09 Rainer Orth * gcc_update: Run $GCC_HG pull and update separately. Check parents for SVN revision. diff -r 250fd0cc5552 contrib/gcc_update --- a/contrib/gcc_update Sat Oct 09 17:24:40 2010 +0200 +++ b/contrib/gcc_update Sat Oct 09 17:25:24 2010 +0200 @@ -311,17 +311,28 @@ # Update tree, but make sure to only pull the default branch. # Otherwise all branches in the upstream repo are added, even if # only a single one has been cloned. - $GCC_HG pull -u ${silent+-q} -r`$GCC_HG branch` ${1+"$@"} + $GCC_HG pull ${silent+-q} -r`$GCC_HG branch` ${1+"$@"} if [ $? -ne 0 ]; then (touch_files_reexec) echo "hg pull of full tree failed." >&2 exit 1 fi - # Extract SVN revision corresponding to tip, as stored by hg convert. - # Before hg 1.4.3, there's no template keyword corresponding to the - # extra: tag, so need to use hg log --debug to extract the info. - revision=`$GCC_HG log --debug -l1 | \ + # Update tree. Needs to be done separately from pull so + # gcc_update -rREV works. + $GCC_HG update ${silent+-q} ${1+"$@"} + if [ $? -ne 0 ]; then + (touch_files_reexec) + echo "hg update of full tree failed." >&2 + exit 1 + fi + + # Extract SVN revision corresponding to parents, as stored by + # hg convert. Before hg 1.4.3, there's no template keyword + # corresponding to the extra: tag, so need to use hg log --debug + # to extract the info. + parents=`$GCC_HG parents --template '{rev}'` + revision=`$GCC_HG log --debug -r$parents | \ sed -ne "/^extra:.*convert_revision=svn:/ { s%^.*@%% p