| 1 |
This test tries to exercise the ssh functionality with a dummy script |
| 2 |
|
| 3 |
$ checknewrepo() |
| 4 |
> { |
| 5 |
> name=$1 |
| 6 |
> if [ -d "$name"/.hg/store ]; then |
| 7 |
> echo store created |
| 8 |
> fi |
| 9 |
> if [ -f "$name"/.hg/00changelog.i ]; then |
| 10 |
> echo 00changelog.i created |
| 11 |
> fi |
| 12 |
> hg debugrequires -R "$name" |
| 13 |
> } |
| 14 |
|
| 15 |
creating 'local' |
| 16 |
|
| 17 |
$ hg init local |
| 18 |
$ checknewrepo local |
| 19 |
store created |
| 20 |
00changelog.i created |
| 21 |
dotencode |
| 22 |
dirstate-v2 (dirstate-v2 !) |
| 23 |
fncache |
| 24 |
generaldelta |
| 25 |
persistent-nodemap (rust !) |
| 26 |
revlog-compression-zstd (zstd !) |
| 27 |
revlogv1 |
| 28 |
share-safe |
| 29 |
sparserevlog |
| 30 |
store |
| 31 |
$ echo this > local/foo |
| 32 |
$ hg ci --cwd local -A -m "init" |
| 33 |
adding foo |
| 34 |
|
| 35 |
test custom revlog chunk cache sizes |
| 36 |
|
| 37 |
$ hg --config format.chunkcachesize=0 log -R local -pv |
| 38 |
abort: revlog chunk cache size 0 is not greater than 0 |
| 39 |
[50] |
| 40 |
$ hg --config format.chunkcachesize=1023 log -R local -pv |
| 41 |
abort: revlog chunk cache size 1023 is not a power of 2 |
| 42 |
[50] |
| 43 |
$ hg --config format.chunkcachesize=1024 log -R local -pv |
| 44 |
changeset: 0:08b9e9f63b32 |
| 45 |
tag: tip |
| 46 |
user: test |
| 47 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 48 |
files: foo |
| 49 |
description: |
| 50 |
init |
| 51 |
|
| 52 |
|
| 53 |
diff -r 000000000000 -r 08b9e9f63b32 foo |
| 54 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 55 |
+++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
| 56 |
@@ -0,0 +1,1 @@ |
| 57 |
+this |
| 58 |
|
| 59 |
|
| 60 |
creating repo with format.usestore=false |
| 61 |
|
| 62 |
$ hg --config format.usestore=false init old |
| 63 |
$ checknewrepo old |
| 64 |
dirstate-v2 (dirstate-v2 !) |
| 65 |
generaldelta |
| 66 |
persistent-nodemap (rust !) |
| 67 |
revlog-compression-zstd (zstd !) |
| 68 |
revlogv1 |
| 69 |
sparserevlog |
| 70 |
|
| 71 |
creating repo with format.usefncache=false |
| 72 |
|
| 73 |
$ hg --config format.usefncache=false init old2 |
| 74 |
$ checknewrepo old2 |
| 75 |
store created |
| 76 |
00changelog.i created |
| 77 |
dirstate-v2 (dirstate-v2 !) |
| 78 |
generaldelta |
| 79 |
persistent-nodemap (rust !) |
| 80 |
revlog-compression-zstd (zstd !) |
| 81 |
revlogv1 |
| 82 |
share-safe |
| 83 |
sparserevlog |
| 84 |
store |
| 85 |
|
| 86 |
creating repo with format.dotencode=false |
| 87 |
|
| 88 |
$ hg --config format.dotencode=false init old3 |
| 89 |
$ checknewrepo old3 |
| 90 |
store created |
| 91 |
00changelog.i created |
| 92 |
dirstate-v2 (dirstate-v2 !) |
| 93 |
fncache |
| 94 |
generaldelta |
| 95 |
persistent-nodemap (rust !) |
| 96 |
revlog-compression-zstd (zstd !) |
| 97 |
revlogv1 |
| 98 |
share-safe |
| 99 |
sparserevlog |
| 100 |
store |
| 101 |
|
| 102 |
creating repo with format.dotencode=false |
| 103 |
|
| 104 |
$ hg --config format.generaldelta=false --config format.usegeneraldelta=false --config format.sparse-revlog=no init old4 |
| 105 |
$ checknewrepo old4 |
| 106 |
store created |
| 107 |
00changelog.i created |
| 108 |
dotencode |
| 109 |
dirstate-v2 (dirstate-v2 !) |
| 110 |
fncache |
| 111 |
persistent-nodemap (rust !) |
| 112 |
revlog-compression-zstd (zstd !) |
| 113 |
revlogv1 |
| 114 |
share-safe |
| 115 |
store |
| 116 |
|
| 117 |
test failure |
| 118 |
|
| 119 |
$ hg init local |
| 120 |
abort: repository local already exists |
| 121 |
[255] |
| 122 |
|
| 123 |
init+push to remote2 |
| 124 |
|
| 125 |
$ hg init ssh://user@dummy/remote2 |
| 126 |
$ hg incoming -R remote2 local |
| 127 |
comparing with local |
| 128 |
changeset: 0:08b9e9f63b32 |
| 129 |
tag: tip |
| 130 |
user: test |
| 131 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 132 |
summary: init |
| 133 |
|
| 134 |
|
| 135 |
$ hg push -R local ssh://user@dummy/remote2 |
| 136 |
pushing to ssh://user@dummy/remote2 |
| 137 |
searching for changes |
| 138 |
remote: adding changesets |
| 139 |
remote: adding manifests |
| 140 |
remote: adding file changes |
| 141 |
remote: added 1 changesets with 1 changes to 1 files |
| 142 |
|
| 143 |
clone to remote1 |
| 144 |
|
| 145 |
$ hg clone local ssh://user@dummy/remote1 |
| 146 |
searching for changes |
| 147 |
remote: adding changesets |
| 148 |
remote: adding manifests |
| 149 |
remote: adding file changes |
| 150 |
remote: added 1 changesets with 1 changes to 1 files |
| 151 |
|
| 152 |
The largefiles extension doesn't crash |
| 153 |
$ hg clone local ssh://user@dummy/remotelf --config extensions.largefiles= |
| 154 |
The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) |
| 155 |
The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) |
| 156 |
searching for changes |
| 157 |
remote: adding changesets |
| 158 |
remote: adding manifests |
| 159 |
remote: adding file changes |
| 160 |
remote: added 1 changesets with 1 changes to 1 files |
| 161 |
|
| 162 |
init to existing repo |
| 163 |
|
| 164 |
$ hg init ssh://user@dummy/remote1 |
| 165 |
abort: repository remote1 already exists |
| 166 |
abort: could not create remote repo |
| 167 |
[255] |
| 168 |
|
| 169 |
clone to existing repo |
| 170 |
|
| 171 |
$ hg clone local ssh://user@dummy/remote1 |
| 172 |
abort: repository remote1 already exists |
| 173 |
abort: could not create remote repo |
| 174 |
[255] |
| 175 |
|
| 176 |
output of dummyssh |
| 177 |
|
| 178 |
$ cat dummylog |
| 179 |
Got arguments 1:user@dummy 2:hg init remote2 |
| 180 |
Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio |
| 181 |
Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio |
| 182 |
Got arguments 1:user@dummy 2:hg init remote1 |
| 183 |
Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio |
| 184 |
Got arguments 1:user@dummy 2:hg init remotelf |
| 185 |
Got arguments 1:user@dummy 2:hg -R remotelf serve --stdio |
| 186 |
Got arguments 1:user@dummy 2:hg init remote1 |
| 187 |
Got arguments 1:user@dummy 2:hg init remote1 |
| 188 |
|
| 189 |
comparing repositories |
| 190 |
|
| 191 |
$ hg tip -q -R local |
| 192 |
0:08b9e9f63b32 |
| 193 |
$ hg tip -q -R remote1 |
| 194 |
0:08b9e9f63b32 |
| 195 |
$ hg tip -q -R remote2 |
| 196 |
0:08b9e9f63b32 |
| 197 |
|
| 198 |
check names for repositories (clashes with URL schemes, special chars) |
| 199 |
|
| 200 |
$ for i in bundle file hg http https old-http ssh static-http "with space"; do |
| 201 |
> printf "hg init \"$i\"... " |
| 202 |
> hg init "$i" |
| 203 |
> test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed" |
| 204 |
> done |
| 205 |
hg init "bundle"... ok |
| 206 |
hg init "file"... ok |
| 207 |
hg init "hg"... ok |
| 208 |
hg init "http"... ok |
| 209 |
hg init "https"... ok |
| 210 |
hg init "old-http"... ok |
| 211 |
hg init "ssh"... ok |
| 212 |
hg init "static-http"... ok |
| 213 |
hg init "with space"... ok |
| 214 |
#if eol-in-paths |
| 215 |
/* " " is not a valid name for a directory on Windows */ |
| 216 |
$ hg init " " |
| 217 |
$ test -d " " |
| 218 |
$ test -d " /.hg" |
| 219 |
#endif |
| 220 |
|
| 221 |
creating 'local/sub/repo' |
| 222 |
|
| 223 |
$ hg init local/sub/repo |
| 224 |
$ checknewrepo local/sub/repo |
| 225 |
store created |
| 226 |
00changelog.i created |
| 227 |
dotencode |
| 228 |
dirstate-v2 (dirstate-v2 !) |
| 229 |
fncache |
| 230 |
generaldelta |
| 231 |
persistent-nodemap (rust !) |
| 232 |
revlog-compression-zstd (zstd !) |
| 233 |
revlogv1 |
| 234 |
share-safe |
| 235 |
sparserevlog |
| 236 |
store |
| 237 |
|
| 238 |
prepare test of init of url configured from paths |
| 239 |
|
| 240 |
$ echo '[paths]' >> $HGRCPATH |
| 241 |
$ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH |
| 242 |
$ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH |
| 243 |
|
| 244 |
init should (for consistency with clone) expand the url |
| 245 |
|
| 246 |
$ hg init somewhere |
| 247 |
$ checknewrepo "url from paths" |
| 248 |
store created |
| 249 |
00changelog.i created |
| 250 |
dotencode |
| 251 |
dirstate-v2 (dirstate-v2 !) |
| 252 |
fncache |
| 253 |
generaldelta |
| 254 |
persistent-nodemap (rust !) |
| 255 |
revlog-compression-zstd (zstd !) |
| 256 |
revlogv1 |
| 257 |
share-safe |
| 258 |
sparserevlog |
| 259 |
store |
| 260 |
|
| 261 |
verify that clone also expand urls |
| 262 |
|
| 263 |
$ hg clone somewhere elsewhere |
| 264 |
updating to branch default |
| 265 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 266 |
$ checknewrepo "another paths url" |
| 267 |
store created |
| 268 |
00changelog.i created |
| 269 |
dotencode |
| 270 |
dirstate-v2 (dirstate-v2 !) |
| 271 |
fncache |
| 272 |
generaldelta |
| 273 |
persistent-nodemap (rust !) |
| 274 |
revlog-compression-zstd (zstd !) |
| 275 |
revlogv1 |
| 276 |
share-safe |
| 277 |
sparserevlog |
| 278 |
store |
| 279 |
|
| 280 |
clone bookmarks |
| 281 |
|
| 282 |
$ hg -R local bookmark test |
| 283 |
$ hg -R local bookmarks |
| 284 |
* test 0:08b9e9f63b32 |
| 285 |
$ hg clone local ssh://user@dummy/remote-bookmarks |
| 286 |
searching for changes |
| 287 |
remote: adding changesets |
| 288 |
remote: adding manifests |
| 289 |
remote: adding file changes |
| 290 |
remote: added 1 changesets with 1 changes to 1 files |
| 291 |
exporting bookmark test |
| 292 |
$ hg -R remote-bookmarks bookmarks |
| 293 |
test 0:08b9e9f63b32 |
| 294 |
|
| 295 |
Check format constraint |
| 296 |
----------------------- |
| 297 |
|
| 298 |
$ hg init issue6056 --config format.usegeneraldelta=0 --config format.sparse-revlog=0 |
| 299 |
$ cd issue6056 |
| 300 |
$ echo foo > 1 |
| 301 |
$ echo foo > 2 |
| 302 |
$ echo foo > 3 |
| 303 |
$ echo foo > 4 |
| 304 |
$ echo foo > 5 |
| 305 |
$ hg add * |
| 306 |
|
| 307 |
Build a bogus repository (sparserevlog without general delta) |
| 308 |
|
| 309 |
$ hg commit -m 'initial changesets' |
| 310 |
$ echo 'sparserevlog' >> .hg/requires |
| 311 |
$ for x in `$TESTDIR/seq.py 100`; do |
| 312 |
> echo $x >> `expr $x % 5 + 1` |
| 313 |
> hg commit -m $x |
| 314 |
> done |
| 315 |
$ cd .. |