1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #!/bin/sh
- [ -d _darcs -a -d .git ] || exit 1
- TMPDIR=/tmp/darcs2git
- [ -d $TMPDIR -a -w $TMPDIR ] || mkdir -p $TMPDIR
- DARCS2GIT_XSLT=`dirname $0`/darcs2git.xslt
- [ -r $DARCS2GIT_XSLT ] || exit 1
- darcs fetch --all --summary --quiet > /dev/null &&
- darcs pull --all --quiet --dry-run --xml-output > $TMPDIR/patches.xml
- if head -n 1 $TMPDIR/patches.xml | grep "No remote changes to pull in!"
- then
- echo "No remote changes to pull in!" >&2
- exit 0
- fi
- xsltproc --nonet --novalid --stringparam TMPDIR "$TMPDIR/" $DARCS2GIT_XSLT $TMPDIR/patches.xml > $TMPDIR/doit.sh
- sh -x $TMPDIR/doit.sh
- exit $?
- # Für jeden patch (identifiziert durch seinen hash):
- # 1. darcs fetch
- # 2. darcs pull --dry-run --xml-output > patches.xml
- # 3. xsltproc --nonet --novalid darcs2git.xslt patches.xml > doit.sh
- #
- # 2. darcs pull - -matches="hash $HASH" --post-hook="$DARCS_FILES und $DARCS_PATCHES_XML wegschreiben"
- # 3. git add $DARCS_FILES
- # 4. git commit -F "$name\n\n$comment" --author=$author --date=$date $DARCS_FILES
- ##### Praeliminiarien: s. darcs2git.init.sh #####
- #
- ### wikidata ###
- # mkdir wikidata
- # cd wikidata
- ### darcs ###
- # darcs initialize
- # echo "https://mesh-j-1.free.de/~freifunk/wiki/wikidata" > _darcs/prefs/defaultrepo
- # patch _darcs/prefs/boring
- 9a10,12
- > # wg. git
- > \.git$
- >
- ^D
- Hmm... Looks like a normal diff to me...
- Patching file _darcs/prefs/boring using Plan A...
- Hunk #1 succeeded at 10.
- done
- ### git ###
- # git config --global user.name "FF-DO-Wiki `hostname`"
- # git config --global user.email "$USER@`hostname`"
- # git init
- # echo "_darcs" > .gitignore
- # git add .gitignore
- # git commit -m "ignore _darcs" .gitignore
|