24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
+
|
<li><a href="#ticket-checkin-links">Link tickets to checkins</a></li>
<li><a href="#th1-usage">Fossil and Th1</a></li>
<li><a href="#versionCompressed">Versioning compressed files</a></li>
<li><a href="#ColorPicker">Color selector in check-in properties</a></li>
<li><a href="#SearchWiki">Searching wiki text</a></li>
<li><a href="#HighlightDiff">Highlight diff's</a></li>
<li><a href="#Mercurial">Importing from Mercurial</a></li>
<li><a href="#SVN">Importing from SVN</a></li>
</ul>
<h2><a name="CGI">Using <cite>Fossil</cite>'s Built-In CGI</a></h2>
<h3>Motivation</h3>
* You want to share a repository through your existing web infrastructure.
* You want to share more than one repository at the same time.
|
1236
1237
1238
1239
1240
1241
1242
|
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
hg push ../git-wpkg
cd ../git-wpkg
git fast-export --all | fossil import --git ~/wpkg.fossil
cd ~
rm -rf /tmp/moretmp
fossil ui wpkg.fossil
</verbatim>
<h2><a name="SVN">Importing from SVN</a></h2>
<h3>Problem</h3>
Fossil supports [/doc/trunk/www/inout.wiki|importing from Git], but not from SVN.
<h3>Solution</h3>
* Ensure you have "git-svn" and "sed".
* Save the following bash script somewhere, call it <tt>svn2fossil</tt>
* Create an empty directory
* In that directory, type <tt>svn2fossil username svnrepo fossilrepo</tt>
In this case 'username' is the SVN user you wish to make changes as, 'svnrepo' is the full svn url (e.g. "svn+ssh://joe@someplace.org/svn/whatever"), and "fossilrepo" is the name you wish the resultant fossil repository to have.
The "svn2fossil" script will first import the SVN repository into 'git'. Then it will export from 'git' to fossil. Then it will import all the SVN users who are listed in the SVN log, as 'developers' in the fossil repository, with a password consisting of the user name with '1234' appended to it. Finally, the script will launch 'fossil ui' on the new repository so you can make any additional changes you want.
I have successfully used this script to convert pretty large SVN repositories to fossil, in a corporate environment. The script follows:
<verbatim>
#!/bin/bash
die(){
echo $1
exit 1
}
authors='authors.txt'
fossilusers='users.txt'
# parameters:
# 1 - username of admin
# 2 - svn repository to convert
# 3 - name of fossil repo
# note: the repository will be created right here!
if [ "$3" == "" ]
then
echo "Syntax:"
echo " svn2fossil username svn-repo-url fossil-repo-name"
die "Please make sure you have all three parameters set!"
fi
echo "Getting user names..."
svn log "$2" | grep '^r[0-9]' | cut -f3 -d' ' | sort -u > $fossilusers || die "Something went wrong getting user names"
echo "Converting user names to usable format..."
sed -e 's/.*/& = & <&>/' $fossilusers > $authors || die "Could not convert user names"
echo "Importing from SVN to git. This will take some time, be patient!"
git svn clone --authors-file=$authors --username="$1" --no-metadata "$2" tmp || die "Unable to import to git"
echo "Importing from git to fossil. This will also take some time, sadly"
(
cd tmp
git fast-export --full-tree --all | fossil import --git ../$3 || die "Unable to import into fossil"
)
echo "Adding users to fossil repository:"
for user in `cat $fossilusers`
do
fossil user new $user '' "${user}1234" -R $3
fossil user capabilities $user 'v' -R $3
done
echo "Done!. Now launching 'fossil ui $3' to check out the new fossil repository"
fossil ui $3
</verbatim>
|