[Frugalware-darcs] vmexam: darcs: bin darcs2git, moved to its own repo

VMiklos vmiklos at frugalware.org
Sun Jul 1 01:15:01 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=vmexam;a=darcs_commitdiff;h=20070630231441-e2957-b1ef24307f1e682a1b0f6d6bf761ecca83288cb0.gz;

[darcs: bin darcs2git, moved to its own repo
VMiklos <vmiklos at frugalware.org>**20070630231441] {
addfile ./darcs/MISSING
hunk ./darcs/MISSING 1
+darcs2git is moved to the tailor-wrap repo, which is available at:
+
+http://ftp.frugalware.org/pub/other/people/vmiklos/tailor-hackfest/tailor-wrap/
hunk ./darcs/darcs2git 1
-#!/bin/bash
-# 
-#   darcs2git
-#  
-#   Copyright (c) 2007 by Miklos Vajna <vmiklos at frugalware.org>
-#  
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-# 
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#  
-#   You should have received a copy of the GNU General Public License
-#   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
-#   USA.
-#
-
-usage()
-{
-	echo "usage: $0 <source darcs repo> <target git repo>"
-	echo
-	echo "example: '$0 ../darcs/test .' - this will create a git repo in"
-	echo "                                the ./test dir"
-}
-
-die()
-{
-	echo "$0: $@"
-	exit 1
-}
-
-if [ "$#" != 2 ]; then
-	usage
-	exit 1
-fi
-
-src=$1
-target=$2
-
-[ -d "$src" ] || die "source dir does not exist!"
-
-cd $src
-src=`pwd`
-
-myname=`basename $src`
-
-cd - >/dev/null
-
-[ -d "$target" ] || die "target dir does not exist!"
-
-cd $target
-target=`pwd`
-
-myroot=`mktemp -d`
-mygitroot=`mktemp -d`
-rmdir $mygitroot
-
-cd $myroot
-
-cat > config << EOF
-[DEFAULT]
-verbose = True
-patch-name-format=%(revision)s
-
-[$myname]
-source = darcs:test
-target = git:test
-
-[darcs:test]
-subdir = darcs
-repository = $src
-
-[git:test]
-subdir = git
-repository = $mygitroot
-encoding = latin2
-EOF
-
-tailor --configfile config 2>&1 |tee tailor.log
-pending="$(grep 'pending changesets' tailor.log |sed -n 's/.* \([0-9]\+\) pending changesets .*/\1/;$ p')"
-if [ "$pending" == "0" ]; then
-	cd $target
-	git clone $mygitroot $myname
-else
-	echo "pendings changesets != 0 ($pending), convert failed"
-fi
-rm -rf $myroot $mygitroot
rmfile ./darcs/darcs2git
}


More information about the Frugalware-darcs mailing list