Debian Codegraph @

tests/test-mq-qclone-http.t

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