comparison tests/test-git-clone @ 18:feab56c76c92

Add a basic test for cloning.
author Augie Fackler <durin42@gmail.com>
date Sun, 26 Apr 2009 18:27:24 -0700 (2009-04-27)
parents
children 578d1ebb6d69
comparison
equal deleted inserted replaced
17:ace0f6ed65a1 18:feab56c76c92
1 #!/bin/sh
2
3 # Fails for some reason, need to investigate
4 # "$TESTDIR/hghave" git || exit 80
5
6 # bail early if the user is already running git-daemon
7 echo hi | nc localhost 9418 && exit 80
8
9 echo "[extensions]" >> $HGRCPATH
10 echo "hggit=$(echo $(dirname $(dirname $0)))" >> $HGRCPATH
11 echo 'hgext.graphlog =' >> $HGRCPATH
12 echo 'hgext.bookmarks =' >> $HGRCPATH
13
14 GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
15 GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
16 GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
17 GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
18 GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
19 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
20
21 count=10
22 commit()
23 {
24 GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
25 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
26 git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
27 count=`expr $count + 1`
28 }
29
30 mkdir gitrepo
31 cd gitrepo
32 git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
33 echo alpha > alpha
34 git add alpha
35 commit -m 'add alpha'
36 echo beta > beta
37 git add beta
38 commit -m 'add beta'
39
40 # dulwich does not presently support local git repos, workaround
41 cd ..
42 git-daemon --base-path="$(pwd)"\
43 --listen=127.0.0.1\
44 --export-all\
45 --pid-file=gitdaemon.pid \
46 --detach --reuseaddr
47
48 hg gclone git://127.0.0.1/gitrepo hgrepo
49 cd hgrepo
50 hg log --graph
51
52 cd ..
53 kill `cat gitdaemon.pid`