##// END OF EJS Templates
clone: don't fail with --update for non-local clones (issue3578)...
Augie Fackler -
r17342:471f30d3 stable
parent child Browse files
Show More
@@ -398,7 +398,7 b' def clone(ui, peeropts, source, dest=Non'
398 398
399 399 if update:
400 400 if update is not True:
401 checkout = srcrepo.lookup(update)
401 checkout = srcpeer.lookup(update)
402 402 for test in (checkout, 'default', 'tip'):
403 403 if test is None:
404 404 continue
@@ -77,6 +77,24 b' clone via pull'
77 77 adding bar
78 78 $ cd ..
79 79
80 clone over http with --update
81
82 $ hg clone http://localhost:$HGPORT1/ updated --update 0
83 requesting all changes
84 adding changesets
85 adding manifests
86 adding file changes
87 added 2 changesets with 5 changes to 5 files
88 updating to branch default
89 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 $ hg log -r . -R updated
91 changeset: 0:8b6053c928fe
92 user: test
93 date: Thu Jan 01 00:00:00 1970 +0000
94 summary: 1
95
96 $ rm -rf updated
97
80 98 incoming via HTTP
81 99
82 100 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
@@ -129,7 +147,7 b' test http authentication'
129 147 > if not auth:
130 148 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
131 149 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
132 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
150 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
133 151 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
134 152 > def extsetup():
135 153 > common.permhooks.insert(0, perform_authentication)
@@ -138,24 +156,24 b' test http authentication'
138 156 > --config server.preferuncompressed=True
139 157 $ cat pid >> $DAEMON_PIDS
140 158
141 $ hg id http://localhost:$HGPORT2/
159 $ hg id http://localhost:$HGPORT2/
142 160 abort: http authorization required
143 161 [255]
144 $ hg id http://user@localhost:$HGPORT2/
162 $ hg id http://user@localhost:$HGPORT2/
145 163 abort: http authorization required
146 164 [255]
147 165 $ hg id http://user:pass@localhost:$HGPORT2/
148 166 5fed3813f7f5
149 $ echo '[auth]' >> .hg/hgrc
167 $ echo '[auth]' >> .hg/hgrc
150 168 $ echo 'l.schemes=http' >> .hg/hgrc
151 169 $ echo 'l.prefix=lo' >> .hg/hgrc
152 170 $ echo 'l.username=user' >> .hg/hgrc
153 171 $ echo 'l.password=pass' >> .hg/hgrc
154 $ hg id http://localhost:$HGPORT2/
172 $ hg id http://localhost:$HGPORT2/
155 173 5fed3813f7f5
156 $ hg id http://localhost:$HGPORT2/
174 $ hg id http://localhost:$HGPORT2/
157 175 5fed3813f7f5
158 $ hg id http://user@localhost:$HGPORT2/
176 $ hg id http://user@localhost:$HGPORT2/
159 177 5fed3813f7f5
160 178 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
161 179 streaming all changes
@@ -164,7 +182,7 b' test http authentication'
164 182 updating to branch default
165 183 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 184
167 $ hg id http://user2@localhost:$HGPORT2/
185 $ hg id http://user2@localhost:$HGPORT2/
168 186 abort: http authorization required
169 187 [255]
170 188 $ hg id http://user:pass2@localhost:$HGPORT2/
General Comments 0
You need to be logged in to leave comments. Login now