| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 | <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet    version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="TMPDIR" select="'/tmp/darcs2git/'"/> <xsl:output method="text"/> <xsl:template match="/patches|/changelog">  <xsl:text>TMPDIR="</xsl:text>  <xsl:value-of select="$TMPDIR"/>  <xsl:text>"ulimit -c 0</xsl:text>  <xsl:apply-templates select="patch" />  <xsl:text>rm -rf $TMPDIR</xsl:text> </xsl:template> <xsl:template match="patch">  <xsl:text>darcs pull --all --quiet --matches="hash </xsl:text>  <xsl:value-of select="@hash"/>  <xsl:text>" --posthook=': > '"${TMPDIR}darcs_files.txt"' ; for fnl in "$DARCS_FILES" ; do echo -n "$fnl" >> '"${TMPDIR}darcs_files.txt"' ; done' || exit 1sed -E -e 's%^\./%%' ${TMPDIR}darcs_files.txt | \sed -E -e $'s%(\\$|`|"|\\\\)%\\\\\\1%g' \    -e $'s%\'%\"\'\"%g' | \awk '{ printf " \"%s\"", $0 }' \> ${TMPDIR}darcs_files.args{ echo -n "git add --all" ; cat ${TMPDIR}darcs_files.args ; } > ${TMPDIR}git-add.shsh -x ${TMPDIR}git-add.sh || exit 1cat > ${TMPDIR}git_commit.cmd << '-EOF-'git commit --allow-empty -m !:&#_</xsl:text>  <xsl:value-of select="name"/>  <xsl:text>!:&#_ -m !:&#_</xsl:text>  <xsl:value-of select="comment"/>  <xsl:text>!:&#_ --author=!:&#_</xsl:text>  <xsl:choose>   <xsl:when test="normalize-space(@author) = ''">    <xsl:text>darcs2git <></xsl:text>   </xsl:when>   <xsl:when test="not(contains(@author,'<'))">    <xsl:choose>     <xsl:when test="contains(@author,'@') and not(contains(substring-after(@author,'@'),'@'))">      <xsl:value-of select="normalize-space(substring-before(@author,'@'))"/>      <xsl:text> <</xsl:text>      <xsl:value-of select="normalize-space(@author)"/>      <xsl:text>></xsl:text>     </xsl:when>     <xsl:otherwise>      <xsl:value-of select="@author"/>      <xsl:text> <></xsl:text>     </xsl:otherwise>    </xsl:choose>   </xsl:when>   <xsl:when test="not(normalize-space(substring-before(@author,'<')))">    <xsl:text>darcs2git </xsl:text>    <xsl:value-of select="@author"/>   </xsl:when>   <xsl:otherwise>    <xsl:value-of select="@author"/>   </xsl:otherwise>  </xsl:choose>  <xsl:text>!:&#_ --date=!:&#_</xsl:text>  <xsl:value-of select="@local_date"/>  <xsl:text>!:&#_-EOF-sed -E -e $'s%(\\$|`|"|\\\\)%\\\\\\1%g' \    -e $'s%\'%\"\'\"%g' \    -e 's%!:&#_%"%g' ${TMPDIR}git_commit.cmd \    > ${TMPDIR}git-commit.shtruncate -s -1 ${TMPDIR}git-commit.shcat ${TMPDIR}darcs_files.args >> ${TMPDIR}git-commit.shsh -x ${TMPDIR}git-commit.sh || exit 1</xsl:text> </xsl:template></xsl:stylesheet>
 |