Lluís Batlle i Rossell schrieb:
> Hello,

Hello Lluís,

> we are going to try to switch from svn into fossil.
> 
> As we could not find any tool ready to import svn history (even a single 
> branch)
> into fossil, I think that we are going to keep the svn history in its svn
> repository, and we will start fossil from a last agreed point in the svn
> history.

I was already gone this way. I had also only imported one branch for of
my SVN repository ...

My solution was very primitive, but perhaps it does for you what you need.

I have attached two files to this mail. One cat.sh and an XSLT stylesheet.

For the XSLT stylesheet you need an XSLT processor. I used XML Starlet
for that work, but others should work as well.

Here is the receipt:

1. You should checkout the newest/last revision of the branch wou
   want to import:

   svn co http://.../my/project myproject

2. Put the script 'cat.sh' in the parent directory that contains the
   checkedout project:

   mv ...../cat.sh .

3. Put the stylesheet 'svn2fsl.xsl' into the parent directory that
   contains the checkeddout project:

   mv ...../svn2fsl.xsl .

4. 'cd' into the top directory of your project:

   cd myproject

5. Create an empty Fossil repository and open it:

   fsl new ../myproject.fossil
   fsl open ../myproject.fossil

6. Create a first checkin (I am not sure, if this is still necessary):

   echo "Initial empty checkin" > dummy_readme_txt
   fsl add dummy_readme_txt
   fsl ci -m "Initial empty import"

7. Generate and examine the import script:

   svn log --xml | xml tr ../svn2fsl.xsl | tee  ../import_svn.sh

8. Import your SVN repository:

   sh -x ../import_svn.sh

This is, how I do remember my import I done over a year before. I hope I
did not forgot anything, but I cannot warrant you. So please use it at
yours own peril ...

I hope it is of any use for you ...


Best regards,
chi.
#!/bin/sh

cat $1
exit 0
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:html="http://www.w3.org/1999/xhtml";
  xmlns:exsl="http://exslt.org/common";
  xmlns="http://www.w3.org/1999/xhtml";
  extension-element-prefixes="exsl"
  exclude-result-prefixes="html">

  <xsl:output method="text"/>

<!--  <xsl:template match="logentry">
    <xsl:sort select="@revision"/>
    Revision: <xsl:value-of select="@revision"/> 
  </xsl:template>
 -->

  <xsl:template match="/">
    <xsl:for-each select="//logentry">
      <xsl:sort select="@revision" data-type="number"/>
      svn update -r <xsl:value-of select="@revision"/> 
      fsl ls | awk '/MISSING/ {print $2}' | xargs -n 1 fsl del
      fsl ex | xargs -n 1 fsl add
      cat &lt;&lt;-'EOF' > .comment
<xsl:value-of select="msg"/>
EOF
      newrev=`env EDITOR="../cat.sh" fsl ci | awk '/New_Version:/ {print $2}'`
      fsl tag add --raw date $newrev "<xsl:value-of select="date"/>"
      fsl tag add --raw svn:revision $newrev "<xsl:value-of select="@revision"/>"
      rm .comment
      find . -type d | fgrep -v .svn | xargs rm -rf 

    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to