Received: from spf3.us4.outblaze.com (spf3.us4.outblaze.com [205.158.62.25]) by sdf.lonestar.org (8.12.10/8.12.10) with ESMTP id iAG8Ggtl011549 for ; Tue, 16 Nov 2004 08:16:42 GMT Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by spf3.us4.outblaze.com (Postfix) with ESMTP id 6818153CB9 for ; Tue, 16 Nov 2004 08:16:41 +0000 (GMT) Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTyef-0002Il-I2 for migo@homemail.com; Tue, 16 Nov 2004 03:25:37 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CTye4-0002II-Ix for gnu-arch-users@gnu.org; Tue, 16 Nov 2004 03:25:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CTye3-0002Hs-O2 for gnu-arch-users@gnu.org; Tue, 16 Nov 2004 03:25:00 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTye3-0002HQ-Fz for gnu-arch-users@gnu.org; Tue, 16 Nov 2004 03:24:59 -0500 Received: from [202.72.174.244] (helo=patrick.wattle.id.au) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CTyUv-0004Hk-Mn for gnu-arch-users@gnu.org; Tue, 16 Nov 2004 03:15:34 -0500 Received: by patrick.wattle.id.au (Postfix, from userid 1000) id 6F29653C1A; Tue, 16 Nov 2004 16:15:32 +0800 (WST) Date: Tue, 16 Nov 2004 16:15:32 +0800 From: Cameron Patrick To: gnu-arch-users@gnu.org Subject: Re: [Gnu-arch-users] Removing the last changeset(s) from the archive Message-ID: <20041116081532.GA2749@patrick.wattle.id.au> Mail-Followup-To: gnu-arch-users@gnu.org References: <20041114111431.E15533@mofo.meme.com> Mime-Version: 1.0 In-Reply-To: <20041114111431.E15533@mofo.meme.com> Organization: Parenthesis Conspiracy User-Agent: Mutt/1.5.6+20040803i X-BeenThere: gnu-arch-users@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: a discussion list for all things arch-ish List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1728292884==" Sender: gnu-arch-users-bounces+migo=homemail.com@gnu.org Errors-To: gnu-arch-users-bounces+migo=homemail.com@gnu.org Status: RO Content-Length: 3448 Lines: 125 --===============1728292884== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IrhDeMKUP4DT/M7F" Content-Disposition: inline --IrhDeMKUP4DT/M7F Content-Type: multipart/mixed; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Karl O. Pinc wrote: > I'd like arch to be able to 'disappear' the last > commit(s) from the archive, for use when the commit is > just wrong. Well, after all the usual caveats about changing history being Bad and that you shouldn't do it, I have a script called 'tla-uncommit' which does exactly this. It only works if you have a local archive, and you can't safely uncommit once the archive has been mirrored anywhere or anyone else might have seen a copy of the revision that you want to obliterate. It's probably buggy and if it destroys your archive and kills your cat, such is life. Script is attached. Cameron. --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=tla-uncommit #! /bin/bash # tla-uncommit: remove the most recently committed revision set -e -u LAST_REVISION="$(tla logs -f | tail -1)" echo "* un-committing revision: $LAST_REVISION" ARCHIVE="$(tla parse-package-name -a $LAST_REVISION)" CATEGORY="$(tla parse-package-name -c $LAST_REVISION)" BRANCH="$(tla parse-package-name -b $LAST_REVISION)" VERSION="$(tla parse-package-name -v $LAST_REVISION)" PATCH="$(tla parse-package-name -l $LAST_REVISION)" LOCATION="$(cat $HOME/.arch-params/=locations/$ARCHIVE)" if ! echo "$LOCATION" | grep -q "^/"; then echo "Archive $ARCHIVE is not on a local filesystem." exit 1 fi echo "This operation will change history." echo "Type 'yes' if you are sure you want to proceed." echo -n "> " read ans if ! [ "$ans" = "yes" ]; then echo "Aborting." exit 1 fi tla library-remove $LAST_REVISION || true echo "* removing patch log for $PATCH" mv "{arch}/$CATEGORY/$CATEGORY--$BRANCH/$CATEGORY--$BRANCH--$VERSION/$ARCHIVE/patch-log/$PATCH" "++removed-log-$PATCH" PREV_PATCH="$(tla logs | tail -1)" echo "* new latest revision will be $PREV_PATCH" echo "* removing $CATEGORY--$BRANCH--$VERSION--$PATCH from the archive" echo "* archive location is $LOCATION" (cd $LOCATION/$CATEGORY/$CATEGORY--$BRANCH/$CATEGORY--$BRANCH--$VERSION/; mv $PATCH/++revision-lock $PREV_PATCH tar cvfz - $PATCH/ rm -rf $PATCH/) > ++removed-changeset-$PATCH.tar.gz echo "* rebuilding .listing files" tla archive-fixup $ARCHIVE >/dev/null echo "* revision un-committed" # arch-id: 4d135a45-c0f8-4a7d-bd29-4650dfedc593 --SLDf9lqlvOQaIe6s-- --IrhDeMKUP4DT/M7F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBmbckl1rlvh2uVnMRApk7AJ4m8YKp30FtIKJOqPeArw6mi2covQCcDRCy k8MDgvKLQHF+y+md+ppA0E4= =Ga9d -----END PGP SIGNATURE----- --IrhDeMKUP4DT/M7F-- --===============1728292884== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Gnu-arch-users mailing list Gnu-arch-users@gnu.org http://lists.gnu.org/mailman/listinfo/gnu-arch-users GNU arch home page: http://savannah.gnu.org/projects/gnu-arch/ --===============1728292884==--