From: Ben Collins <bcollins@debian.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: andrea@e-mind.com, kernel list <linux-kernel@vger.kernel.org>
Subject: Re: BitBucket: GPL-ed BitKeeper clone
Date: Sun, 2 Mar 2003 00:10:10 -0500 [thread overview]
Message-ID: <20030302051010.GB22169@phunnypharm.org> (raw)
In-Reply-To: <20030302050420.GA22169@phunnypharm.org>
[-- Attachment #1: Type: text/plain, Size: 765 bytes --]
On Sun, Mar 02, 2003 at 12:04:20AM -0500, Ben Collins wrote:
> On Wed, Feb 26, 2003 at 09:02:12PM +0100, Pavel Machek wrote:
> > Hi!
> >
> > I've created little project for read-only (for now ;-) bitkeeper
> > clone. It is available at www.sf.net/projects/bitbucket (no tar balls,
> > just get it fresh from CVS).
>
> In case it may be of some help, here's a script that is the result of my
> own reverse engineering of the bitkeeper SCCS files. It can output a
> diff, almost exactly the same as BitKeeper's gnupatch output from a
> BitKeeper repo.
Might aswell supply my hacked sccsdiff script aswell.
--
Debian - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
Deqo - http://www.deqo.com/
[-- Attachment #2: sccsdiff --]
[-- Type: text/plain, Size: 4873 bytes --]
#! /bin/sh
# This file is part of CSSC.
# # Generated automatically from sccsdiff.sh.in by configure.
# Usage:
# sccsdiff [-p] -rsid -rsid [diff-options] s.filename
#
# $Id: sccsdiff.sh.in,v 1.9 2001/11/25 16:01:38 james_youngman Exp $
# LOG $Log: sccsdiff.sh.in,v $
# LOG Revision 1.9 2001/11/25 16:01:38 james_youngman
# LOG Corrected a syntax error.
# LOG
# LOG Revision 1.8 2001/11/25 14:27:54 james_youngman
# LOG fixed Debian Bug#120080: sccs sccsdiff doesn't work (sccsdiff assumes /usr/sccs symlink exists)
# LOG
# LOG Revision 1.7 1998/03/10 00:22:00 james
# LOG Support for filenames containing spaces.
# LOG
# LOG Revision 1.6 1998/03/09 23:25:00 james
# LOG Bug report from Richard Polton: IRIX's pr(1) requires a space between
# LOG the "-h" and its argument.
# LOG
# LOG Revision 1.5 1998/02/09 21:00:19 james
# LOG Patch from Maurice O'Donnell <mod@tfn.com>: pass "-e" to sed before
# LOG the sed commands.
# LOG
# LOG Revision 1.4 1998/01/24 14:15:13 james
# LOG SCCS compatibility fix -- When "get" fails, exit with value 1, not 2.
# LOG
# LOG Revision 1.3 1997/12/19 20:40:35 james
# LOG Modified version of sccsdiff arrived from Richard Polton; took the
# LOG ideas onboard for a rewrite of sccsdiff.
# LOG
# LOG Revision 1.2 1997/05/04 14:52:02 james
# LOG Have to enclose the version string in single rather than double
# LOG quotes, to protect the dollar signs from shell expansion.
# LOG
# LOG Revision 1.1 1997/05/04 14:49:22 james
# LOG Initial revision
# Values substituted by configure:-
pr=/usr/bin/pr # The location of the pr(1) command:
diff=/usr/bin/diff # The location of the diff(1) command:
# Find the "get" command. The last value tested is "get", and
# that's what we use if we can't find get in any other location.
if test x$get = x
then
# The CSSC Makefile performs a sed substitution on the next line.
for get in "/usr/local/libexec/cssc/get" /usr/sccs/get get
do
if [ -x "$get" ]
then
break
fi
done
fi
version='$Revision: 1.9 $ $State: Exp $'
usage() {
cat <<EOF
$0 [-p] -rsid -rsid [diff-options] s.filename [s.secondfile...]
EOF
}
use_pr=false
first_sid=
second_sid=
diff_options=
sccs_files=
while test $# -gt 0
do
case $1 in
--help)
usage
exit 0
;;
--version)
echo "$version"
exit 0
;;
-p) use_pr=true
shift
;;
-r*)
if test x$first_sid = x
then
first_sid=$1
else
if test x$second_sid = x
then
second_sid=$1
else
exec >&2
usage
echo "Too many -r options."
exit 1
fi
fi
shift
;;
-*)
diff_options="${diff_options} $1"
shift
;;
*)
# That is an SCCS file, leave it and everything
# following it in $*.
break
;;
esac
done
# Show what we got...
## echo "use_pr=" $use_pr
## echo "first SID=" $first_sid
## echo "second SID=" $second_sid
## echo "diff options=" $diff_options
## echo "SCCS files=" $*
## echo \$\# = $#
if test x$second_sid = x
then
exec >&2
echo Two SIDs must be specified with the -r option.
usage
exit 1
fi
# Remove the leading "-r" from $first_sid and $second_sid
# so that we can echo the correct string as the header line
# introducing the diff.
first_sid=`echo $first_sid | sed -e 's/^-r//' `
second_sid=`echo $second_sid | sed -e 's/^-r//' `
getprefix=/tmp/get.$$.
g1="${getprefix}${first_sid}"
g2="${getprefix}${second_sid}"
dfile=${getprefix}d${first_sid}${second_sid}
while test $# -gt 0
do
rm -f "$g1" "$g2" "$dfile"
sccsfile="$1"
shift
header="$sccsfile: $first_sid vs. $second_sid"
if test $first_sid = 1 -o $first_sid = 1.0; then
touch "${g1}"
else
${get:-get} -r$first_sid -s -k "-G${g1}" "${sccsfile}" || {
exec >&2
echo "Failed to get version $first_sid from $sccsfile"
exit 1
}
fi
if test $second_sid = 1 -o $second_sid = 1.0; then
touch "${g2}"
else
${get:-get} -r$second_sid -s -k "-G${g2}" "${sccsfile}" || {
rm -f "$g1"
exec >&2
echo "Failed to get version $second_sid from $sccsfile"
exit 1
}
fi
# in case noclobber is set...
rm -f "$dfile"
# Ignore return value of diff since it just tells us
# if the two files are different.
"$diff" $diff_options "$g1" "$g2" > "$dfile"
if test -f "$dfile"
then # Output file exists.
if test -s "$dfile"
then # Output file is not empty.
if $use_pr
then
$pr -h "$header" < $dfile
else
echo $header
cat "$dfile"
fi
else # Output file is empty.
echo No differences.
fi
else # No output file at all!
echo "$diff produced no output file." >&2
exit 2
fi
done # Loop over all named SCCS files.
rm -f "$g1" "$g2" "$dfile"
exit 0
# Local Variables:
# Mode: shell
# End:
next prev parent reply other threads:[~2003-03-02 5:00 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-26 20:02 Pavel Machek
2003-03-01 15:28 ` Larry McVoy
2003-03-01 16:02 ` Ben Collins
2003-03-01 16:11 ` Larry McVoy
2003-03-01 17:30 ` Alan Cox
2003-03-01 16:40 ` John Bradford
2003-03-01 16:42 ` Ben Collins
2003-03-02 23:40 ` Pavel Machek
2003-03-01 17:01 ` Aaron Lehmann
2003-03-01 17:19 ` Bernd Eckenfels
2003-03-01 18:05 ` BitBucket: GPL-ed KitBeeper clone Pavel Janík
2003-03-01 18:39 ` Christoph Hellwig
2003-03-01 22:43 ` Pavel Janík
2003-03-02 9:11 ` Christoph Hellwig
2003-03-02 9:30 ` John Bradford
2003-03-02 9:32 ` Christoph Hellwig
2003-03-03 12:39 ` Pavel Machek
2003-03-03 14:12 ` Alan Cox
2003-03-03 13:57 ` John Bradford
2003-03-03 14:22 ` Richard B. Johnson
2003-03-03 15:08 ` John Bradford
2003-03-03 17:50 ` David Lang
2003-03-03 19:37 ` Pavel Machek
2003-03-03 19:49 ` John Bradford
2003-03-03 14:22 ` Charles Cazabon
2003-03-02 9:57 ` Pavel Janík
2003-03-03 8:05 ` Helge Hafting
2003-03-03 8:28 ` Bernd Eckenfels
2003-03-01 20:58 ` Paul Fulghum
2003-03-02 4:52 ` Mike Galbraith
2003-03-03 0:02 ` Pavel Machek
2003-03-02 5:04 ` BitBucket: GPL-ed BitKeeper clone Ben Collins
2003-03-02 5:10 ` Ben Collins [this message]
2003-03-02 23:53 ` Pavel Machek
2003-03-03 0:53 ` Ben Collins
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=20030302051010.GB22169@phunnypharm.org \
--to=bcollins@debian.org \
--cc=andrea@e-mind.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
/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®