##// END OF EJS Templates
tests: unify test-mq-qclone-http
Matt Mackall -
r12463:9f551ca3 default
parent child Browse files
Show More
@@ -1,81 +1,149 b''
1 #! /bin/sh
2
3 echo "[extensions]" >> $HGRCPATH
4 echo "mq=" >> $HGRCPATH
5
6 mkdir webdir
7 cd webdir
8
1
9 hg init a
2 $ echo "[extensions]" >> $HGRCPATH
10 hg --cwd a qinit -c
3 $ echo "mq=" >> $HGRCPATH
11 echo a > a/a
4 $ mkdir webdir
12 hg --cwd a ci -A -m a
5 $ cd webdir
13 echo b > a/b
6 $ hg init a
14 hg --cwd a addremove
7 $ hg --cwd a qinit -c
15 hg --cwd a qnew -f b.patch
8 $ echo a > a/a
16 hg --cwd a qcommit -m b.patch
9 $ hg --cwd a ci -A -m a
10 adding a
11 $ echo b > a/b
12 $ hg --cwd a addremove
13 adding b
14 $ hg --cwd a qnew -f b.patch
15 $ hg --cwd a qcommit -m b.patch
16 $ hg --cwd a log --template "{desc}\n"
17 [mq]: b.patch
18 a
19 $ hg --cwd a/.hg/patches log --template "{desc}\n"
20 b.patch
21 $ root=`pwd`
22 $ cd ..
23
24 test with recursive collection
25
26 $ cat > collections.conf <<EOF
27 > [paths]
28 > /=$root/**
29 > EOF
30 $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
31 > -A access-paths.log -E error-paths-1.log
32 $ cat hg.pid >> $DAEMON_PIDS
33 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
34 200 Script output follows
35
17
36
18 hg --cwd a log --template "{desc}\n"
37 /a/
19 hg --cwd a/.hg/patches log --template "{desc}\n"
38 /a/.hg/patches/
20
21 root=`pwd`
22
23 cd ..
24
25 echo % test with recursive collection
26
39
27 cat > collections.conf <<EOF
40 $ hg qclone http://localhost:$HGPORT/a b
28 [paths]
41 requesting all changes
29 /=$root/**
42 adding changesets
30 EOF
43 adding manifests
44 adding file changes
45 added 2 changesets with 2 changes to 2 files
46 requesting all changes
47 adding changesets
48 adding manifests
49 adding file changes
50 added 1 changesets with 3 changes to 3 files
51 updating to branch default
52 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 $ hg --cwd b log --template "{desc}\n"
55 a
56 $ hg --cwd b qpush -a
57 applying b.patch
58 now at: b.patch
59 $ hg --cwd b log --template "{desc}\n"
60 imported patch b.patch
61 a
31
62
32 hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
63 test with normal collection
33 -A access-paths.log -E error-paths-1.log
34 cat hg.pid >> $DAEMON_PIDS
35
64
36 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
65 $ cat > collections1.conf <<EOF
66 > [paths]
67 > /=$root/*
68 > EOF
69 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf collections1.conf \
70 > -A access-paths.log -E error-paths-1.log
71 $ cat hg.pid >> $DAEMON_PIDS
72 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
73 200 Script output follows
74
37
75
38 hg qclone http://localhost:$HGPORT/a b
76 /a/
39 hg --cwd b log --template "{desc}\n"
77 /a/.hg/patches/
40 hg --cwd b qpush -a
41 hg --cwd b log --template "{desc}\n"
42
43 echo % test with normal collection
44
78
45 cat > collections1.conf <<EOF
79 $ hg qclone http://localhost:$HGPORT1/a c
46 [paths]
80 requesting all changes
47 /=$root/*
81 adding changesets
48 EOF
82 adding manifests
83 adding file changes
84 added 2 changesets with 2 changes to 2 files
85 requesting all changes
86 adding changesets
87 adding manifests
88 adding file changes
89 added 1 changesets with 3 changes to 3 files
90 updating to branch default
91 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 $ hg --cwd c log --template "{desc}\n"
94 a
95 $ hg --cwd c qpush -a
96 applying b.patch
97 now at: b.patch
98 $ hg --cwd c log --template "{desc}\n"
99 imported patch b.patch
100 a
49
101
50 hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf collections1.conf \
102 test with old-style collection
51 -A access-paths.log -E error-paths-1.log
52 cat hg.pid >> $DAEMON_PIDS
53
54 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
55
103
56 hg qclone http://localhost:$HGPORT1/a c
104 $ cat > collections2.conf <<EOF
57 hg --cwd c log --template "{desc}\n"
105 > [collections]
58 hg --cwd c qpush -a
106 > $root=$root
59 hg --cwd c log --template "{desc}\n"
107 > EOF
108 $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections2.conf \
109 > -A access-paths.log -E error-paths-1.log
110 $ cat hg.pid >> $DAEMON_PIDS
111 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
112 200 Script output follows
60
113
61 echo % test with old-style collection
62
114
63 cat > collections2.conf <<EOF
115 /a/
64 [collections]
116 /a/.hg/patches/
65 $root=$root
66 EOF
67
117
68 hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections2.conf \
118 $ hg qclone http://localhost:$HGPORT2/a d
69 -A access-paths.log -E error-paths-1.log
119 requesting all changes
70 cat hg.pid >> $DAEMON_PIDS
120 adding changesets
71
121 adding manifests
72 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
122 adding file changes
123 added 2 changesets with 2 changes to 2 files
124 requesting all changes
125 adding changesets
126 adding manifests
127 adding file changes
128 added 1 changesets with 3 changes to 3 files
129 updating to branch default
130 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 $ hg --cwd d log --template "{desc}\n"
133 a
134 $ hg --cwd d qpush -a
135 applying b.patch
136 now at: b.patch
137 $ hg --cwd d log --template "{desc}\n"
138 imported patch b.patch
139 a
73
140
74 hg qclone http://localhost:$HGPORT2/a d
141 test --mq works and uses correct repository config
75 hg --cwd d log --template "{desc}\n"
76 hg --cwd d qpush -a
77 hg --cwd d log --template "{desc}\n"
78
142
79 echo '% test --mq works and uses correct repository config'
143 $ hg --cwd d outgoing --mq
80 hg --cwd d outgoing --mq | sed "s|$HGPORT2|\$HGPORT2|"
144 comparing with http://localhost:*/a/.hg/patches (glob)
81 hg --cwd d log --mq --template '{rev} {desc|firstline}\n'
145 searching for changes
146 no changes found
147 [1]
148 $ hg --cwd d log --mq --template '{rev} {desc|firstline}\n'
149 0 b.patch
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now