#!/bin/bash # NOTE: This conversion has been made and merge. # This "one-shot" script is not required anymore, # it is only kept here for historical interest. # This script imports 3301 revisions of CSS 2, # dated from 1997-07-21 to 2014-01-17, # from a zip archive of W3C's CVS repository into a Mercurial bundle file. # # This bundle can be imported into a clone of CSSWG's repository # (https://hg.csswg.org/drafts/) to add a 'css2' subdirectory # with all its change history: # # hg unbundle path/to/css2.hg-bundle # hg merge # hg commit -m 'Import CSS 2 from CVS, with change history' # This script requires cvs2svn and hg convert # http://cvs2svn.tigris.org/ # http://mercurial.selenic.com/wiki/ConvertExtension # # It expects to be in the same directory as a 'css2.zip' file # containing the 'css2-src' directory of W3C's internal CVS repository, # which itself consists of a bunch of '*,v' files. # # It will go through a multiple-step conversion, creating temporary files # in the 'tmp' subdirectory, to finally produce a ~10 MB 'css2.hg-bundle' file. set -e cd $(dirname $0) rm -rf tmp mkdir -p tmp/cvs/CVSROOT # Exclude: # css2-src/css2.tgz,v # css2-src/css2.ps,v # css2-src/css2.ps.gz,v # css2-src/css2.pdf,v # css2-src/css2.zip,v # css2-src/css2.txt,v # But not: # css2-src/css2.html,v unzip -q css2.zip 'css2-src/*' -x 'css2-src/css2.[^h]*' -d tmp/cvs # We want the final result at http://dev.w3.org/csswg/css2/ mv tmp/cvs/css2-src tmp/cvs/css2 # Try some surgery on a broken RCS file. # We may end up with incorrect earlier versions of bin/mkidx # but at least cvs2svn doesn't abort in the middle of the conversion patch -p 1 <<-'EOF' --- a/tmp/cvs/css2/bin/mkidx,v +++ b/tmp/cvs/css2/bin/mkidx,v @@ -509,20 +509,19 @@ # class="tocline*" directs out patched html2ps to omit the bullet d85 2 a86 3 print OUTPUT "\n$indent[$j]
  • $subs[$j]"; if ($j < $#subs) { print OUTPUT "\n$indent[$j]\n"; - @ 2.9 log @Bug: lowercase & uppercase were considered different @ text @@ -851,21 +850,21 @@ a91 7 $buf .= "\n"; # Print out the full buffer open(OUTPUT, "> $indexf"); print OUTPUT "
    "; foreach $letter (@@letters) { print OUTPUT " " . uc($letter) . " "; -d93 2 -a94 2 +d93 1 +a93 2 print OUTPUT "
    "; print OUTPUT $buf; -a95 2 +a93 2 @ 1.11 log @Updated to be like HTML @@ -1011,17 +1010,17 @@ a85 1 print OUTPUT "\n
    $cmt"; d109 1 a109 1 print OUTPUT "$pre$content$post"; d112 10 a121 1 print OUTPUT "\n"; -d123 3 +d123 1 @ 1.5 log @Fixed bug @ text EOF # Prefix all commit messages with "[css2] " find tmp/cvs -name '*,v' | xargs sed -i -r '/^log$/{ N s/^(log\n@+)/\1\[css2\] / }' cvs2svn --encoding latin1 --retain-conflicting-attic-files --trunk-only \ --tmpdir=tmp/cvs2svn --svnrepos tmp/svn tmp/cvs cat > tmp/authormap.txt <<-'EOF' bbos=Bert Bos ijacobs=Ian Jacobs ian=Ian Jacobs howcome=HÃ¥kon Wium Lie fantasai=Elika Etemad clilley=Chris Lilley ihickson=Ian Hickson lehors=Arnaud Le Hors ot=Olivier Thereaux ted=Ted Guild mmielke=Markus Mielke dbaron=L. David Baron EOF hg convert --authormap tmp/authormap.txt --datesort tmp/svn tmp/hg hg --repository tmp/hg bundle --all css2.hg-bundle