##// END OF EJS Templates
tests: add test of stream clone of repo that is changing...
Mads Kiilerich -
r28517:95163aba stable
parent child Browse files
Show More
@@ -50,3 +50,48 b' Clone with background file closing enabl'
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.
General Comments 0
You need to be logged in to leave comments. Login now