[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

WinCVS2svn

From: David Summers <david_at_summersoft.fay.ar.us>
Date: 2003-07-29 18:37:41 CEST

This script goes through a CVS repository looking for the CVS "author"
headers with a username with a space in it and changes that space to an
underscore. WinCVS 1.2 evidently allows usernames with spaces which gives
the python rcsparse script (which cvs2svn uses) heartburn.

This conversion method was chosen to not change the length of the file.

This is just a first version of this script and I'm sure it can be
improved upon but it seems to have worked for my purposes.

#! /bin/sh
# Put a "_" character in between any entry with double strings in the CVS/RCS
# file "author" fields. Evidently WinCVS allows incorrect author names.
# This changes the file in such a way that there is no change in file size.
#
# Example: Change "author David_Summers;" to "author David_Summers;"
#
# *** Note: Make *SURE* you run this on a COPY of the repository and not the
# repository itself until you are ABSOLUTELY SURE that it doesn't do anything
# bad.

# Hack around strangeness in PERL
LANG=C
export C

# Do the dastardly deed.
find . -type f -print0 | xargs -0 perl -pi -e 's/author\s+(\w+)\s(\w+);/author
$1_$2;/'
exit 0

-- 
David Wayne Summers          "Linux: Because reboots are for hardware upgrades!"
david_at_summersoft.fay.ar.us   PGP Key: http://summersoft.fay.ar.us/~david/pgp.txt
PGP Key fingerprint =  C0 E0 4F 50 DD A9 B6 2B  60 A1 31 7E D2 28 6D A8 
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 29 18:58:53 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.