comparison tests/test-clone-uncompressed.t @ 34393:fffd3369aa83

commands: rename clone --uncompressed to --stream and document --uncompressed isn't a very good name and its description in the help documentation isn't very useful. We refer to this concept as "stream clones" in a number of places. I think it makes sense to change the user-facing argument to use the mode --stream. So this commit does that. We keep --uncompressed around for backwards compatibility. While we're here, we overhaul the help docs for streaming clones to be somewhat useful. All tests have been updated to reflect the new preferred --stream argument. A test for backwards compatibility of --uncompressed has been added. .. bc:: `hg clone --stream` should now be used instead of --uncompressed. --uncompressed is marked as deprecated and is an alias for --stream. There is no schedule for elimination of --uncompressed. Differential Revision: https://phab.mercurial-scm.org/D864
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 01 Oct 2017 11:29:20 +0100
parents 10e162bb9bf5
children a6d95a8b7243
comparison
equal deleted inserted replaced
34392:aea6344e989b 34393:fffd3369aa83
16 $ cat hg.pid >> $DAEMON_PIDS 16 $ cat hg.pid >> $DAEMON_PIDS
17 $ cd .. 17 $ cd ..
18 18
19 Basic clone 19 Basic clone
20 20
21 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1 21 $ hg clone --stream -U http://localhost:$HGPORT clone1
22 streaming all changes
23 1027 files to transfer, 96.3 KB of data
24 transferred 96.3 KB in * seconds (*/sec) (glob)
25 searching for changes
26 no changes found
27
28 --uncompressed is an alias to --stream
29
30 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
22 streaming all changes 31 streaming all changes
23 1027 files to transfer, 96.3 KB of data 32 1027 files to transfer, 96.3 KB of data
24 transferred 96.3 KB in * seconds (*/sec) (glob) 33 transferred 96.3 KB in * seconds (*/sec) (glob)
25 searching for changes 34 searching for changes
26 no changes found 35 no changes found
27 36
28 Clone with background file closing enabled 37 Clone with background file closing enabled
29 38
30 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --uncompressed -U http://localhost:$HGPORT clone-background | grep -v adding 39 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
31 using http://localhost:$HGPORT/ 40 using http://localhost:$HGPORT/
32 sending capabilities command 41 sending capabilities command
33 sending branchmap command 42 sending branchmap command
34 streaming all changes 43 streaming all changes
35 sending stream_out command 44 sending stream_out command
50 checking for updated bookmarks 59 checking for updated bookmarks
51 60
52 Cannot stream clone when there are secret changesets 61 Cannot stream clone when there are secret changesets
53 62
54 $ hg -R server phase --force --secret -r tip 63 $ hg -R server phase --force --secret -r tip
55 $ hg clone --uncompressed -U http://localhost:$HGPORT secret-denied 64 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
56 warning: stream clone requested but server has them disabled 65 warning: stream clone requested but server has them disabled
57 requesting all changes 66 requesting all changes
58 adding changesets 67 adding changesets
59 adding manifests 68 adding manifests
60 adding file changes 69 adding file changes
67 $ cd server 76 $ cd server
68 $ hg --config server.uncompressedallowsecret=true serve -p $HGPORT -d --pid-file=hg.pid 77 $ hg --config server.uncompressedallowsecret=true serve -p $HGPORT -d --pid-file=hg.pid
69 $ cat hg.pid > $DAEMON_PIDS 78 $ cat hg.pid > $DAEMON_PIDS
70 $ cd .. 79 $ cd ..
71 80
72 $ hg clone --uncompressed -U http://localhost:$HGPORT secret-allowed 81 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
73 streaming all changes 82 streaming all changes
74 1027 files to transfer, 96.3 KB of data 83 1027 files to transfer, 96.3 KB of data
75 transferred 96.3 KB in * seconds (*/sec) (glob) 84 transferred 96.3 KB in * seconds (*/sec) (glob)
76 searching for changes 85 searching for changes
77 no changes found 86 no changes found
99 $ cd server 108 $ cd server
100 $ hg --config server.disablefullbundle=true serve -p $HGPORT -d --pid-file=hg.pid 109 $ hg --config server.disablefullbundle=true serve -p $HGPORT -d --pid-file=hg.pid
101 $ cat hg.pid > $DAEMON_PIDS 110 $ cat hg.pid > $DAEMON_PIDS
102 $ cd .. 111 $ cd ..
103 112
104 $ hg clone --uncompressed http://localhost:$HGPORT secret-full-disabled 113 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
105 warning: stream clone requested but server has them disabled 114 warning: stream clone requested but server has them disabled
106 requesting all changes 115 requesting all changes
107 remote: abort: server has pull-based clones disabled 116 remote: abort: server has pull-based clones disabled
108 abort: pull failed on remote 117 abort: pull failed on remote
109 (remove --pull if specified or upgrade Mercurial) 118 (remove --pull if specified or upgrade Mercurial)
111 120
112 Local stream clone with secrets involved 121 Local stream clone with secrets involved
113 (This is just a test over behavior: if you have access to the repo's files, 122 (This is just a test over behavior: if you have access to the repo's files,
114 there is no security so it isn't important to prevent a clone here.) 123 there is no security so it isn't important to prevent a clone here.)
115 124
116 $ hg clone -U --uncompressed server local-secret 125 $ hg clone -U --stream server local-secret
117 warning: stream clone requested but server has them disabled 126 warning: stream clone requested but server has them disabled
118 requesting all changes 127 requesting all changes
119 adding changesets 128 adding changesets
120 adding manifests 129 adding manifests
121 adding file changes 130 adding file changes
149 $ cat hg.pid >> $DAEMON_PIDS 158 $ cat hg.pid >> $DAEMON_PIDS
150 159
151 clone while modifying the repo between stating file with write lock and 160 clone while modifying the repo between stating file with write lock and
152 actually serving file content 161 actually serving file content
153 162
154 $ hg clone -q --uncompressed -U http://localhost:$HGPORT1 clone & 163 $ hg clone -q --stream -U http://localhost:$HGPORT1 clone &
155 $ sleep 1 164 $ sleep 1
156 $ echo >> repo/f1 165 $ echo >> repo/f1
157 $ echo >> repo/f2 166 $ echo >> repo/f2
158 $ hg -R repo ci -m "1" 167 $ hg -R repo ci -m "1"
159 $ wait 168 $ wait