Show More
@@ -0,0 +1,20 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | ||
|
3 | import sys | |
|
4 | import os | |
|
5 | ||
|
6 | os.chdir(os.getenv('TESTTMP')) | |
|
7 | ||
|
8 | if sys.argv[1] != "user@dummy": | |
|
9 | sys.exit(-1) | |
|
10 | ||
|
11 | os.environ["SSH_CLIENT"] = "127.0.0.1 1 2" | |
|
12 | ||
|
13 | log = open("dummylog", "ab") | |
|
14 | log.write("Got arguments") | |
|
15 | for i, arg in enumerate(sys.argv[1:]): | |
|
16 | log.write(" %d:%s" % (i+1, arg)) | |
|
17 | log.write("\n") | |
|
18 | log.close() | |
|
19 | r = os.system(sys.argv[2]) | |
|
20 | sys.exit(bool(r)) |
@@ -1,215 +1,194 b'' | |||
|
1 | 1 | This test tries to exercise the ssh functionality with a dummy script |
|
2 | 2 | |
|
3 | $ cat <<EOF > dummyssh | |
|
4 | > import sys | |
|
5 | > import os | |
|
6 | > | |
|
7 | > os.chdir(os.path.dirname(sys.argv[0])) | |
|
8 | > if sys.argv[1] != "user@dummy": | |
|
9 | > sys.exit(-1) | |
|
10 | > | |
|
11 | > if not os.path.exists("dummyssh"): | |
|
12 | > sys.exit(-1) | |
|
13 | > | |
|
14 | > log = open("dummylog", "ab") | |
|
15 | > log.write("Got arguments") | |
|
16 | > for i, arg in enumerate(sys.argv[1:]): | |
|
17 | > log.write(" %d:%s" % (i+1, arg)) | |
|
18 | > log.write("\n") | |
|
19 | > log.close() | |
|
20 | > r = os.system(sys.argv[2]) | |
|
21 | > sys.exit(bool(r)) | |
|
22 | > EOF | |
|
23 | ||
|
24 | 3 | $ checknewrepo() |
|
25 | 4 | > { |
|
26 | 5 | > name=$1 |
|
27 | 6 | > if [ -d "$name"/.hg/store ]; then |
|
28 | 7 | > echo store created |
|
29 | 8 | > fi |
|
30 | 9 | > if [ -f "$name"/.hg/00changelog.i ]; then |
|
31 | 10 | > echo 00changelog.i created |
|
32 | 11 | > fi |
|
33 | 12 | > cat "$name"/.hg/requires |
|
34 | 13 | > } |
|
35 | 14 | |
|
36 | 15 | creating 'local' |
|
37 | 16 | |
|
38 | 17 | $ hg init local |
|
39 | 18 | $ checknewrepo local |
|
40 | 19 | store created |
|
41 | 20 | 00changelog.i created |
|
42 | 21 | revlogv1 |
|
43 | 22 | store |
|
44 | 23 | fncache |
|
45 | 24 | dotencode |
|
46 | 25 | $ echo this > local/foo |
|
47 | 26 | $ hg ci --cwd local -A -m "init" |
|
48 | 27 | adding foo |
|
49 | 28 | |
|
50 | 29 | creating repo with format.usestore=false |
|
51 | 30 | |
|
52 | 31 | $ hg --config format.usestore=false init old |
|
53 | 32 | $ checknewrepo old |
|
54 | 33 | revlogv1 |
|
55 | 34 | |
|
56 | 35 | creating repo with format.usefncache=false |
|
57 | 36 | |
|
58 | 37 | $ hg --config format.usefncache=false init old2 |
|
59 | 38 | $ checknewrepo old2 |
|
60 | 39 | store created |
|
61 | 40 | 00changelog.i created |
|
62 | 41 | revlogv1 |
|
63 | 42 | store |
|
64 | 43 | |
|
65 | 44 | creating repo with format.dotencode=false |
|
66 | 45 | |
|
67 | 46 | $ hg --config format.dotencode=false init old3 |
|
68 | 47 | $ checknewrepo old3 |
|
69 | 48 | store created |
|
70 | 49 | 00changelog.i created |
|
71 | 50 | revlogv1 |
|
72 | 51 | store |
|
73 | 52 | fncache |
|
74 | 53 | |
|
75 | 54 | test failure |
|
76 | 55 | |
|
77 | 56 | $ hg init local |
|
78 | 57 | abort: repository local already exists! |
|
79 | 58 | [255] |
|
80 | 59 | |
|
81 | 60 | init+push to remote2 |
|
82 | 61 | |
|
83 |
$ hg init -e "python |
|
|
62 | $ hg init -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote2 | |
|
84 | 63 | $ hg incoming -R remote2 local |
|
85 | 64 | comparing with local |
|
86 | 65 | changeset: 0:08b9e9f63b32 |
|
87 | 66 | tag: tip |
|
88 | 67 | user: test |
|
89 | 68 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
90 | 69 | summary: init |
|
91 | 70 | |
|
92 | 71 | |
|
93 |
$ hg push -R local -e "python |
|
|
72 | $ hg push -R local -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote2 | |
|
94 | 73 | pushing to ssh://user@dummy/remote2 |
|
95 | 74 | searching for changes |
|
96 | 75 | remote: adding changesets |
|
97 | 76 | remote: adding manifests |
|
98 | 77 | remote: adding file changes |
|
99 | 78 | remote: added 1 changesets with 1 changes to 1 files |
|
100 | 79 | |
|
101 | 80 | clone to remote1 |
|
102 | 81 | |
|
103 |
$ hg clone -e "python |
|
|
82 | $ hg clone -e "python $TESTDIR/dummyssh" local ssh://user@dummy/remote1 | |
|
104 | 83 | searching for changes |
|
105 | 84 | remote: adding changesets |
|
106 | 85 | remote: adding manifests |
|
107 | 86 | remote: adding file changes |
|
108 | 87 | remote: added 1 changesets with 1 changes to 1 files |
|
109 | 88 | |
|
110 | 89 | init to existing repo |
|
111 | 90 | |
|
112 |
$ hg init -e "python |
|
|
91 | $ hg init -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote1 | |
|
113 | 92 | abort: repository remote1 already exists! |
|
114 | 93 | abort: could not create remote repo! |
|
115 | 94 | [255] |
|
116 | 95 | |
|
117 | 96 | clone to existing repo |
|
118 | 97 | |
|
119 |
$ hg clone -e "python |
|
|
98 | $ hg clone -e "python $TESTDIR/dummyssh" local ssh://user@dummy/remote1 | |
|
120 | 99 | abort: repository remote1 already exists! |
|
121 | 100 | abort: could not create remote repo! |
|
122 | 101 | [255] |
|
123 | 102 | |
|
124 | 103 | output of dummyssh |
|
125 | 104 | |
|
126 | 105 | $ cat dummylog |
|
127 | 106 | Got arguments 1:user@dummy 2:hg init remote2 |
|
128 | 107 | Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio |
|
129 | 108 | Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio |
|
130 | 109 | Got arguments 1:user@dummy 2:hg init remote1 |
|
131 | 110 | Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio |
|
132 | 111 | Got arguments 1:user@dummy 2:hg init remote1 |
|
133 | 112 | Got arguments 1:user@dummy 2:hg init remote1 |
|
134 | 113 | |
|
135 | 114 | comparing repositories |
|
136 | 115 | |
|
137 | 116 | $ hg tip -q -R local |
|
138 | 117 | 0:08b9e9f63b32 |
|
139 | 118 | $ hg tip -q -R remote1 |
|
140 | 119 | 0:08b9e9f63b32 |
|
141 | 120 | $ hg tip -q -R remote2 |
|
142 | 121 | 0:08b9e9f63b32 |
|
143 | 122 | |
|
144 | 123 | check names for repositories (clashes with URL schemes, special chars) |
|
145 | 124 | |
|
146 | 125 | $ for i in bundle file hg http https old-http ssh static-http " " "with space"; do |
|
147 | 126 | > printf "hg init \"$i\"... " |
|
148 | 127 | > hg init "$i" |
|
149 | 128 | > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed" |
|
150 | 129 | > done |
|
151 | 130 | hg init "bundle"... ok |
|
152 | 131 | hg init "file"... ok |
|
153 | 132 | hg init "hg"... ok |
|
154 | 133 | hg init "http"... ok |
|
155 | 134 | hg init "https"... ok |
|
156 | 135 | hg init "old-http"... ok |
|
157 | 136 | hg init "ssh"... ok |
|
158 | 137 | hg init "static-http"... ok |
|
159 | 138 | hg init " "... ok |
|
160 | 139 | hg init "with space"... ok |
|
161 | 140 | |
|
162 | 141 | creating 'local/sub/repo' |
|
163 | 142 | |
|
164 | 143 | $ hg init local/sub/repo |
|
165 | 144 | $ checknewrepo local/sub/repo |
|
166 | 145 | store created |
|
167 | 146 | 00changelog.i created |
|
168 | 147 | revlogv1 |
|
169 | 148 | store |
|
170 | 149 | fncache |
|
171 | 150 | dotencode |
|
172 | 151 | |
|
173 | 152 | prepare test of init of url configured from paths |
|
174 | 153 | |
|
175 | 154 | $ echo '[paths]' >> $HGRCPATH |
|
176 | 155 | $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH |
|
177 | 156 | $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH |
|
178 | 157 | |
|
179 | 158 | init should (for consistency with clone) expand the url |
|
180 | 159 | |
|
181 | 160 | $ hg init somewhere |
|
182 | 161 | $ checknewrepo "url from paths" |
|
183 | 162 | store created |
|
184 | 163 | 00changelog.i created |
|
185 | 164 | revlogv1 |
|
186 | 165 | store |
|
187 | 166 | fncache |
|
188 | 167 | dotencode |
|
189 | 168 | |
|
190 | 169 | verify that clone also expand urls |
|
191 | 170 | |
|
192 | 171 | $ hg clone somewhere elsewhere |
|
193 | 172 | updating to branch default |
|
194 | 173 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
195 | 174 | $ checknewrepo "another paths url" |
|
196 | 175 | store created |
|
197 | 176 | 00changelog.i created |
|
198 | 177 | revlogv1 |
|
199 | 178 | store |
|
200 | 179 | fncache |
|
201 | 180 | dotencode |
|
202 | 181 | |
|
203 | 182 | clone bookmarks |
|
204 | 183 | |
|
205 | 184 | $ hg -R local bookmark test |
|
206 | 185 | $ hg -R local bookmarks |
|
207 | 186 | * test 0:08b9e9f63b32 |
|
208 |
$ hg clone -e "python |
|
|
187 | $ hg clone -e "python $TESTDIR/dummyssh" local ssh://user@dummy/remote-bookmarks | |
|
209 | 188 | searching for changes |
|
210 | 189 | remote: adding changesets |
|
211 | 190 | remote: adding manifests |
|
212 | 191 | remote: adding file changes |
|
213 | 192 | remote: added 1 changesets with 1 changes to 1 files |
|
214 | 193 | $ hg -R remote-bookmarks bookmarks |
|
215 | 194 | test 0:08b9e9f63b32 |
@@ -1,216 +1,193 b'' | |||
|
1 | 1 | This test tries to exercise the ssh functionality with a dummy script |
|
2 | 2 | |
|
3 | $ cat <<EOF > dummyssh | |
|
4 | > import sys | |
|
5 | > import os | |
|
6 | > | |
|
7 | > os.chdir(os.path.dirname(sys.argv[0])) | |
|
8 | > if sys.argv[1] != "user@dummy": | |
|
9 | > sys.exit(-1) | |
|
10 | > | |
|
11 | > if not os.path.exists("dummyssh"): | |
|
12 | > sys.exit(-1) | |
|
13 | > | |
|
14 | > os.environ["SSH_CLIENT"] = "127.0.0.1 1 2" | |
|
15 | > | |
|
16 | > log = open("dummylog", "ab") | |
|
17 | > log.write("Got arguments") | |
|
18 | > for i, arg in enumerate(sys.argv[1:]): | |
|
19 | > log.write(" %d:%s" % (i+1, arg)) | |
|
20 | > log.write("\n") | |
|
21 | > log.close() | |
|
22 | > r = os.system(sys.argv[2]) | |
|
23 | > sys.exit(bool(r)) | |
|
24 | > EOF | |
|
25 | ||
|
26 | creating 'remote | |
|
3 | creating 'remote' repo | |
|
27 | 4 | |
|
28 | 5 | $ hg init remote |
|
29 | 6 | $ cd remote |
|
30 | 7 | $ hg unbundle $TESTDIR/bundles/remote.hg |
|
31 | 8 | adding changesets |
|
32 | 9 | adding manifests |
|
33 | 10 | adding file changes |
|
34 | 11 | added 9 changesets with 7 changes to 4 files (+1 heads) |
|
35 | 12 |
(run 'hg heads' |
|
36 | 13 | $ hg up tip |
|
37 | 14 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
38 | 15 | $ cd .. |
|
39 | 16 | |
|
40 | 17 | clone remote via stream |
|
41 | 18 | |
|
42 | 19 | $ for i in 0 1 2 3 4 5 6 7 8; do |
|
43 |
> hg clone -e "python |
|
|
20 | > hg clone -e "python $TESTDIR/dummyssh" --uncompressed -r "$i" ssh://user@dummy/remote test-"$i" | |
|
44 | 21 | > if cd test-"$i"; then |
|
45 | 22 | > hg verify |
|
46 | 23 | > cd .. |
|
47 | 24 | > fi |
|
48 | 25 | > done |
|
49 | 26 | adding changesets |
|
50 | 27 | adding manifests |
|
51 | 28 | adding file changes |
|
52 | 29 | added 1 changesets with 1 changes to 1 files |
|
53 | 30 | updating to branch default |
|
54 | 31 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
55 | 32 | checking changesets |
|
56 | 33 | checking manifests |
|
57 | 34 | crosschecking files in changesets and manifests |
|
58 | 35 | checking files |
|
59 | 36 | 1 files, 1 changesets, 1 total revisions |
|
60 | 37 | adding changesets |
|
61 | 38 | adding manifests |
|
62 | 39 | adding file changes |
|
63 | 40 | added 2 changesets with 2 changes to 1 files |
|
64 | 41 | updating to branch default |
|
65 | 42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
66 | 43 | checking changesets |
|
67 | 44 | checking manifests |
|
68 | 45 | crosschecking files in changesets and manifests |
|
69 | 46 | checking files |
|
70 | 47 | 1 files, 2 changesets, 2 total revisions |
|
71 | 48 | adding changesets |
|
72 | 49 | adding manifests |
|
73 | 50 | adding file changes |
|
74 | 51 | added 3 changesets with 3 changes to 1 files |
|
75 | 52 | updating to branch default |
|
76 | 53 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
77 | 54 | checking changesets |
|
78 | 55 | checking manifests |
|
79 | 56 | crosschecking files in changesets and manifests |
|
80 | 57 | checking files |
|
81 | 58 | 1 files, 3 changesets, 3 total revisions |
|
82 | 59 | adding changesets |
|
83 | 60 | adding manifests |
|
84 | 61 | adding file changes |
|
85 | 62 | added 4 changesets with 4 changes to 1 files |
|
86 | 63 | updating to branch default |
|
87 | 64 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
88 | 65 | checking changesets |
|
89 | 66 | checking manifests |
|
90 | 67 | crosschecking files in changesets and manifests |
|
91 | 68 | checking files |
|
92 | 69 | 1 files, 4 changesets, 4 total revisions |
|
93 | 70 | adding changesets |
|
94 | 71 | adding manifests |
|
95 | 72 | adding file changes |
|
96 | 73 | added 2 changesets with 2 changes to 1 files |
|
97 | 74 | updating to branch default |
|
98 | 75 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
99 | 76 | checking changesets |
|
100 | 77 | checking manifests |
|
101 | 78 | crosschecking files in changesets and manifests |
|
102 | 79 | checking files |
|
103 | 80 | 1 files, 2 changesets, 2 total revisions |
|
104 | 81 | adding changesets |
|
105 | 82 | adding manifests |
|
106 | 83 | adding file changes |
|
107 | 84 | added 3 changesets with 3 changes to 1 files |
|
108 | 85 | updating to branch default |
|
109 | 86 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
110 | 87 | checking changesets |
|
111 | 88 | checking manifests |
|
112 | 89 | crosschecking files in changesets and manifests |
|
113 | 90 | checking files |
|
114 | 91 | 1 files, 3 changesets, 3 total revisions |
|
115 | 92 | adding changesets |
|
116 | 93 | adding manifests |
|
117 | 94 | adding file changes |
|
118 | 95 | added 4 changesets with 5 changes to 2 files |
|
119 | 96 | updating to branch default |
|
120 | 97 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
121 | 98 | checking changesets |
|
122 | 99 | checking manifests |
|
123 | 100 | crosschecking files in changesets and manifests |
|
124 | 101 | checking files |
|
125 | 102 | 2 files, 4 changesets, 5 total revisions |
|
126 | 103 | adding changesets |
|
127 | 104 | adding manifests |
|
128 | 105 | adding file changes |
|
129 | 106 | added 5 changesets with 6 changes to 3 files |
|
130 | 107 | updating to branch default |
|
131 | 108 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
132 | 109 | checking changesets |
|
133 | 110 | checking manifests |
|
134 | 111 | crosschecking files in changesets and manifests |
|
135 | 112 | checking files |
|
136 | 113 | 3 files, 5 changesets, 6 total revisions |
|
137 | 114 | adding changesets |
|
138 | 115 | adding manifests |
|
139 | 116 | adding file changes |
|
140 | 117 | added 5 changesets with 5 changes to 2 files |
|
141 | 118 | updating to branch default |
|
142 | 119 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
143 | 120 | checking changesets |
|
144 | 121 | checking manifests |
|
145 | 122 | crosschecking files in changesets and manifests |
|
146 | 123 | checking files |
|
147 | 124 | 2 files, 5 changesets, 5 total revisions |
|
148 | 125 | $ cd test-8 |
|
149 | 126 | $ hg pull ../test-7 |
|
150 | 127 | pulling from ../test-7 |
|
151 | 128 | searching for changes |
|
152 | 129 | adding changesets |
|
153 | 130 | adding manifests |
|
154 | 131 | adding file changes |
|
155 | 132 | added 4 changesets with 2 changes to 3 files (+1 heads) |
|
156 | 133 |
(run 'hg heads' |
|
157 | 134 | $ hg verify |
|
158 | 135 | checking changesets |
|
159 | 136 | checking manifests |
|
160 | 137 | crosschecking files in changesets and manifests |
|
161 | 138 | checking files |
|
162 | 139 | 4 files, 9 changesets, 7 total revisions |
|
163 | 140 | $ cd .. |
|
164 | 141 | $ cd test-1 |
|
165 |
$ hg pull -e "python |
|
|
142 | $ hg pull -e "python $TESTDIR/dummyssh" -r 4 ssh://user@dummy/remote | |
|
166 | 143 | pulling from ssh://user@dummy/remote |
|
167 | 144 | searching for changes |
|
168 | 145 | adding changesets |
|
169 | 146 | adding manifests |
|
170 | 147 | adding file changes |
|
171 | 148 | added 1 changesets with 0 changes to 0 files (+1 heads) |
|
172 | 149 |
(run 'hg heads' |
|
173 | 150 | $ hg verify |
|
174 | 151 | checking changesets |
|
175 | 152 | checking manifests |
|
176 | 153 | crosschecking files in changesets and manifests |
|
177 | 154 | checking files |
|
178 | 155 | 1 files, 3 changesets, 2 total revisions |
|
179 |
$ hg pull -e "python |
|
|
156 | $ hg pull -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote | |
|
180 | 157 | pulling from ssh://user@dummy/remote |
|
181 | 158 | searching for changes |
|
182 | 159 | adding changesets |
|
183 | 160 | adding manifests |
|
184 | 161 | adding file changes |
|
185 | 162 | added 6 changesets with 5 changes to 4 files |
|
186 | 163 |
(run 'hg |
|
187 | 164 | $ cd .. |
|
188 | 165 | $ cd test-2 |
|
189 |
$ hg pull -e "python |
|
|
166 | $ hg pull -e "python $TESTDIR/dummyssh" -r 5 ssh://user@dummy/remote | |
|
190 | 167 | pulling from ssh://user@dummy/remote |
|
191 | 168 | searching for changes |
|
192 | 169 | adding changesets |
|
193 | 170 | adding manifests |
|
194 | 171 | adding file changes |
|
195 | 172 | added 2 changesets with 0 changes to 0 files (+1 heads) |
|
196 | 173 |
(run 'hg heads' |
|
197 | 174 | $ hg verify |
|
198 | 175 | checking changesets |
|
199 | 176 | checking manifests |
|
200 | 177 | crosschecking files in changesets and manifests |
|
201 | 178 | checking files |
|
202 | 179 | 1 files, 5 changesets, 3 total revisions |
|
203 |
$ hg pull -e "python |
|
|
180 | $ hg pull -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote | |
|
204 | 181 | pulling from ssh://user@dummy/remote |
|
205 | 182 | searching for changes |
|
206 | 183 | adding changesets |
|
207 | 184 | adding manifests |
|
208 | 185 | adding file changes |
|
209 | 186 | added 4 changesets with 4 changes to 4 files |
|
210 | 187 |
(run 'hg |
|
211 | 188 | $ hg verify |
|
212 | 189 | checking changesets |
|
213 | 190 | checking manifests |
|
214 | 191 | crosschecking files in changesets and manifests |
|
215 | 192 | checking files |
|
216 | 193 | 4 files, 9 changesets, 7 total revisions |
@@ -1,312 +1,290 b'' | |||
|
1 | 1 | |
|
2 | 2 | |
|
3 | 3 | This test tries to exercise the ssh functionality with a dummy script |
|
4 | 4 | |
|
5 | $ cat <<EOF > dummyssh | |
|
6 | > import sys | |
|
7 | > import os | |
|
8 | > | |
|
9 | > os.chdir(os.path.dirname(sys.argv[0])) | |
|
10 | > if sys.argv[1] != "user@dummy": | |
|
11 | > sys.exit(-1) | |
|
12 | > | |
|
13 | > if not os.path.exists("dummyssh"): | |
|
14 | > sys.exit(-1) | |
|
15 | > | |
|
16 | > os.environ["SSH_CLIENT"] = "127.0.0.1 1 2" | |
|
17 | > | |
|
18 | > log = open("dummylog", "ab") | |
|
19 | > log.write("Got arguments") | |
|
20 | > for i, arg in enumerate(sys.argv[1:]): | |
|
21 | > log.write(" %d:%s" % (i+1, arg)) | |
|
22 | > log.write("\n") | |
|
23 | > log.close() | |
|
24 | > r = os.system(sys.argv[2]) | |
|
25 | > sys.exit(bool(r)) | |
|
26 | > EOF | |
|
27 | $ cat <<EOF > badhook | |
|
28 | > import sys | |
|
29 | > sys.stdout.write("KABOOM\n") | |
|
30 | > EOF | |
|
31 | ||
|
32 | 5 | creating 'remote' repo |
|
33 | 6 | |
|
34 | 7 | $ hg init remote |
|
35 | 8 | $ cd remote |
|
36 | 9 | $ echo this > foo |
|
37 | 10 | $ echo this > fooO |
|
38 | 11 | $ hg ci -A -m "init" foo fooO |
|
39 | 12 | $ cat <<EOF > .hg/hgrc |
|
40 | 13 | > [server] |
|
41 | 14 | > uncompressed = True |
|
42 | 15 | > |
|
43 | 16 | > [hooks] |
|
44 | 17 | > changegroup = python "$TESTDIR"/printenv.py changegroup-in-remote 0 ../dummylog |
|
45 | 18 | > EOF |
|
46 | 19 | $ cd .. |
|
47 | 20 | |
|
48 | 21 | repo not found error |
|
49 | 22 | |
|
50 |
$ hg clone -e "python |
|
|
23 | $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/nonexistent local | |
|
51 | 24 | remote: abort: There is no Mercurial repository here (.hg not found)! |
|
52 | 25 | abort: no suitable response from remote hg! |
|
53 | 26 | [255] |
|
54 | 27 | |
|
55 | 28 | non-existent absolute path |
|
56 | 29 | |
|
57 |
$ hg clone -e "python |
|
|
30 | $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy//`pwd`/nonexistent local | |
|
58 | 31 | remote: abort: There is no Mercurial repository here (.hg not found)! |
|
59 | 32 | abort: no suitable response from remote hg! |
|
60 | 33 | [255] |
|
61 | 34 | |
|
62 | 35 | clone remote via stream |
|
63 | 36 | |
|
64 |
$ hg clone -e "python |
|
|
37 | $ hg clone -e "python $TESTDIR/dummyssh" --uncompressed ssh://user@dummy/remote local-stream | |
|
65 | 38 | streaming all changes |
|
66 | 39 | 4 files to transfer, 392 bytes of data |
|
67 | 40 | transferred 392 bytes in * seconds (*/sec) (glob) |
|
68 | 41 | updating to branch default |
|
69 | 42 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
70 | 43 | $ cd local-stream |
|
71 | 44 | $ hg verify |
|
72 | 45 | checking changesets |
|
73 | 46 | checking manifests |
|
74 | 47 | crosschecking files in changesets and manifests |
|
75 | 48 | checking files |
|
76 | 49 | 2 files, 1 changesets, 2 total revisions |
|
77 | 50 | $ cd .. |
|
78 | 51 | |
|
79 | 52 | clone remote via pull |
|
80 | 53 | |
|
81 |
$ hg clone -e "python |
|
|
54 | $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote local | |
|
82 | 55 | requesting all changes |
|
83 | 56 | adding changesets |
|
84 | 57 | adding manifests |
|
85 | 58 | adding file changes |
|
86 | 59 | added 1 changesets with 2 changes to 2 files |
|
87 | 60 | updating to branch default |
|
88 | 61 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
89 | 62 | |
|
90 | 63 | verify |
|
91 | 64 | |
|
92 | 65 | $ cd local |
|
93 | 66 | $ hg verify |
|
94 | 67 | checking changesets |
|
95 | 68 | checking manifests |
|
96 | 69 | crosschecking files in changesets and manifests |
|
97 | 70 | checking files |
|
98 | 71 | 2 files, 1 changesets, 2 total revisions |
|
99 | 72 | $ echo '[hooks]' >> .hg/hgrc |
|
100 | 73 | $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup-in-local 0 ../dummylog' >> .hg/hgrc |
|
101 | 74 | |
|
102 | 75 | empty default pull |
|
103 | 76 | |
|
104 | 77 | $ hg paths |
|
105 | 78 | default = ssh://user@dummy/remote |
|
106 |
$ hg pull -e "python |
|
|
79 | $ hg pull -e "python $TESTDIR/dummyssh" | |
|
107 | 80 | pulling from ssh://user@dummy/remote |
|
108 | 81 | searching for changes |
|
109 | 82 | no changes found |
|
110 | 83 | |
|
111 | 84 | local change |
|
112 | 85 | |
|
113 | 86 | $ echo bleah > foo |
|
114 | 87 | $ hg ci -m "add" |
|
115 | 88 | |
|
116 | 89 | updating rc |
|
117 | 90 | |
|
118 | 91 | $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc |
|
119 | 92 | $ echo "[ui]" >> .hg/hgrc |
|
120 |
$ echo "ssh = python |
|
|
93 | $ echo "ssh = python $TESTDIR/dummyssh" >> .hg/hgrc | |
|
121 | 94 | |
|
122 | 95 | find outgoing |
|
123 | 96 | |
|
124 | 97 | $ hg out ssh://user@dummy/remote |
|
125 | 98 | comparing with ssh://user@dummy/remote |
|
126 | 99 | searching for changes |
|
127 | 100 | changeset: 1:a28a9d1a809c |
|
128 | 101 | tag: tip |
|
129 | 102 | user: test |
|
130 | 103 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
131 | 104 | summary: add |
|
132 | 105 | |
|
133 | 106 | |
|
134 | 107 | find incoming on the remote side |
|
135 | 108 | |
|
136 |
$ hg incoming -R ../remote -e "python |
|
|
109 | $ hg incoming -R ../remote -e "python $TESTDIR/dummyssh" ssh://user@dummy/local | |
|
137 | 110 | comparing with ssh://user@dummy/local |
|
138 | 111 | searching for changes |
|
139 | 112 | changeset: 1:a28a9d1a809c |
|
140 | 113 | tag: tip |
|
141 | 114 | user: test |
|
142 | 115 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
143 | 116 | summary: add |
|
144 | 117 | |
|
145 | 118 | |
|
146 | 119 | find incoming on the remote side (using absolute path) |
|
147 | 120 | |
|
148 |
$ hg incoming -R ../remote -e "python |
|
|
121 | $ hg incoming -R ../remote -e "python $TESTDIR/dummyssh" "ssh://user@dummy/`pwd`" | |
|
149 | 122 | comparing with ssh://user@dummy/$TESTTMP/local |
|
150 | 123 | searching for changes |
|
151 | 124 | changeset: 1:a28a9d1a809c |
|
152 | 125 | tag: tip |
|
153 | 126 | user: test |
|
154 | 127 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
155 | 128 | summary: add |
|
156 | 129 | |
|
157 | 130 | |
|
158 | 131 | push |
|
159 | 132 | |
|
160 | 133 | $ hg push |
|
161 | 134 | pushing to ssh://user@dummy/remote |
|
162 | 135 | searching for changes |
|
163 | 136 | remote: adding changesets |
|
164 | 137 | remote: adding manifests |
|
165 | 138 | remote: adding file changes |
|
166 | 139 | remote: added 1 changesets with 1 changes to 1 files |
|
167 | 140 | $ cd ../remote |
|
168 | 141 | |
|
169 | 142 | check remote tip |
|
170 | 143 | |
|
171 | 144 | $ hg tip |
|
172 | 145 | changeset: 1:a28a9d1a809c |
|
173 | 146 | tag: tip |
|
174 | 147 | user: test |
|
175 | 148 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
176 | 149 | summary: add |
|
177 | 150 | |
|
178 | 151 | $ hg verify |
|
179 | 152 | checking changesets |
|
180 | 153 | checking manifests |
|
181 | 154 | crosschecking files in changesets and manifests |
|
182 | 155 | checking files |
|
183 | 156 | 2 files, 2 changesets, 3 total revisions |
|
184 | 157 | $ hg cat -r tip foo |
|
185 | 158 | bleah |
|
186 | 159 | $ echo z > z |
|
187 | 160 | $ hg ci -A -m z z |
|
188 | 161 | created new head |
|
189 | 162 | |
|
190 | 163 | test pushkeys and bookmarks |
|
191 | 164 | |
|
192 | 165 | $ cd ../local |
|
193 |
$ hg debugpushkey --config ui.ssh="python |
|
|
166 | $ hg debugpushkey --config ui.ssh="python $TESTDIR/dummyssh" ssh://user@dummy/remote namespaces | |
|
194 | 167 | bookmarks |
|
195 | 168 | namespaces |
|
196 | 169 | $ hg book foo -r 0 |
|
197 | 170 | $ hg out -B |
|
198 | 171 | comparing with ssh://user@dummy/remote |
|
199 | 172 | searching for changed bookmarks |
|
200 | 173 | foo 1160648e36ce |
|
201 | 174 | $ hg push -B foo |
|
202 | 175 | pushing to ssh://user@dummy/remote |
|
203 | 176 | searching for changes |
|
204 | 177 | no changes found |
|
205 | 178 | exporting bookmark foo |
|
206 |
$ hg debugpushkey --config ui.ssh="python |
|
|
179 | $ hg debugpushkey --config ui.ssh="python $TESTDIR/dummyssh" ssh://user@dummy/remote bookmarks | |
|
207 | 180 | foo 1160648e36cec0054048a7edc4110c6f84fde594 |
|
208 | 181 | $ hg book -f foo |
|
209 | 182 | $ hg push --traceback |
|
210 | 183 | pushing to ssh://user@dummy/remote |
|
211 | 184 | searching for changes |
|
212 | 185 | no changes found |
|
213 | 186 | updating bookmark foo |
|
214 | 187 | $ hg book -d foo |
|
215 | 188 | $ hg in -B |
|
216 | 189 | comparing with ssh://user@dummy/remote |
|
217 | 190 | searching for changed bookmarks |
|
218 | 191 | foo a28a9d1a809c |
|
219 | 192 | $ hg book -f -r 0 foo |
|
220 | 193 | $ hg pull -B foo |
|
221 | 194 | pulling from ssh://user@dummy/remote |
|
222 | 195 | no changes found |
|
223 | 196 | updating bookmark foo |
|
224 | 197 | importing bookmark foo |
|
225 | 198 | $ hg book -d foo |
|
226 | 199 | $ hg push -B foo |
|
227 | 200 | pushing to ssh://user@dummy/remote |
|
228 | 201 | searching for changes |
|
229 | 202 | no changes found |
|
230 | 203 | deleting remote bookmark foo |
|
231 | 204 | |
|
232 | 205 | a bad, evil hook that prints to stdout |
|
233 | 206 | |
|
207 | $ cat <<EOF > $TESTTMP/badhook | |
|
208 | > import sys | |
|
209 | > sys.stdout.write("KABOOM\n") | |
|
210 | > EOF | |
|
211 | ||
|
234 | 212 | $ echo '[hooks]' >> ../remote/.hg/hgrc |
|
235 |
$ echo |
|
|
213 | $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc | |
|
236 | 214 | $ echo r > r |
|
237 | 215 | $ hg ci -A -m z r |
|
238 | 216 | |
|
239 | 217 | push should succeed even though it has an unexpected response |
|
240 | 218 | |
|
241 | 219 | $ hg push |
|
242 | 220 | pushing to ssh://user@dummy/remote |
|
243 | 221 | searching for changes |
|
244 | 222 | note: unsynced remote changes! |
|
245 | 223 | remote: adding changesets |
|
246 | 224 | remote: adding manifests |
|
247 | 225 | remote: adding file changes |
|
248 | 226 | remote: added 1 changesets with 1 changes to 1 files |
|
249 | 227 | remote: KABOOM |
|
250 | 228 | $ hg -R ../remote heads |
|
251 | 229 | changeset: 3:1383141674ec |
|
252 | 230 | tag: tip |
|
253 | 231 | parent: 1:a28a9d1a809c |
|
254 | 232 | user: test |
|
255 | 233 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
256 | 234 | summary: z |
|
257 | 235 | |
|
258 | 236 | changeset: 2:6c0482d977a3 |
|
259 | 237 | parent: 0:1160648e36ce |
|
260 | 238 | user: test |
|
261 | 239 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
262 | 240 | summary: z |
|
263 | 241 | |
|
264 | 242 | |
|
265 | 243 | clone bookmarks |
|
266 | 244 | |
|
267 | 245 | $ hg -R ../remote bookmark test |
|
268 | 246 | $ hg -R ../remote bookmarks |
|
269 | 247 | * test 2:6c0482d977a3 |
|
270 |
$ hg clone -e "python |
|
|
248 | $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote local-bookmarks | |
|
271 | 249 | requesting all changes |
|
272 | 250 | adding changesets |
|
273 | 251 | adding manifests |
|
274 | 252 | adding file changes |
|
275 | 253 | added 4 changesets with 5 changes to 4 files (+1 heads) |
|
276 | 254 | updating to branch default |
|
277 | 255 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
278 | 256 | $ hg -R local-bookmarks bookmarks |
|
279 | 257 | test 2:6c0482d977a3 |
|
280 | 258 | |
|
281 | 259 | passwords in ssh urls are not supported |
|
282 | 260 | (we use a glob here because different Python versions give different |
|
283 | 261 | results here) |
|
284 | 262 | |
|
285 | 263 | $ hg push ssh://user:erroneouspwd@dummy/remote |
|
286 | 264 | pushing to ssh://user:*@dummy/remote (glob) |
|
287 | 265 | abort: password in URL not supported! |
|
288 | 266 | [255] |
|
289 | 267 | |
|
290 | 268 | $ cd .. |
|
291 | 269 | $ cat dummylog |
|
292 | 270 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio |
|
293 | 271 | Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio |
|
294 | 272 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
295 | 273 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
296 | 274 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
297 | 275 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
298 | 276 | Got arguments 1:user@dummy 2:hg -R local serve --stdio |
|
299 | 277 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio |
|
300 | 278 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
301 | 279 | changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
|
302 | 280 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
303 | 281 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
304 | 282 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
305 | 283 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
306 | 284 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
307 | 285 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
308 | 286 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
309 | 287 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
310 | 288 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
311 | 289 | changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
|
312 | 290 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
General Comments 0
You need to be logged in to leave comments.
Login now