21 21 </li>
22 22 <li><a href="#ticket-checkin-links">Link tickets to checkins</a></li>
23 23 <li><a href="#th1-usage">Fossil and Th1</a></li>
24 24 <li><a href="#versionCompressed">Versioning compressed files</a></li>
25 25 <li><a href="#ColorPicker">Color selector in check-in properties</a></li>
26 26 <li><a href="#SearchWiki">Searching wiki text</a></li>
27 27 <li><a href="#HighlightDiff">Highlight diff's</a></li>
28 + <li><a href="#Mercurial">Importing from Mercurial</a></li>
28 29 </ul>
29 30
30 31 <h2><a name="CGI">Using <cite>Fossil</cite>'s Built-In CGI</a></h2>
31 32 <h3>Motivation</h3>
32 33 * You want to share a repository through your existing web infrastructure.
33 34 * You want to share more than one repository at the same time.
34 35
................................................................................
1056 1057 background-color: #F5C2C1 !important;
1057 1058 }
1058 1059
1059 1060 ================================
1060 1061
1061 1062 That's it: the script will automatically detect diffs and color them.
1062 1063 </verbatim>
1064 +
1065 +
1066 +<h2><a name="Mercurial">Importing from Mercurial</a></h2>
1067 +
1068 +<h3>Problem</h3>
1069 +
1070 +Fossil supports [/doc/trunk/www/inout.wiki|importing from Git], but not from Mercurial.
1071 +
1072 +<h3>Solution</h3>
1073 +
1074 +We'll use Git as an intermediary: first by converting Mercurial repository to Git, and then by converting Git repository
1075 +to Fossil. You'll need both Git and Mercurial installed for this to work.
1076 +
1077 +Get <i>hg2git.py</i>, <i>hg-fast-export.py</i>, and <i>hg-fast-export.sh</i> from [http://repo.or.cz/w/fast-export.git/tree],
1078 +and put them into a single directory (we'll use ~/Downloads/).
1079 +
1080 +Change directory to your Mercurial working copy (for the example we'll use "project"), and create a new Git repository
1081 +there:
1082 +
1083 +<verbatim>
1084 + cd project
1085 + git init
1086 +</verbatim>
1087 +
1088 +Run export:
1089 +
1090 +<verbatim>
1091 + sh ~/Downloads/hg-fast-export.sh
1092 +</verbatim>
1093 +
1094 +Once it finishes, check if it correctly imported everything by running "git log".
1095 +
1096 +If you got "ImportError: No module named mercurial" make sure your PYTHONPATH variable is set to point to the location
1097 +where mercurial modules are installed (on Mac OS X when Mercurial was installed via "easy_install mercurial", enter the
1098 +following into bash: "export PYTHONPATH=/Library/Python/2.6/site-packages").
1099 +
1100 +Now we can import Git repository into Fossil (we'll put it into
1101 +parent directory under the "our-repository.fossil" name):
1102 +
1103 +<verbatim>
1104 + git fast-export --all | fossil import --git ../our-repository.fossil
1105 +</verbatim>
1106 +