-
Notifications
You must be signed in to change notification settings - Fork 707
/
Copy pathcss2-cvs2hg
executable file
·156 lines (129 loc) · 3.63 KB
/
css2-cvs2hg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/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]<li class=\"tocline0\">$subs[$j]";
if ($j < $#subs) {
print OUTPUT "\n$indent[$j]<ul class=\"index\">";
d88 1
d90 1
-d109 2
-a110 2
+d106 1
+a106 1
print OUTPUT "\n</ul>\n";
-
@
2.9
log
@Bug: lowercase & uppercase were considered different
@
text
@@ -851,21 +850,21 @@
a91 7
$buf .= "</dl>\n";
# Print out the full buffer
open(OUTPUT, "> $indexf");
print OUTPUT "<DIV class=\"noprint\"> ";
foreach $letter (@@letters) {
print OUTPUT " <a href=\"#$letter\">" . uc($letter) . "</a> ";
-d93 2
-a94 2
+d93 1
+a93 2
print OUTPUT "</DIV>";
print OUTPUT $buf;
-a95 2
+a93 2
@
1.11
log
@Updated to be like HTML
@@ -1011,17 +1010,17 @@
a85 1
print OUTPUT "\n<dd> $cmt";
d109 1
a109 1
print OUTPUT "$pre$content$post";
d112 10
a121 1
print OUTPUT "</dl>\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 <bert@w3.org>
ijacobs=Ian Jacobs <ij@w3.org>
ian=Ian Jacobs <ij@w3.org>
howcome=Håkon Wium Lie <howcome@opera.com>
fantasai=Elika Etemad <fantasai.cvs@inkedblade.net>
clilley=Chris Lilley <chris@w3.org>
ihickson=Ian Hickson <ian@hixie.ch>
lehors=Arnaud Le Hors <lehors@w3.org>
ot=Olivier Thereaux <ot@w3.org>
ted=Ted Guild <ted@w3.org>
mmielke=Markus Mielke <mmielke@microsoft.com>
dbaron=L. David Baron <dbaron@dbaron.org>
EOF
hg convert --authormap tmp/authormap.txt --datesort tmp/svn tmp/hg
hg --repository tmp/hg bundle --all css2.hg-bundle