Debian Codegraph @

tests/test-convert-tagsbranch-topology.t

raw
1 #require git
2
3 $ echo "[core]" >> $HOME/.gitconfig
4 $ echo "autocrlf = false" >> $HOME/.gitconfig
5 $ echo "[core]" >> $HOME/.gitconfig
6 $ echo "autocrlf = false" >> $HOME/.gitconfig
7 $ cat <<EOF >> $HGRCPATH
8 > [extensions]
9 > convert =
10 > [convert]
11 > hg.usebranchnames = True
12 > hg.tagsbranch = tags-update
13 > EOF
14 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
15 $ GIT_AUTHOR_EMAIL='[email protected]'; 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 $ count=10
21 $ action()
22 > {
23 > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
24 > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
25 > git "$@" >/dev/null 2>/dev/null || echo "git command error"
26 > count=`expr $count + 1`
27 > }
28 $ glog()
29 > {
30 > hg log -G --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
31 > }
32 $ convertrepo()
33 > {
34 > hg convert --datesort git-repo hg-repo
35 > }
36
37 Build a GIT repo with at least 1 tag
38
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 Convert without tags
49
50 $ hg convert git-repo hg-repo --config convert.skiptags=True
51 initializing destination hg-repo repository
52 scanning source...
53 sorting...
54 converting...
55 0 rev1
56 updating bookmarks
57 $ hg -R hg-repo tags
58 tip 0:d98c8ad3a4cf
59 $ rm -rf hg-repo
60
61 Do a first conversion
62
63 $ convertrepo
64 initializing destination hg-repo repository
65 scanning source...
66 sorting...
67 converting...
68 0 rev1
69 updating tags
70 updating bookmarks
71
72 Simulate upstream updates after first conversion
73
74 $ cd git-repo
75 $ echo b > a
76 $ git add a
77 $ action commit -m "rev2"
78 $ action tag -m "tag2" tag2
79 $ cd ..
80
81 Perform an incremental conversion
82
83 $ convertrepo
84 scanning source...
85 sorting...
86 converting...
87 0 rev2
88 updating tags
89 updating bookmarks
90
91 Print the log
92
93 $ cd hg-repo
94 $ glog
95 o 3 "update tags" files: .hgtags
96 |
97 | o 2 "rev2" files: a
98 | |
99 o | 1 "update tags" files: .hgtags
100 /
101 o 0 "rev1" files: a
102
103
104 $ cd ..