mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: kernel list <linux-kernel@vger.kernel.org>
Subject: ANNOUNCE: bitkeeper to CVS gateway
Date: Wed, 24 Jul 2002 18:09:41 +0200	[thread overview]
Message-ID: <20020724160941.GA8180@elf.ucw.cz> (raw)

Hi!

I've created some scripts usefull for doing bitkeeper 2 cvs
gateway. I'm currently running them on nl.linux.org (as you can see
from the close look). I have not yet figured out how to export
resulting CVS to the world.

[These scripts are in CVS at www.sf.net/projects/linux25.]

Hopefully this will be usefull to someone...
							Pavel

bk2all:

#!/bin/bash
cd /home/riel/bk-kernel/linux-2.5
A=$1
while [ $A -lt $2 ]; do
	PREV=$A
	A=$[$A+1]

	echo "Processing patch $A"
	bk export -tpatch -r1.$PREV,1.$A > ~/bkdata/1.$A
done

diff2cvs:

#!/bin/bash

fake() {
	eval $1
}

dir() {
	while [ ! -d $1 ]; do
		DIR=$1
		OLDDIR=foo
		while [ $OLDDIR != $DIR ]; do
			mkdir $DIR && fake "cvs add $DIR"
			OLDDIR=$DIR
			DIR=${DIR%/*}
		done
	done		
}

cat $1 | grep '^+++ ' | grep -v "/dev/null" | (
	while true; do
		read A B C || break
		FILE=${B#*/}
		if [ ! -e $FILE ]; then
			touch $FILE || dir ${FILE%/*}
			touch $FILE || echo "Could not create $FILE"
			touch $FILE || exit 1
			fake "cvs add -ko $FILE"
		fi
	done
)
cat $1 | patch -Esp1 || exit 3

cat $1 | grep '^--- ' | grep -v "/dev/null" | (
	while true; do
		read A B C || break
		FILE=${B#*/}
		if [ ! -e $FILE ]; then
			fake "cvs remove $FILE"
		fi
	done
)

cat $1 | grep '^#' > /tmp/delme.diff2cvs

fake "cvs -z 3 commit -F /tmp/delme.diff2cvs ."

all2cvs:

#!/bin/bash
A=$1
while [ $A -lt $2 ]; do
	A=$[$A+1]
	if [ ! -e ../data/1.$A ]; then
	    echo "Patch $A does not exist"
	    exit 1
	fi
	echo "Processing patch $A"
	../scripts/diff2cvs ../data/1.$A
	mv  ../data/1.$A  ../olddata/1.$A
	echo "Done processing $A"
	if [ -e ../data/STOP ]; then
		echo "Stopped at user request after $A"
		echo "Stopped at user request after $A" > ../data/STOP
		exit 1
	fi

	I=1; while [ $I -lt 50000 ]; do I=$[$I+1]; done
done

								Pavel
-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?

                 reply	other threads:[~2002-07-24 16:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020724160941.GA8180@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®