comparison tests/test-clone-uncompressed.t @ 28517:95163ababeb8 stable

tests: add test of stream clone of repo that is changing This reveals an error introduced by 9fea6b38a8da.
author Mads Kiilerich <madski@unity3d.com>
date Sun, 13 Mar 2016 02:28:46 +0100
parents 9ab45fbe045e
children aa440c3d7c5d
comparison
equal deleted inserted replaced
28390:48e1a641765d 28517:95163ababeb8
48 bundle2-input-bundle: 1 parts total 48 bundle2-input-bundle: 1 parts total
49 checking for updated bookmarks 49 checking for updated bookmarks
50 preparing listkeys for "phases" 50 preparing listkeys for "phases"
51 sending listkeys command 51 sending listkeys command
52 received listkey for "phases": 58 bytes 52 received listkey for "phases": 58 bytes
53
54
55 Stream clone while repo is changing:
56
57 $ mkdir changing
58 $ cd changing
59
60 extension for delaying the server process so we reliably can modify the repo
61 while cloning
62
63 $ cat > delayer.py <<EOF
64 > import time
65 > from mercurial import extensions, scmutil
66 > def __call__(orig, self, path, *args, **kwargs):
67 > if path == 'data/f1.i':
68 > time.sleep(2)
69 > return orig(self, path, *args, **kwargs)
70 > extensions.wrapfunction(scmutil.vfs, '__call__', __call__)
71 > EOF
72
73 prepare repo with small and big file to cover both code paths in emitrevlogdata
74
75 $ hg init repo
76 $ touch repo/f1
77 $ $TESTDIR/seq.py 50000 > repo/f2
78 $ hg -R repo ci -Aqm "0"
79 $ hg -R repo serve -p $HGPORT1 -d --pid-file=hg.pid --config extensions.delayer=delayer.py
80 $ cat hg.pid >> $DAEMON_PIDS
81
82 clone while modifying the repo between stating file with write lock and
83 actually serving file content
84
85 $ hg clone -q --uncompressed -U http://localhost:$HGPORT1 clone &
86 $ sleep 1
87 $ echo >> repo/f1
88 $ echo >> repo/f2
89 $ hg -R repo ci -m "1"
90 $ wait
91 abort: unexpected response from remote server:
92 '*\n' (glob)
93 $ hg -R clone id
94 abort: repository clone not found!
95 [255]
96
97 the current clone error is a regression from 9fea6b38a8da.