File: test-convergedmerge

package info (click to toggle)
hg-git 0.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 484 kB
  • sloc: python: 1,974; sh: 1,265; makefile: 36
file content (63 lines) | stat: -rwxr-xr-x 1,340 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh

# Fails for some reason, need to investigate
# "$TESTDIR/hghave" git || exit 80

# bail if the user does not have dulwich
python -c 'import dulwich, dulwich.repo' || exit 80

# bail early if the user is already running git-daemon
echo hi | nc localhost 9418 2>/dev/null && exit 80

echo "[extensions]" >> $HGRCPATH
echo "hggit=$(echo $(dirname $(dirname $0)))/hggit" >> $HGRCPATH
echo 'hgext.graphlog =' >> $HGRCPATH
echo 'hgext.bookmarks =' >> $HGRCPATH

hg init hgrepo1
cd hgrepo1
echo A > afile
hg add afile 
hg ci -m "origin"

echo B > afile
hg ci -m "A->B"

echo C > afile
hg ci -m "B->C"

hg up -r0
echo C > afile
hg ci -m "A->C"

hg merge -r2
hg ci -m "merge"

hg log --graph --style compact | sed 's/\[.*\]//g'

cd ..

mkdir gitrepo
cd gitrepo
git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"

# dulwich does not presently support local git repos, workaround
cd ..
git daemon --base-path="$(pwd)"\
 --listen=localhost\
 --export-all\
 --pid-file="$DAEMON_PIDS" \
 --detach --reuseaddr \
 --enable=receive-pack

cd hgrepo1
hg bookmark -r4 master
hg push -r master git://localhost/gitrepo
cd ..

hg clone git://localhost/gitrepo hgrepo2 | grep -v '^updating'
cd hgrepo2
echo % expect the same revision ids as above
hg log --graph --style compact | sed 's/\[.*\]//g'

cd ..