1 #!/bin/sh |
|
2 |
|
3 "$TESTDIR/hghave" git || exit 80 |
|
4 |
|
5 echo "[extensions]" >> $HGRCPATH |
|
6 echo "convert=" >> $HGRCPATH |
|
7 echo 'hgext.graphlog =' >> $HGRCPATH |
|
8 echo '[convert]' >> $HGRCPATH |
|
9 echo 'hg.usebranchnames = True' >> $HGRCPATH |
|
10 echo 'hg.tagsbranch = tags-update' >> $HGRCPATH |
|
11 |
|
12 GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME |
|
13 GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL |
|
14 GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE |
|
15 GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME |
|
16 GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL |
|
17 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE |
|
18 |
|
19 count=10 |
|
20 action() |
|
21 { |
|
22 GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" |
|
23 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" |
|
24 git "$@" >/dev/null 2>/dev/null || echo "git command error" |
|
25 count=`expr $count + 1` |
|
26 } |
|
27 |
|
28 glog() |
|
29 { |
|
30 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" |
|
31 } |
|
32 |
|
33 convertrepo() |
|
34 { |
|
35 hg convert --datesort git-repo hg-repo |
|
36 } |
|
37 |
|
38 # Build a GIT repo with at least 1 tag |
|
39 mkdir git-repo |
|
40 cd git-repo |
|
41 git init >/dev/null 2>&1 |
|
42 echo a > a |
|
43 git add a |
|
44 action commit -m "rev1" |
|
45 action tag -m "tag1" tag1 |
|
46 cd .. |
|
47 |
|
48 # Do a first conversion |
|
49 convertrepo |
|
50 |
|
51 # Simulate upstream updates after first conversion |
|
52 cd git-repo |
|
53 echo b > a |
|
54 git add a |
|
55 action commit -m "rev2" |
|
56 action tag -m "tag2" tag2 |
|
57 cd .. |
|
58 |
|
59 # Perform an incremental conversion |
|
60 convertrepo |
|
61 |
|
62 # Print the log |
|
63 cd hg-repo |
|
64 glog |
|