##// END OF EJS Templates
infinitepush: aggressively deprecated infinite push...
pierre-yves.david@ens-lyon.org -
r51597:68c4f8f3 default
parent child Browse files
Show More
@@ -1,1388 +1,1413 b''
1 # Infinite push
1 # Infinite push
2 #
2 #
3 # Copyright 2016 Facebook, Inc.
3 # Copyright 2016 Facebook, Inc.
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7 """ store some pushes in a remote blob store on the server (EXPERIMENTAL)
7 """ store some pushes in a remote blob store on the server (EXPERIMENTAL)
8
8
9 IMPORTANT: if you use this extension, please contact
9 IMPORTANT: if you use this extension, please contact
10 mercurial-devel@mercurial-scm.org ASAP. This extension is believed to
10 mercurial-devel@mercurial-scm.org ASAP. This extension is believed to
11 be unused and barring learning of users of this functionality, we will
11 be unused and barring learning of users of this functionality, we will
12 delete this code at the end of 2020.
12 delete this code at the end of 2020.
13
13
14 [infinitepush]
14 [infinitepush]
15 # Server-side and client-side option. Pattern of the infinitepush bookmark
15 # Server-side and client-side option. Pattern of the infinitepush bookmark
16 branchpattern = PATTERN
16 branchpattern = PATTERN
17
17
18 # Server or client
18 # Server or client
19 server = False
19 server = False
20
20
21 # Server-side option. Possible values: 'disk' or 'sql'. Fails if not set
21 # Server-side option. Possible values: 'disk' or 'sql'. Fails if not set
22 indextype = disk
22 indextype = disk
23
23
24 # Server-side option. Used only if indextype=sql.
24 # Server-side option. Used only if indextype=sql.
25 # Format: 'IP:PORT:DB_NAME:USER:PASSWORD'
25 # Format: 'IP:PORT:DB_NAME:USER:PASSWORD'
26 sqlhost = IP:PORT:DB_NAME:USER:PASSWORD
26 sqlhost = IP:PORT:DB_NAME:USER:PASSWORD
27
27
28 # Server-side option. Used only if indextype=disk.
28 # Server-side option. Used only if indextype=disk.
29 # Filesystem path to the index store
29 # Filesystem path to the index store
30 indexpath = PATH
30 indexpath = PATH
31
31
32 # Server-side option. Possible values: 'disk' or 'external'
32 # Server-side option. Possible values: 'disk' or 'external'
33 # Fails if not set
33 # Fails if not set
34 storetype = disk
34 storetype = disk
35
35
36 # Server-side option.
36 # Server-side option.
37 # Path to the binary that will save bundle to the bundlestore
37 # Path to the binary that will save bundle to the bundlestore
38 # Formatted cmd line will be passed to it (see `put_args`)
38 # Formatted cmd line will be passed to it (see `put_args`)
39 put_binary = put
39 put_binary = put
40
40
41 # Serser-side option. Used only if storetype=external.
41 # Serser-side option. Used only if storetype=external.
42 # Format cmd-line string for put binary. Placeholder: {filename}
42 # Format cmd-line string for put binary. Placeholder: {filename}
43 put_args = {filename}
43 put_args = {filename}
44
44
45 # Server-side option.
45 # Server-side option.
46 # Path to the binary that get bundle from the bundlestore.
46 # Path to the binary that get bundle from the bundlestore.
47 # Formatted cmd line will be passed to it (see `get_args`)
47 # Formatted cmd line will be passed to it (see `get_args`)
48 get_binary = get
48 get_binary = get
49
49
50 # Serser-side option. Used only if storetype=external.
50 # Serser-side option. Used only if storetype=external.
51 # Format cmd-line string for get binary. Placeholders: {filename} {handle}
51 # Format cmd-line string for get binary. Placeholders: {filename} {handle}
52 get_args = {filename} {handle}
52 get_args = {filename} {handle}
53
53
54 # Server-side option
54 # Server-side option
55 logfile = FIlE
55 logfile = FIlE
56
56
57 # Server-side option
57 # Server-side option
58 loglevel = DEBUG
58 loglevel = DEBUG
59
59
60 # Server-side option. Used only if indextype=sql.
60 # Server-side option. Used only if indextype=sql.
61 # Sets mysql wait_timeout option.
61 # Sets mysql wait_timeout option.
62 waittimeout = 300
62 waittimeout = 300
63
63
64 # Server-side option. Used only if indextype=sql.
64 # Server-side option. Used only if indextype=sql.
65 # Sets mysql innodb_lock_wait_timeout option.
65 # Sets mysql innodb_lock_wait_timeout option.
66 locktimeout = 120
66 locktimeout = 120
67
67
68 # Server-side option. Used only if indextype=sql.
68 # Server-side option. Used only if indextype=sql.
69 # Name of the repository
69 # Name of the repository
70 reponame = ''
70 reponame = ''
71
71
72 # Client-side option. Used by --list-remote option. List of remote scratch
72 # Client-side option. Used by --list-remote option. List of remote scratch
73 # patterns to list if no patterns are specified.
73 # patterns to list if no patterns are specified.
74 defaultremotepatterns = ['*']
74 defaultremotepatterns = ['*']
75
75
76 # Instructs infinitepush to forward all received bundle2 parts to the
76 # Instructs infinitepush to forward all received bundle2 parts to the
77 # bundle for storage. Defaults to False.
77 # bundle for storage. Defaults to False.
78 storeallparts = True
78 storeallparts = True
79
79
80 # routes each incoming push to the bundlestore. defaults to False
80 # routes each incoming push to the bundlestore. defaults to False
81 pushtobundlestore = True
81 pushtobundlestore = True
82
82
83 [remotenames]
83 [remotenames]
84 # Client-side option
84 # Client-side option
85 # This option should be set only if remotenames extension is enabled.
85 # This option should be set only if remotenames extension is enabled.
86 # Whether remote bookmarks are tracked by remotenames extension.
86 # Whether remote bookmarks are tracked by remotenames extension.
87 bookmarks = True
87 bookmarks = True
88 """
88 """
89
89
90
90
91 import collections
91 import collections
92 import contextlib
92 import contextlib
93 import functools
93 import functools
94 import logging
94 import logging
95 import os
95 import os
96 import random
96 import random
97 import re
97 import re
98 import socket
98 import socket
99 import subprocess
99 import subprocess
100 import time
100 import time
101
101
102 from mercurial.node import (
102 from mercurial.node import (
103 bin,
103 bin,
104 hex,
104 hex,
105 )
105 )
106
106
107 from mercurial.i18n import _
107 from mercurial.i18n import _
108
108
109 from mercurial.pycompat import (
109 from mercurial.pycompat import (
110 getattr,
110 getattr,
111 open,
111 open,
112 )
112 )
113
113
114 from mercurial.utils import (
114 from mercurial.utils import (
115 procutil,
115 procutil,
116 stringutil,
116 stringutil,
117 urlutil,
117 urlutil,
118 )
118 )
119
119
120 from mercurial import (
120 from mercurial import (
121 bundle2,
121 bundle2,
122 changegroup,
122 changegroup,
123 commands,
123 commands,
124 discovery,
124 discovery,
125 encoding,
125 encoding,
126 error,
126 error,
127 exchange,
127 exchange,
128 extensions,
128 extensions,
129 hg,
129 hg,
130 localrepo,
130 localrepo,
131 phases,
131 phases,
132 pushkey,
132 pushkey,
133 pycompat,
133 pycompat,
134 registrar,
134 registrar,
135 util,
135 util,
136 wireprototypes,
136 wireprototypes,
137 wireprotov1peer,
137 wireprotov1peer,
138 wireprotov1server,
138 wireprotov1server,
139 )
139 )
140
140
141 from . import (
141 from . import (
142 bundleparts,
142 bundleparts,
143 common,
143 common,
144 )
144 )
145
145
146 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
146 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
147 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
147 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
148 # be specifying the version(s) of Mercurial they are tested with, or
148 # be specifying the version(s) of Mercurial they are tested with, or
149 # leave the attribute unspecified.
149 # leave the attribute unspecified.
150 testedwith = b'ships-with-hg-core'
150 testedwith = b'ships-with-hg-core'
151
151
152 configtable = {}
152 configtable = {}
153 configitem = registrar.configitem(configtable)
153 configitem = registrar.configitem(configtable)
154
154
155 configitem(
155 configitem(
156 b'infinitepush',
156 b'infinitepush',
157 b'deprecation-message',
158 default=True,
159 )
160
161 configitem(
162 b'infinitepush',
163 b'deprecation-abort',
164 default=True,
165 )
166
167 configitem(
168 b'infinitepush',
157 b'server',
169 b'server',
158 default=False,
170 default=False,
159 )
171 )
160 configitem(
172 configitem(
161 b'infinitepush',
173 b'infinitepush',
162 b'storetype',
174 b'storetype',
163 default=b'',
175 default=b'',
164 )
176 )
165 configitem(
177 configitem(
166 b'infinitepush',
178 b'infinitepush',
167 b'indextype',
179 b'indextype',
168 default=b'',
180 default=b'',
169 )
181 )
170 configitem(
182 configitem(
171 b'infinitepush',
183 b'infinitepush',
172 b'indexpath',
184 b'indexpath',
173 default=b'',
185 default=b'',
174 )
186 )
175 configitem(
187 configitem(
176 b'infinitepush',
188 b'infinitepush',
177 b'storeallparts',
189 b'storeallparts',
178 default=False,
190 default=False,
179 )
191 )
180 configitem(
192 configitem(
181 b'infinitepush',
193 b'infinitepush',
182 b'reponame',
194 b'reponame',
183 default=b'',
195 default=b'',
184 )
196 )
185 configitem(
197 configitem(
186 b'scratchbranch',
198 b'scratchbranch',
187 b'storepath',
199 b'storepath',
188 default=b'',
200 default=b'',
189 )
201 )
190 configitem(
202 configitem(
191 b'infinitepush',
203 b'infinitepush',
192 b'branchpattern',
204 b'branchpattern',
193 default=b'',
205 default=b'',
194 )
206 )
195 configitem(
207 configitem(
196 b'infinitepush',
208 b'infinitepush',
197 b'pushtobundlestore',
209 b'pushtobundlestore',
198 default=False,
210 default=False,
199 )
211 )
200 configitem(
212 configitem(
201 b'experimental',
213 b'experimental',
202 b'server-bundlestore-bookmark',
214 b'server-bundlestore-bookmark',
203 default=b'',
215 default=b'',
204 )
216 )
205 configitem(
217 configitem(
206 b'experimental',
218 b'experimental',
207 b'infinitepush-scratchpush',
219 b'infinitepush-scratchpush',
208 default=False,
220 default=False,
209 )
221 )
210
222
211 experimental = b'experimental'
223 experimental = b'experimental'
212 configbookmark = b'server-bundlestore-bookmark'
224 configbookmark = b'server-bundlestore-bookmark'
213 configscratchpush = b'infinitepush-scratchpush'
225 configscratchpush = b'infinitepush-scratchpush'
214
226
215 scratchbranchparttype = bundleparts.scratchbranchparttype
227 scratchbranchparttype = bundleparts.scratchbranchparttype
216 revsetpredicate = registrar.revsetpredicate()
228 revsetpredicate = registrar.revsetpredicate()
217 templatekeyword = registrar.templatekeyword()
229 templatekeyword = registrar.templatekeyword()
218 _scratchbranchmatcher = lambda x: False
230 _scratchbranchmatcher = lambda x: False
219 _maybehash = re.compile('^[a-f0-9]+$').search
231 _maybehash = re.compile('^[a-f0-9]+$').search
220
232
221
233
222 def _buildexternalbundlestore(ui):
234 def _buildexternalbundlestore(ui):
223 put_args = ui.configlist(b'infinitepush', b'put_args', [])
235 put_args = ui.configlist(b'infinitepush', b'put_args', [])
224 put_binary = ui.config(b'infinitepush', b'put_binary')
236 put_binary = ui.config(b'infinitepush', b'put_binary')
225 if not put_binary:
237 if not put_binary:
226 raise error.Abort(b'put binary is not specified')
238 raise error.Abort(b'put binary is not specified')
227 get_args = ui.configlist(b'infinitepush', b'get_args', [])
239 get_args = ui.configlist(b'infinitepush', b'get_args', [])
228 get_binary = ui.config(b'infinitepush', b'get_binary')
240 get_binary = ui.config(b'infinitepush', b'get_binary')
229 if not get_binary:
241 if not get_binary:
230 raise error.Abort(b'get binary is not specified')
242 raise error.Abort(b'get binary is not specified')
231 from . import store
243 from . import store
232
244
233 return store.externalbundlestore(put_binary, put_args, get_binary, get_args)
245 return store.externalbundlestore(put_binary, put_args, get_binary, get_args)
234
246
235
247
236 def _buildsqlindex(ui):
248 def _buildsqlindex(ui):
237 sqlhost = ui.config(b'infinitepush', b'sqlhost')
249 sqlhost = ui.config(b'infinitepush', b'sqlhost')
238 if not sqlhost:
250 if not sqlhost:
239 raise error.Abort(_(b'please set infinitepush.sqlhost'))
251 raise error.Abort(_(b'please set infinitepush.sqlhost'))
240 host, port, db, user, password = sqlhost.split(b':')
252 host, port, db, user, password = sqlhost.split(b':')
241 reponame = ui.config(b'infinitepush', b'reponame')
253 reponame = ui.config(b'infinitepush', b'reponame')
242 if not reponame:
254 if not reponame:
243 raise error.Abort(_(b'please set infinitepush.reponame'))
255 raise error.Abort(_(b'please set infinitepush.reponame'))
244
256
245 logfile = ui.config(b'infinitepush', b'logfile', b'')
257 logfile = ui.config(b'infinitepush', b'logfile', b'')
246 waittimeout = ui.configint(b'infinitepush', b'waittimeout', 300)
258 waittimeout = ui.configint(b'infinitepush', b'waittimeout', 300)
247 locktimeout = ui.configint(b'infinitepush', b'locktimeout', 120)
259 locktimeout = ui.configint(b'infinitepush', b'locktimeout', 120)
248 from . import sqlindexapi
260 from . import sqlindexapi
249
261
250 return sqlindexapi.sqlindexapi(
262 return sqlindexapi.sqlindexapi(
251 reponame,
263 reponame,
252 host,
264 host,
253 port,
265 port,
254 db,
266 db,
255 user,
267 user,
256 password,
268 password,
257 logfile,
269 logfile,
258 _getloglevel(ui),
270 _getloglevel(ui),
259 waittimeout=waittimeout,
271 waittimeout=waittimeout,
260 locktimeout=locktimeout,
272 locktimeout=locktimeout,
261 )
273 )
262
274
263
275
264 def _getloglevel(ui):
276 def _getloglevel(ui):
265 loglevel = ui.config(b'infinitepush', b'loglevel', b'DEBUG')
277 loglevel = ui.config(b'infinitepush', b'loglevel', b'DEBUG')
266 numeric_loglevel = getattr(logging, loglevel.upper(), None)
278 numeric_loglevel = getattr(logging, loglevel.upper(), None)
267 if not isinstance(numeric_loglevel, int):
279 if not isinstance(numeric_loglevel, int):
268 raise error.Abort(_(b'invalid log level %s') % loglevel)
280 raise error.Abort(_(b'invalid log level %s') % loglevel)
269 return numeric_loglevel
281 return numeric_loglevel
270
282
271
283
272 def _tryhoist(ui, remotebookmark):
284 def _tryhoist(ui, remotebookmark):
273 """returns a bookmarks with hoisted part removed
285 """returns a bookmarks with hoisted part removed
274
286
275 Remotenames extension has a 'hoist' config that allows to use remote
287 Remotenames extension has a 'hoist' config that allows to use remote
276 bookmarks without specifying remote path. For example, 'hg update master'
288 bookmarks without specifying remote path. For example, 'hg update master'
277 works as well as 'hg update remote/master'. We want to allow the same in
289 works as well as 'hg update remote/master'. We want to allow the same in
278 infinitepush.
290 infinitepush.
279 """
291 """
280
292
281 if common.isremotebooksenabled(ui):
293 if common.isremotebooksenabled(ui):
282 hoist = ui.config(b'remotenames', b'hoistedpeer') + b'/'
294 hoist = ui.config(b'remotenames', b'hoistedpeer') + b'/'
283 if remotebookmark.startswith(hoist):
295 if remotebookmark.startswith(hoist):
284 return remotebookmark[len(hoist) :]
296 return remotebookmark[len(hoist) :]
285 return remotebookmark
297 return remotebookmark
286
298
287
299
288 class bundlestore:
300 class bundlestore:
289 def __init__(self, repo):
301 def __init__(self, repo):
290 self._repo = repo
302 self._repo = repo
291 storetype = self._repo.ui.config(b'infinitepush', b'storetype')
303 storetype = self._repo.ui.config(b'infinitepush', b'storetype')
292 if storetype == b'disk':
304 if storetype == b'disk':
293 from . import store
305 from . import store
294
306
295 self.store = store.filebundlestore(self._repo.ui, self._repo)
307 self.store = store.filebundlestore(self._repo.ui, self._repo)
296 elif storetype == b'external':
308 elif storetype == b'external':
297 self.store = _buildexternalbundlestore(self._repo.ui)
309 self.store = _buildexternalbundlestore(self._repo.ui)
298 else:
310 else:
299 raise error.Abort(
311 raise error.Abort(
300 _(b'unknown infinitepush store type specified %s') % storetype
312 _(b'unknown infinitepush store type specified %s') % storetype
301 )
313 )
302
314
303 indextype = self._repo.ui.config(b'infinitepush', b'indextype')
315 indextype = self._repo.ui.config(b'infinitepush', b'indextype')
304 if indextype == b'disk':
316 if indextype == b'disk':
305 from . import fileindexapi
317 from . import fileindexapi
306
318
307 self.index = fileindexapi.fileindexapi(self._repo)
319 self.index = fileindexapi.fileindexapi(self._repo)
308 elif indextype == b'sql':
320 elif indextype == b'sql':
309 self.index = _buildsqlindex(self._repo.ui)
321 self.index = _buildsqlindex(self._repo.ui)
310 else:
322 else:
311 raise error.Abort(
323 raise error.Abort(
312 _(b'unknown infinitepush index type specified %s') % indextype
324 _(b'unknown infinitepush index type specified %s') % indextype
313 )
325 )
314
326
315
327
316 def _isserver(ui):
328 def _isserver(ui):
317 return ui.configbool(b'infinitepush', b'server')
329 return ui.configbool(b'infinitepush', b'server')
318
330
319
331
332 WARNING_MSG = b"""IMPORTANT: if you use this extension, please contact
333 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
334 unused and barring learning of users of this functionality, we drop this
335 extension in Mercurial 6.6.
336 """
337
338
320 def reposetup(ui, repo):
339 def reposetup(ui, repo):
340 if ui.configbool(b'infinitepush', b'deprecation-message'):
341 ui.write_err(WARNING_MSG)
342 if ui.configbool(b'infinitepush', b'deprecation-abort'):
343 msg = b"USING EXTENSION INFINITE PUSH DESPITE PENDING DROP"
344 hint = b"contact mercurial-devel@mercurial-scm.org"
345 raise error.Abort(msg, hint=hint)
321 if _isserver(ui) and repo.local():
346 if _isserver(ui) and repo.local():
322 repo.bundlestore = bundlestore(repo)
347 repo.bundlestore = bundlestore(repo)
323
348
324
349
325 def extsetup(ui):
350 def extsetup(ui):
326 commonsetup(ui)
351 commonsetup(ui)
327 if _isserver(ui):
352 if _isserver(ui):
328 serverextsetup(ui)
353 serverextsetup(ui)
329 else:
354 else:
330 clientextsetup(ui)
355 clientextsetup(ui)
331
356
332
357
333 def uipopulate(ui):
358 def uipopulate(ui):
334 if not ui.hasconfig(b"experimental", b"changegroup3"):
359 if not ui.hasconfig(b"experimental", b"changegroup3"):
335 ui.setconfig(b"experimental", b"changegroup3", False, b"infinitepush")
360 ui.setconfig(b"experimental", b"changegroup3", False, b"infinitepush")
336
361
337
362
338 def commonsetup(ui):
363 def commonsetup(ui):
339 wireprotov1server.commands[b'listkeyspatterns'] = (
364 wireprotov1server.commands[b'listkeyspatterns'] = (
340 wireprotolistkeyspatterns,
365 wireprotolistkeyspatterns,
341 b'namespace patterns',
366 b'namespace patterns',
342 )
367 )
343 scratchbranchpat = ui.config(b'infinitepush', b'branchpattern')
368 scratchbranchpat = ui.config(b'infinitepush', b'branchpattern')
344 if scratchbranchpat:
369 if scratchbranchpat:
345 global _scratchbranchmatcher
370 global _scratchbranchmatcher
346 kind, pat, _scratchbranchmatcher = stringutil.stringmatcher(
371 kind, pat, _scratchbranchmatcher = stringutil.stringmatcher(
347 scratchbranchpat
372 scratchbranchpat
348 )
373 )
349
374
350
375
351 def serverextsetup(ui):
376 def serverextsetup(ui):
352 origpushkeyhandler = bundle2.parthandlermapping[b'pushkey']
377 origpushkeyhandler = bundle2.parthandlermapping[b'pushkey']
353
378
354 def newpushkeyhandler(*args, **kwargs):
379 def newpushkeyhandler(*args, **kwargs):
355 bundle2pushkey(origpushkeyhandler, *args, **kwargs)
380 bundle2pushkey(origpushkeyhandler, *args, **kwargs)
356
381
357 newpushkeyhandler.params = origpushkeyhandler.params
382 newpushkeyhandler.params = origpushkeyhandler.params
358 bundle2.parthandlermapping[b'pushkey'] = newpushkeyhandler
383 bundle2.parthandlermapping[b'pushkey'] = newpushkeyhandler
359
384
360 orighandlephasehandler = bundle2.parthandlermapping[b'phase-heads']
385 orighandlephasehandler = bundle2.parthandlermapping[b'phase-heads']
361 newphaseheadshandler = lambda *args, **kwargs: bundle2handlephases(
386 newphaseheadshandler = lambda *args, **kwargs: bundle2handlephases(
362 orighandlephasehandler, *args, **kwargs
387 orighandlephasehandler, *args, **kwargs
363 )
388 )
364 newphaseheadshandler.params = orighandlephasehandler.params
389 newphaseheadshandler.params = orighandlephasehandler.params
365 bundle2.parthandlermapping[b'phase-heads'] = newphaseheadshandler
390 bundle2.parthandlermapping[b'phase-heads'] = newphaseheadshandler
366
391
367 extensions.wrapfunction(
392 extensions.wrapfunction(
368 localrepo.localrepository, b'listkeys', localrepolistkeys
393 localrepo.localrepository, b'listkeys', localrepolistkeys
369 )
394 )
370 wireprotov1server.commands[b'lookup'] = (
395 wireprotov1server.commands[b'lookup'] = (
371 _lookupwrap(wireprotov1server.commands[b'lookup'][0]),
396 _lookupwrap(wireprotov1server.commands[b'lookup'][0]),
372 b'key',
397 b'key',
373 )
398 )
374 extensions.wrapfunction(exchange, b'getbundlechunks', getbundlechunks)
399 extensions.wrapfunction(exchange, b'getbundlechunks', getbundlechunks)
375
400
376 extensions.wrapfunction(bundle2, b'processparts', processparts)
401 extensions.wrapfunction(bundle2, b'processparts', processparts)
377
402
378
403
379 def clientextsetup(ui):
404 def clientextsetup(ui):
380 entry = extensions.wrapcommand(commands.table, b'push', _push)
405 entry = extensions.wrapcommand(commands.table, b'push', _push)
381
406
382 entry[1].append(
407 entry[1].append(
383 (
408 (
384 b'',
409 b'',
385 b'bundle-store',
410 b'bundle-store',
386 None,
411 None,
387 _(b'force push to go to bundle store (EXPERIMENTAL)'),
412 _(b'force push to go to bundle store (EXPERIMENTAL)'),
388 )
413 )
389 )
414 )
390
415
391 extensions.wrapcommand(commands.table, b'pull', _pull)
416 extensions.wrapcommand(commands.table, b'pull', _pull)
392
417
393 extensions.wrapfunction(discovery, b'checkheads', _checkheads)
418 extensions.wrapfunction(discovery, b'checkheads', _checkheads)
394
419
395 wireprotov1peer.wirepeer.listkeyspatterns = listkeyspatterns
420 wireprotov1peer.wirepeer.listkeyspatterns = listkeyspatterns
396
421
397 partorder = exchange.b2partsgenorder
422 partorder = exchange.b2partsgenorder
398 index = partorder.index(b'changeset')
423 index = partorder.index(b'changeset')
399 partorder.insert(
424 partorder.insert(
400 index, partorder.pop(partorder.index(scratchbranchparttype))
425 index, partorder.pop(partorder.index(scratchbranchparttype))
401 )
426 )
402
427
403
428
404 def _checkheads(orig, pushop):
429 def _checkheads(orig, pushop):
405 if pushop.ui.configbool(experimental, configscratchpush, False):
430 if pushop.ui.configbool(experimental, configscratchpush, False):
406 return
431 return
407 return orig(pushop)
432 return orig(pushop)
408
433
409
434
410 def wireprotolistkeyspatterns(repo, proto, namespace, patterns):
435 def wireprotolistkeyspatterns(repo, proto, namespace, patterns):
411 patterns = wireprototypes.decodelist(patterns)
436 patterns = wireprototypes.decodelist(patterns)
412 d = repo.listkeys(encoding.tolocal(namespace), patterns).items()
437 d = repo.listkeys(encoding.tolocal(namespace), patterns).items()
413 return pushkey.encodekeys(d)
438 return pushkey.encodekeys(d)
414
439
415
440
416 def localrepolistkeys(orig, self, namespace, patterns=None):
441 def localrepolistkeys(orig, self, namespace, patterns=None):
417 if namespace == b'bookmarks' and patterns:
442 if namespace == b'bookmarks' and patterns:
418 index = self.bundlestore.index
443 index = self.bundlestore.index
419 results = {}
444 results = {}
420 bookmarks = orig(self, namespace)
445 bookmarks = orig(self, namespace)
421 for pattern in patterns:
446 for pattern in patterns:
422 results.update(index.getbookmarks(pattern))
447 results.update(index.getbookmarks(pattern))
423 if pattern.endswith(b'*'):
448 if pattern.endswith(b'*'):
424 pattern = b're:^' + pattern[:-1] + b'.*'
449 pattern = b're:^' + pattern[:-1] + b'.*'
425 kind, pat, matcher = stringutil.stringmatcher(pattern)
450 kind, pat, matcher = stringutil.stringmatcher(pattern)
426 for bookmark, node in bookmarks.items():
451 for bookmark, node in bookmarks.items():
427 if matcher(bookmark):
452 if matcher(bookmark):
428 results[bookmark] = node
453 results[bookmark] = node
429 return results
454 return results
430 else:
455 else:
431 return orig(self, namespace)
456 return orig(self, namespace)
432
457
433
458
434 @wireprotov1peer.batchable
459 @wireprotov1peer.batchable
435 def listkeyspatterns(self, namespace, patterns):
460 def listkeyspatterns(self, namespace, patterns):
436 if not self.capable(b'pushkey'):
461 if not self.capable(b'pushkey'):
437 return {}, None
462 return {}, None
438 self.ui.debug(b'preparing listkeys for "%s"\n' % namespace)
463 self.ui.debug(b'preparing listkeys for "%s"\n' % namespace)
439
464
440 def decode(d):
465 def decode(d):
441 self.ui.debug(
466 self.ui.debug(
442 b'received listkey for "%s": %i bytes\n' % (namespace, len(d))
467 b'received listkey for "%s": %i bytes\n' % (namespace, len(d))
443 )
468 )
444 return pushkey.decodekeys(d)
469 return pushkey.decodekeys(d)
445
470
446 return {
471 return {
447 b'namespace': encoding.fromlocal(namespace),
472 b'namespace': encoding.fromlocal(namespace),
448 b'patterns': wireprototypes.encodelist(patterns),
473 b'patterns': wireprototypes.encodelist(patterns),
449 }, decode
474 }, decode
450
475
451
476
452 def _readbundlerevs(bundlerepo):
477 def _readbundlerevs(bundlerepo):
453 return list(bundlerepo.revs(b'bundle()'))
478 return list(bundlerepo.revs(b'bundle()'))
454
479
455
480
456 def _includefilelogstobundle(bundlecaps, bundlerepo, bundlerevs, ui):
481 def _includefilelogstobundle(bundlecaps, bundlerepo, bundlerevs, ui):
457 """Tells remotefilelog to include all changed files to the changegroup
482 """Tells remotefilelog to include all changed files to the changegroup
458
483
459 By default remotefilelog doesn't include file content to the changegroup.
484 By default remotefilelog doesn't include file content to the changegroup.
460 But we need to include it if we are fetching from bundlestore.
485 But we need to include it if we are fetching from bundlestore.
461 """
486 """
462 changedfiles = set()
487 changedfiles = set()
463 cl = bundlerepo.changelog
488 cl = bundlerepo.changelog
464 for r in bundlerevs:
489 for r in bundlerevs:
465 # [3] means changed files
490 # [3] means changed files
466 changedfiles.update(cl.read(r)[3])
491 changedfiles.update(cl.read(r)[3])
467 if not changedfiles:
492 if not changedfiles:
468 return bundlecaps
493 return bundlecaps
469
494
470 changedfiles = b'\0'.join(changedfiles)
495 changedfiles = b'\0'.join(changedfiles)
471 newcaps = []
496 newcaps = []
472 appended = False
497 appended = False
473 for cap in bundlecaps or []:
498 for cap in bundlecaps or []:
474 if cap.startswith(b'excludepattern='):
499 if cap.startswith(b'excludepattern='):
475 newcaps.append(b'\0'.join((cap, changedfiles)))
500 newcaps.append(b'\0'.join((cap, changedfiles)))
476 appended = True
501 appended = True
477 else:
502 else:
478 newcaps.append(cap)
503 newcaps.append(cap)
479 if not appended:
504 if not appended:
480 # Not found excludepattern cap. Just append it
505 # Not found excludepattern cap. Just append it
481 newcaps.append(b'excludepattern=' + changedfiles)
506 newcaps.append(b'excludepattern=' + changedfiles)
482
507
483 return newcaps
508 return newcaps
484
509
485
510
486 def _rebundle(bundlerepo, bundleroots, unknownhead):
511 def _rebundle(bundlerepo, bundleroots, unknownhead):
487 """
512 """
488 Bundle may include more revision then user requested. For example,
513 Bundle may include more revision then user requested. For example,
489 if user asks for revision but bundle also consists its descendants.
514 if user asks for revision but bundle also consists its descendants.
490 This function will filter out all revision that user is not requested.
515 This function will filter out all revision that user is not requested.
491 """
516 """
492 parts = []
517 parts = []
493
518
494 version = b'02'
519 version = b'02'
495 outgoing = discovery.outgoing(
520 outgoing = discovery.outgoing(
496 bundlerepo, commonheads=bundleroots, ancestorsof=[unknownhead]
521 bundlerepo, commonheads=bundleroots, ancestorsof=[unknownhead]
497 )
522 )
498 cgstream = changegroup.makestream(bundlerepo, outgoing, version, b'pull')
523 cgstream = changegroup.makestream(bundlerepo, outgoing, version, b'pull')
499 cgstream = util.chunkbuffer(cgstream).read()
524 cgstream = util.chunkbuffer(cgstream).read()
500 cgpart = bundle2.bundlepart(b'changegroup', data=cgstream)
525 cgpart = bundle2.bundlepart(b'changegroup', data=cgstream)
501 cgpart.addparam(b'version', version)
526 cgpart.addparam(b'version', version)
502 parts.append(cgpart)
527 parts.append(cgpart)
503
528
504 return parts
529 return parts
505
530
506
531
507 def _getbundleroots(oldrepo, bundlerepo, bundlerevs):
532 def _getbundleroots(oldrepo, bundlerepo, bundlerevs):
508 cl = bundlerepo.changelog
533 cl = bundlerepo.changelog
509 bundleroots = []
534 bundleroots = []
510 for rev in bundlerevs:
535 for rev in bundlerevs:
511 node = cl.node(rev)
536 node = cl.node(rev)
512 parents = cl.parents(node)
537 parents = cl.parents(node)
513 for parent in parents:
538 for parent in parents:
514 # include all revs that exist in the main repo
539 # include all revs that exist in the main repo
515 # to make sure that bundle may apply client-side
540 # to make sure that bundle may apply client-side
516 if parent in oldrepo:
541 if parent in oldrepo:
517 bundleroots.append(parent)
542 bundleroots.append(parent)
518 return bundleroots
543 return bundleroots
519
544
520
545
521 def _needsrebundling(head, bundlerepo):
546 def _needsrebundling(head, bundlerepo):
522 bundleheads = list(bundlerepo.revs(b'heads(bundle())'))
547 bundleheads = list(bundlerepo.revs(b'heads(bundle())'))
523 return not (
548 return not (
524 len(bundleheads) == 1 and bundlerepo[bundleheads[0]].node() == head
549 len(bundleheads) == 1 and bundlerepo[bundleheads[0]].node() == head
525 )
550 )
526
551
527
552
528 def _generateoutputparts(head, bundlerepo, bundleroots, bundlefile):
553 def _generateoutputparts(head, bundlerepo, bundleroots, bundlefile):
529 """generates bundle that will be send to the user
554 """generates bundle that will be send to the user
530
555
531 returns tuple with raw bundle string and bundle type
556 returns tuple with raw bundle string and bundle type
532 """
557 """
533 parts = []
558 parts = []
534 if not _needsrebundling(head, bundlerepo):
559 if not _needsrebundling(head, bundlerepo):
535 with util.posixfile(bundlefile, b"rb") as f:
560 with util.posixfile(bundlefile, b"rb") as f:
536 unbundler = exchange.readbundle(bundlerepo.ui, f, bundlefile)
561 unbundler = exchange.readbundle(bundlerepo.ui, f, bundlefile)
537 if isinstance(unbundler, changegroup.cg1unpacker):
562 if isinstance(unbundler, changegroup.cg1unpacker):
538 part = bundle2.bundlepart(
563 part = bundle2.bundlepart(
539 b'changegroup', data=unbundler._stream.read()
564 b'changegroup', data=unbundler._stream.read()
540 )
565 )
541 part.addparam(b'version', b'01')
566 part.addparam(b'version', b'01')
542 parts.append(part)
567 parts.append(part)
543 elif isinstance(unbundler, bundle2.unbundle20):
568 elif isinstance(unbundler, bundle2.unbundle20):
544 haschangegroup = False
569 haschangegroup = False
545 for part in unbundler.iterparts():
570 for part in unbundler.iterparts():
546 if part.type == b'changegroup':
571 if part.type == b'changegroup':
547 haschangegroup = True
572 haschangegroup = True
548 newpart = bundle2.bundlepart(part.type, data=part.read())
573 newpart = bundle2.bundlepart(part.type, data=part.read())
549 for key, value in part.params.items():
574 for key, value in part.params.items():
550 newpart.addparam(key, value)
575 newpart.addparam(key, value)
551 parts.append(newpart)
576 parts.append(newpart)
552
577
553 if not haschangegroup:
578 if not haschangegroup:
554 raise error.Abort(
579 raise error.Abort(
555 b'unexpected bundle without changegroup part, '
580 b'unexpected bundle without changegroup part, '
556 + b'head: %s' % hex(head),
581 + b'head: %s' % hex(head),
557 hint=b'report to administrator',
582 hint=b'report to administrator',
558 )
583 )
559 else:
584 else:
560 raise error.Abort(b'unknown bundle type')
585 raise error.Abort(b'unknown bundle type')
561 else:
586 else:
562 parts = _rebundle(bundlerepo, bundleroots, head)
587 parts = _rebundle(bundlerepo, bundleroots, head)
563
588
564 return parts
589 return parts
565
590
566
591
567 def getbundlechunks(orig, repo, source, heads=None, bundlecaps=None, **kwargs):
592 def getbundlechunks(orig, repo, source, heads=None, bundlecaps=None, **kwargs):
568 heads = heads or []
593 heads = heads or []
569 # newheads are parents of roots of scratch bundles that were requested
594 # newheads are parents of roots of scratch bundles that were requested
570 newphases = {}
595 newphases = {}
571 scratchbundles = []
596 scratchbundles = []
572 newheads = []
597 newheads = []
573 scratchheads = []
598 scratchheads = []
574 nodestobundle = {}
599 nodestobundle = {}
575 allbundlestocleanup = []
600 allbundlestocleanup = []
576 try:
601 try:
577 for head in heads:
602 for head in heads:
578 if not repo.changelog.index.has_node(head):
603 if not repo.changelog.index.has_node(head):
579 if head not in nodestobundle:
604 if head not in nodestobundle:
580 newbundlefile = common.downloadbundle(repo, head)
605 newbundlefile = common.downloadbundle(repo, head)
581 bundlepath = b"bundle:%s+%s" % (repo.root, newbundlefile)
606 bundlepath = b"bundle:%s+%s" % (repo.root, newbundlefile)
582 bundlerepo = hg.repository(repo.ui, bundlepath)
607 bundlerepo = hg.repository(repo.ui, bundlepath)
583
608
584 allbundlestocleanup.append((bundlerepo, newbundlefile))
609 allbundlestocleanup.append((bundlerepo, newbundlefile))
585 bundlerevs = set(_readbundlerevs(bundlerepo))
610 bundlerevs = set(_readbundlerevs(bundlerepo))
586 bundlecaps = _includefilelogstobundle(
611 bundlecaps = _includefilelogstobundle(
587 bundlecaps, bundlerepo, bundlerevs, repo.ui
612 bundlecaps, bundlerepo, bundlerevs, repo.ui
588 )
613 )
589 cl = bundlerepo.changelog
614 cl = bundlerepo.changelog
590 bundleroots = _getbundleroots(repo, bundlerepo, bundlerevs)
615 bundleroots = _getbundleroots(repo, bundlerepo, bundlerevs)
591 for rev in bundlerevs:
616 for rev in bundlerevs:
592 node = cl.node(rev)
617 node = cl.node(rev)
593 newphases[hex(node)] = str(phases.draft)
618 newphases[hex(node)] = str(phases.draft)
594 nodestobundle[node] = (
619 nodestobundle[node] = (
595 bundlerepo,
620 bundlerepo,
596 bundleroots,
621 bundleroots,
597 newbundlefile,
622 newbundlefile,
598 )
623 )
599
624
600 scratchbundles.append(
625 scratchbundles.append(
601 _generateoutputparts(head, *nodestobundle[head])
626 _generateoutputparts(head, *nodestobundle[head])
602 )
627 )
603 newheads.extend(bundleroots)
628 newheads.extend(bundleroots)
604 scratchheads.append(head)
629 scratchheads.append(head)
605 finally:
630 finally:
606 for bundlerepo, bundlefile in allbundlestocleanup:
631 for bundlerepo, bundlefile in allbundlestocleanup:
607 bundlerepo.close()
632 bundlerepo.close()
608 try:
633 try:
609 os.unlink(bundlefile)
634 os.unlink(bundlefile)
610 except (IOError, OSError):
635 except (IOError, OSError):
611 # if we can't cleanup the file then just ignore the error,
636 # if we can't cleanup the file then just ignore the error,
612 # no need to fail
637 # no need to fail
613 pass
638 pass
614
639
615 pullfrombundlestore = bool(scratchbundles)
640 pullfrombundlestore = bool(scratchbundles)
616 wrappedchangegrouppart = False
641 wrappedchangegrouppart = False
617 wrappedlistkeys = False
642 wrappedlistkeys = False
618 oldchangegrouppart = exchange.getbundle2partsmapping[b'changegroup']
643 oldchangegrouppart = exchange.getbundle2partsmapping[b'changegroup']
619 try:
644 try:
620
645
621 def _changegrouppart(bundler, *args, **kwargs):
646 def _changegrouppart(bundler, *args, **kwargs):
622 # Order is important here. First add non-scratch part
647 # Order is important here. First add non-scratch part
623 # and only then add parts with scratch bundles because
648 # and only then add parts with scratch bundles because
624 # non-scratch part contains parents of roots of scratch bundles.
649 # non-scratch part contains parents of roots of scratch bundles.
625 result = oldchangegrouppart(bundler, *args, **kwargs)
650 result = oldchangegrouppart(bundler, *args, **kwargs)
626 for bundle in scratchbundles:
651 for bundle in scratchbundles:
627 for part in bundle:
652 for part in bundle:
628 bundler.addpart(part)
653 bundler.addpart(part)
629 return result
654 return result
630
655
631 exchange.getbundle2partsmapping[b'changegroup'] = _changegrouppart
656 exchange.getbundle2partsmapping[b'changegroup'] = _changegrouppart
632 wrappedchangegrouppart = True
657 wrappedchangegrouppart = True
633
658
634 def _listkeys(orig, self, namespace):
659 def _listkeys(orig, self, namespace):
635 origvalues = orig(self, namespace)
660 origvalues = orig(self, namespace)
636 if namespace == b'phases' and pullfrombundlestore:
661 if namespace == b'phases' and pullfrombundlestore:
637 if origvalues.get(b'publishing') == b'True':
662 if origvalues.get(b'publishing') == b'True':
638 # Make repo non-publishing to preserve draft phase
663 # Make repo non-publishing to preserve draft phase
639 del origvalues[b'publishing']
664 del origvalues[b'publishing']
640 origvalues.update(newphases)
665 origvalues.update(newphases)
641 return origvalues
666 return origvalues
642
667
643 extensions.wrapfunction(
668 extensions.wrapfunction(
644 localrepo.localrepository, b'listkeys', _listkeys
669 localrepo.localrepository, b'listkeys', _listkeys
645 )
670 )
646 wrappedlistkeys = True
671 wrappedlistkeys = True
647 heads = list((set(newheads) | set(heads)) - set(scratchheads))
672 heads = list((set(newheads) | set(heads)) - set(scratchheads))
648 result = orig(
673 result = orig(
649 repo, source, heads=heads, bundlecaps=bundlecaps, **kwargs
674 repo, source, heads=heads, bundlecaps=bundlecaps, **kwargs
650 )
675 )
651 finally:
676 finally:
652 if wrappedchangegrouppart:
677 if wrappedchangegrouppart:
653 exchange.getbundle2partsmapping[b'changegroup'] = oldchangegrouppart
678 exchange.getbundle2partsmapping[b'changegroup'] = oldchangegrouppart
654 if wrappedlistkeys:
679 if wrappedlistkeys:
655 extensions.unwrapfunction(
680 extensions.unwrapfunction(
656 localrepo.localrepository, b'listkeys', _listkeys
681 localrepo.localrepository, b'listkeys', _listkeys
657 )
682 )
658 return result
683 return result
659
684
660
685
661 def _lookupwrap(orig):
686 def _lookupwrap(orig):
662 def _lookup(repo, proto, key):
687 def _lookup(repo, proto, key):
663 localkey = encoding.tolocal(key)
688 localkey = encoding.tolocal(key)
664
689
665 if isinstance(localkey, str) and _scratchbranchmatcher(localkey):
690 if isinstance(localkey, str) and _scratchbranchmatcher(localkey):
666 scratchnode = repo.bundlestore.index.getnode(localkey)
691 scratchnode = repo.bundlestore.index.getnode(localkey)
667 if scratchnode:
692 if scratchnode:
668 return b"%d %s\n" % (1, scratchnode)
693 return b"%d %s\n" % (1, scratchnode)
669 else:
694 else:
670 return b"%d %s\n" % (
695 return b"%d %s\n" % (
671 0,
696 0,
672 b'scratch branch %s not found' % localkey,
697 b'scratch branch %s not found' % localkey,
673 )
698 )
674 else:
699 else:
675 try:
700 try:
676 r = hex(repo.lookup(localkey))
701 r = hex(repo.lookup(localkey))
677 return b"%d %s\n" % (1, r)
702 return b"%d %s\n" % (1, r)
678 except Exception as inst:
703 except Exception as inst:
679 if repo.bundlestore.index.getbundle(localkey):
704 if repo.bundlestore.index.getbundle(localkey):
680 return b"%d %s\n" % (1, localkey)
705 return b"%d %s\n" % (1, localkey)
681 else:
706 else:
682 r = stringutil.forcebytestr(inst)
707 r = stringutil.forcebytestr(inst)
683 return b"%d %s\n" % (0, r)
708 return b"%d %s\n" % (0, r)
684
709
685 return _lookup
710 return _lookup
686
711
687
712
688 def _pull(orig, ui, repo, source=b"default", **opts):
713 def _pull(orig, ui, repo, source=b"default", **opts):
689 opts = pycompat.byteskwargs(opts)
714 opts = pycompat.byteskwargs(opts)
690 # Copy paste from `pull` command
715 # Copy paste from `pull` command
691 path = urlutil.get_unique_pull_path_obj(
716 path = urlutil.get_unique_pull_path_obj(
692 b"infinite-push's pull",
717 b"infinite-push's pull",
693 ui,
718 ui,
694 source,
719 source,
695 )
720 )
696
721
697 scratchbookmarks = {}
722 scratchbookmarks = {}
698 unfi = repo.unfiltered()
723 unfi = repo.unfiltered()
699 unknownnodes = []
724 unknownnodes = []
700 for rev in opts.get(b'rev', []):
725 for rev in opts.get(b'rev', []):
701 if rev not in unfi:
726 if rev not in unfi:
702 unknownnodes.append(rev)
727 unknownnodes.append(rev)
703 if opts.get(b'bookmark'):
728 if opts.get(b'bookmark'):
704 bookmarks = []
729 bookmarks = []
705 revs = opts.get(b'rev') or []
730 revs = opts.get(b'rev') or []
706 for bookmark in opts.get(b'bookmark'):
731 for bookmark in opts.get(b'bookmark'):
707 if _scratchbranchmatcher(bookmark):
732 if _scratchbranchmatcher(bookmark):
708 # rev is not known yet
733 # rev is not known yet
709 # it will be fetched with listkeyspatterns next
734 # it will be fetched with listkeyspatterns next
710 scratchbookmarks[bookmark] = b'REVTOFETCH'
735 scratchbookmarks[bookmark] = b'REVTOFETCH'
711 else:
736 else:
712 bookmarks.append(bookmark)
737 bookmarks.append(bookmark)
713
738
714 if scratchbookmarks:
739 if scratchbookmarks:
715 other = hg.peer(repo, opts, path)
740 other = hg.peer(repo, opts, path)
716 try:
741 try:
717 fetchedbookmarks = other.listkeyspatterns(
742 fetchedbookmarks = other.listkeyspatterns(
718 b'bookmarks', patterns=scratchbookmarks
743 b'bookmarks', patterns=scratchbookmarks
719 )
744 )
720 for bookmark in scratchbookmarks:
745 for bookmark in scratchbookmarks:
721 if bookmark not in fetchedbookmarks:
746 if bookmark not in fetchedbookmarks:
722 raise error.Abort(
747 raise error.Abort(
723 b'remote bookmark %s not found!' % bookmark
748 b'remote bookmark %s not found!' % bookmark
724 )
749 )
725 scratchbookmarks[bookmark] = fetchedbookmarks[bookmark]
750 scratchbookmarks[bookmark] = fetchedbookmarks[bookmark]
726 revs.append(fetchedbookmarks[bookmark])
751 revs.append(fetchedbookmarks[bookmark])
727 finally:
752 finally:
728 other.close()
753 other.close()
729 opts[b'bookmark'] = bookmarks
754 opts[b'bookmark'] = bookmarks
730 opts[b'rev'] = revs
755 opts[b'rev'] = revs
731
756
732 if scratchbookmarks or unknownnodes:
757 if scratchbookmarks or unknownnodes:
733 # Set anyincoming to True
758 # Set anyincoming to True
734 extensions.wrapfunction(
759 extensions.wrapfunction(
735 discovery, b'findcommonincoming', _findcommonincoming
760 discovery, b'findcommonincoming', _findcommonincoming
736 )
761 )
737 try:
762 try:
738 # Remote scratch bookmarks will be deleted because remotenames doesn't
763 # Remote scratch bookmarks will be deleted because remotenames doesn't
739 # know about them. Let's save it before pull and restore after
764 # know about them. Let's save it before pull and restore after
740 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, path.loc)
765 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, path.loc)
741 result = orig(ui, repo, path.loc, **pycompat.strkwargs(opts))
766 result = orig(ui, repo, path.loc, **pycompat.strkwargs(opts))
742 # TODO(stash): race condition is possible
767 # TODO(stash): race condition is possible
743 # if scratch bookmarks was updated right after orig.
768 # if scratch bookmarks was updated right after orig.
744 # But that's unlikely and shouldn't be harmful.
769 # But that's unlikely and shouldn't be harmful.
745 if common.isremotebooksenabled(ui):
770 if common.isremotebooksenabled(ui):
746 remotescratchbookmarks.update(scratchbookmarks)
771 remotescratchbookmarks.update(scratchbookmarks)
747 _saveremotebookmarks(repo, remotescratchbookmarks, path.loc)
772 _saveremotebookmarks(repo, remotescratchbookmarks, path.loc)
748 else:
773 else:
749 _savelocalbookmarks(repo, scratchbookmarks)
774 _savelocalbookmarks(repo, scratchbookmarks)
750 return result
775 return result
751 finally:
776 finally:
752 if scratchbookmarks:
777 if scratchbookmarks:
753 extensions.unwrapfunction(discovery, b'findcommonincoming')
778 extensions.unwrapfunction(discovery, b'findcommonincoming')
754
779
755
780
756 def _readscratchremotebookmarks(ui, repo, other):
781 def _readscratchremotebookmarks(ui, repo, other):
757 if common.isremotebooksenabled(ui):
782 if common.isremotebooksenabled(ui):
758 remotenamesext = extensions.find(b'remotenames')
783 remotenamesext = extensions.find(b'remotenames')
759 remotepath = remotenamesext.activepath(repo.ui, other)
784 remotepath = remotenamesext.activepath(repo.ui, other)
760 result = {}
785 result = {}
761 # Let's refresh remotenames to make sure we have it up to date
786 # Let's refresh remotenames to make sure we have it up to date
762 # Seems that `repo.names['remotebookmarks']` may return stale bookmarks
787 # Seems that `repo.names['remotebookmarks']` may return stale bookmarks
763 # and it results in deleting scratch bookmarks. Our best guess how to
788 # and it results in deleting scratch bookmarks. Our best guess how to
764 # fix it is to use `clearnames()`
789 # fix it is to use `clearnames()`
765 repo._remotenames.clearnames()
790 repo._remotenames.clearnames()
766 for remotebookmark in repo.names[b'remotebookmarks'].listnames(repo):
791 for remotebookmark in repo.names[b'remotebookmarks'].listnames(repo):
767 path, bookname = remotenamesext.splitremotename(remotebookmark)
792 path, bookname = remotenamesext.splitremotename(remotebookmark)
768 if path == remotepath and _scratchbranchmatcher(bookname):
793 if path == remotepath and _scratchbranchmatcher(bookname):
769 nodes = repo.names[b'remotebookmarks'].nodes(
794 nodes = repo.names[b'remotebookmarks'].nodes(
770 repo, remotebookmark
795 repo, remotebookmark
771 )
796 )
772 if nodes:
797 if nodes:
773 result[bookname] = hex(nodes[0])
798 result[bookname] = hex(nodes[0])
774 return result
799 return result
775 else:
800 else:
776 return {}
801 return {}
777
802
778
803
779 def _saveremotebookmarks(repo, newbookmarks, remote):
804 def _saveremotebookmarks(repo, newbookmarks, remote):
780 remotenamesext = extensions.find(b'remotenames')
805 remotenamesext = extensions.find(b'remotenames')
781 remotepath = remotenamesext.activepath(repo.ui, remote)
806 remotepath = remotenamesext.activepath(repo.ui, remote)
782 branches = collections.defaultdict(list)
807 branches = collections.defaultdict(list)
783 bookmarks = {}
808 bookmarks = {}
784 remotenames = remotenamesext.readremotenames(repo)
809 remotenames = remotenamesext.readremotenames(repo)
785 for hexnode, nametype, remote, rname in remotenames:
810 for hexnode, nametype, remote, rname in remotenames:
786 if remote != remotepath:
811 if remote != remotepath:
787 continue
812 continue
788 if nametype == b'bookmarks':
813 if nametype == b'bookmarks':
789 if rname in newbookmarks:
814 if rname in newbookmarks:
790 # It's possible if we have a normal bookmark that matches
815 # It's possible if we have a normal bookmark that matches
791 # scratch branch pattern. In this case just use the current
816 # scratch branch pattern. In this case just use the current
792 # bookmark node
817 # bookmark node
793 del newbookmarks[rname]
818 del newbookmarks[rname]
794 bookmarks[rname] = hexnode
819 bookmarks[rname] = hexnode
795 elif nametype == b'branches':
820 elif nametype == b'branches':
796 # saveremotenames expects 20 byte binary nodes for branches
821 # saveremotenames expects 20 byte binary nodes for branches
797 branches[rname].append(bin(hexnode))
822 branches[rname].append(bin(hexnode))
798
823
799 for bookmark, hexnode in newbookmarks.items():
824 for bookmark, hexnode in newbookmarks.items():
800 bookmarks[bookmark] = hexnode
825 bookmarks[bookmark] = hexnode
801 remotenamesext.saveremotenames(repo, remotepath, branches, bookmarks)
826 remotenamesext.saveremotenames(repo, remotepath, branches, bookmarks)
802
827
803
828
804 def _savelocalbookmarks(repo, bookmarks):
829 def _savelocalbookmarks(repo, bookmarks):
805 if not bookmarks:
830 if not bookmarks:
806 return
831 return
807 with repo.wlock(), repo.lock(), repo.transaction(b'bookmark') as tr:
832 with repo.wlock(), repo.lock(), repo.transaction(b'bookmark') as tr:
808 changes = []
833 changes = []
809 for scratchbook, node in bookmarks.items():
834 for scratchbook, node in bookmarks.items():
810 changectx = repo[node]
835 changectx = repo[node]
811 changes.append((scratchbook, changectx.node()))
836 changes.append((scratchbook, changectx.node()))
812 repo._bookmarks.applychanges(repo, tr, changes)
837 repo._bookmarks.applychanges(repo, tr, changes)
813
838
814
839
815 def _findcommonincoming(orig, *args, **kwargs):
840 def _findcommonincoming(orig, *args, **kwargs):
816 common, inc, remoteheads = orig(*args, **kwargs)
841 common, inc, remoteheads = orig(*args, **kwargs)
817 return common, True, remoteheads
842 return common, True, remoteheads
818
843
819
844
820 def _push(orig, ui, repo, *dests, **opts):
845 def _push(orig, ui, repo, *dests, **opts):
821 opts = pycompat.byteskwargs(opts)
846 opts = pycompat.byteskwargs(opts)
822 bookmark = opts.get(b'bookmark')
847 bookmark = opts.get(b'bookmark')
823 # we only support pushing one infinitepush bookmark at once
848 # we only support pushing one infinitepush bookmark at once
824 if len(bookmark) == 1:
849 if len(bookmark) == 1:
825 bookmark = bookmark[0]
850 bookmark = bookmark[0]
826 else:
851 else:
827 bookmark = b''
852 bookmark = b''
828
853
829 oldphasemove = None
854 oldphasemove = None
830 overrides = {(experimental, configbookmark): bookmark}
855 overrides = {(experimental, configbookmark): bookmark}
831
856
832 with ui.configoverride(overrides, b'infinitepush'):
857 with ui.configoverride(overrides, b'infinitepush'):
833 scratchpush = opts.get(b'bundle_store')
858 scratchpush = opts.get(b'bundle_store')
834 if _scratchbranchmatcher(bookmark):
859 if _scratchbranchmatcher(bookmark):
835 scratchpush = True
860 scratchpush = True
836 # bundle2 can be sent back after push (for example, bundle2
861 # bundle2 can be sent back after push (for example, bundle2
837 # containing `pushkey` part to update bookmarks)
862 # containing `pushkey` part to update bookmarks)
838 ui.setconfig(experimental, b'bundle2.pushback', True)
863 ui.setconfig(experimental, b'bundle2.pushback', True)
839
864
840 if scratchpush:
865 if scratchpush:
841 # this is an infinitepush, we don't want the bookmark to be applied
866 # this is an infinitepush, we don't want the bookmark to be applied
842 # rather that should be stored in the bundlestore
867 # rather that should be stored in the bundlestore
843 opts[b'bookmark'] = []
868 opts[b'bookmark'] = []
844 ui.setconfig(experimental, configscratchpush, True)
869 ui.setconfig(experimental, configscratchpush, True)
845 oldphasemove = extensions.wrapfunction(
870 oldphasemove = extensions.wrapfunction(
846 exchange, b'_localphasemove', _phasemove
871 exchange, b'_localphasemove', _phasemove
847 )
872 )
848
873
849 paths = list(urlutil.get_push_paths(repo, ui, dests))
874 paths = list(urlutil.get_push_paths(repo, ui, dests))
850 if len(paths) > 1:
875 if len(paths) > 1:
851 msg = _(b'cannot push to multiple path with infinitepush')
876 msg = _(b'cannot push to multiple path with infinitepush')
852 raise error.Abort(msg)
877 raise error.Abort(msg)
853
878
854 path = paths[0]
879 path = paths[0]
855 destpath = path.loc
880 destpath = path.loc
856 # Remote scratch bookmarks will be deleted because remotenames doesn't
881 # Remote scratch bookmarks will be deleted because remotenames doesn't
857 # know about them. Let's save it before push and restore after
882 # know about them. Let's save it before push and restore after
858 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, destpath)
883 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, destpath)
859 result = orig(ui, repo, *dests, **pycompat.strkwargs(opts))
884 result = orig(ui, repo, *dests, **pycompat.strkwargs(opts))
860 if common.isremotebooksenabled(ui):
885 if common.isremotebooksenabled(ui):
861 if bookmark and scratchpush:
886 if bookmark and scratchpush:
862 other = hg.peer(repo, opts, path)
887 other = hg.peer(repo, opts, path)
863 try:
888 try:
864 fetchedbookmarks = other.listkeyspatterns(
889 fetchedbookmarks = other.listkeyspatterns(
865 b'bookmarks', patterns=[bookmark]
890 b'bookmarks', patterns=[bookmark]
866 )
891 )
867 remotescratchbookmarks.update(fetchedbookmarks)
892 remotescratchbookmarks.update(fetchedbookmarks)
868 finally:
893 finally:
869 other.close()
894 other.close()
870 _saveremotebookmarks(repo, remotescratchbookmarks, destpath)
895 _saveremotebookmarks(repo, remotescratchbookmarks, destpath)
871 if oldphasemove:
896 if oldphasemove:
872 exchange._localphasemove = oldphasemove
897 exchange._localphasemove = oldphasemove
873 return result
898 return result
874
899
875
900
876 def _deleteinfinitepushbookmarks(ui, repo, path, names):
901 def _deleteinfinitepushbookmarks(ui, repo, path, names):
877 """Prune remote names by removing the bookmarks we don't want anymore,
902 """Prune remote names by removing the bookmarks we don't want anymore,
878 then writing the result back to disk
903 then writing the result back to disk
879 """
904 """
880 remotenamesext = extensions.find(b'remotenames')
905 remotenamesext = extensions.find(b'remotenames')
881
906
882 # remotename format is:
907 # remotename format is:
883 # (node, nametype ("branches" or "bookmarks"), remote, name)
908 # (node, nametype ("branches" or "bookmarks"), remote, name)
884 nametype_idx = 1
909 nametype_idx = 1
885 remote_idx = 2
910 remote_idx = 2
886 name_idx = 3
911 name_idx = 3
887 remotenames = [
912 remotenames = [
888 remotename
913 remotename
889 for remotename in remotenamesext.readremotenames(repo)
914 for remotename in remotenamesext.readremotenames(repo)
890 if remotename[remote_idx] == path
915 if remotename[remote_idx] == path
891 ]
916 ]
892 remote_bm_names = [
917 remote_bm_names = [
893 remotename[name_idx]
918 remotename[name_idx]
894 for remotename in remotenames
919 for remotename in remotenames
895 if remotename[nametype_idx] == b"bookmarks"
920 if remotename[nametype_idx] == b"bookmarks"
896 ]
921 ]
897
922
898 for name in names:
923 for name in names:
899 if name not in remote_bm_names:
924 if name not in remote_bm_names:
900 raise error.Abort(
925 raise error.Abort(
901 _(
926 _(
902 b"infinitepush bookmark '{}' does not exist "
927 b"infinitepush bookmark '{}' does not exist "
903 b"in path '{}'"
928 b"in path '{}'"
904 ).format(name, path)
929 ).format(name, path)
905 )
930 )
906
931
907 bookmarks = {}
932 bookmarks = {}
908 branches = collections.defaultdict(list)
933 branches = collections.defaultdict(list)
909 for node, nametype, remote, name in remotenames:
934 for node, nametype, remote, name in remotenames:
910 if nametype == b"bookmarks" and name not in names:
935 if nametype == b"bookmarks" and name not in names:
911 bookmarks[name] = node
936 bookmarks[name] = node
912 elif nametype == b"branches":
937 elif nametype == b"branches":
913 # saveremotenames wants binary nodes for branches
938 # saveremotenames wants binary nodes for branches
914 branches[name].append(bin(node))
939 branches[name].append(bin(node))
915
940
916 remotenamesext.saveremotenames(repo, path, branches, bookmarks)
941 remotenamesext.saveremotenames(repo, path, branches, bookmarks)
917
942
918
943
919 def _phasemove(orig, pushop, nodes, phase=phases.public):
944 def _phasemove(orig, pushop, nodes, phase=phases.public):
920 """prevent commits from being marked public
945 """prevent commits from being marked public
921
946
922 Since these are going to a scratch branch, they aren't really being
947 Since these are going to a scratch branch, they aren't really being
923 published."""
948 published."""
924
949
925 if phase != phases.public:
950 if phase != phases.public:
926 orig(pushop, nodes, phase)
951 orig(pushop, nodes, phase)
927
952
928
953
929 @exchange.b2partsgenerator(scratchbranchparttype)
954 @exchange.b2partsgenerator(scratchbranchparttype)
930 def partgen(pushop, bundler):
955 def partgen(pushop, bundler):
931 bookmark = pushop.ui.config(experimental, configbookmark)
956 bookmark = pushop.ui.config(experimental, configbookmark)
932 scratchpush = pushop.ui.configbool(experimental, configscratchpush)
957 scratchpush = pushop.ui.configbool(experimental, configscratchpush)
933 if b'changesets' in pushop.stepsdone or not scratchpush:
958 if b'changesets' in pushop.stepsdone or not scratchpush:
934 return
959 return
935
960
936 if scratchbranchparttype not in bundle2.bundle2caps(pushop.remote):
961 if scratchbranchparttype not in bundle2.bundle2caps(pushop.remote):
937 return
962 return
938
963
939 pushop.stepsdone.add(b'changesets')
964 pushop.stepsdone.add(b'changesets')
940 if not pushop.outgoing.missing:
965 if not pushop.outgoing.missing:
941 pushop.ui.status(_(b'no changes found\n'))
966 pushop.ui.status(_(b'no changes found\n'))
942 pushop.cgresult = 0
967 pushop.cgresult = 0
943 return
968 return
944
969
945 # This parameter tells the server that the following bundle is an
970 # This parameter tells the server that the following bundle is an
946 # infinitepush. This let's it switch the part processing to our infinitepush
971 # infinitepush. This let's it switch the part processing to our infinitepush
947 # code path.
972 # code path.
948 bundler.addparam(b"infinitepush", b"True")
973 bundler.addparam(b"infinitepush", b"True")
949
974
950 scratchparts = bundleparts.getscratchbranchparts(
975 scratchparts = bundleparts.getscratchbranchparts(
951 pushop.repo, pushop.remote, pushop.outgoing, pushop.ui, bookmark
976 pushop.repo, pushop.remote, pushop.outgoing, pushop.ui, bookmark
952 )
977 )
953
978
954 for scratchpart in scratchparts:
979 for scratchpart in scratchparts:
955 bundler.addpart(scratchpart)
980 bundler.addpart(scratchpart)
956
981
957 def handlereply(op):
982 def handlereply(op):
958 # server either succeeds or aborts; no code to read
983 # server either succeeds or aborts; no code to read
959 pushop.cgresult = 1
984 pushop.cgresult = 1
960
985
961 return handlereply
986 return handlereply
962
987
963
988
964 bundle2.capabilities[bundleparts.scratchbranchparttype] = ()
989 bundle2.capabilities[bundleparts.scratchbranchparttype] = ()
965
990
966
991
967 def _getrevs(bundle, oldnode, force, bookmark):
992 def _getrevs(bundle, oldnode, force, bookmark):
968 b'extracts and validates the revs to be imported'
993 b'extracts and validates the revs to be imported'
969 revs = [bundle[r] for r in bundle.revs(b'sort(bundle())')]
994 revs = [bundle[r] for r in bundle.revs(b'sort(bundle())')]
970
995
971 # new bookmark
996 # new bookmark
972 if oldnode is None:
997 if oldnode is None:
973 return revs
998 return revs
974
999
975 # Fast forward update
1000 # Fast forward update
976 if oldnode in bundle and list(bundle.set(b'bundle() & %s::', oldnode)):
1001 if oldnode in bundle and list(bundle.set(b'bundle() & %s::', oldnode)):
977 return revs
1002 return revs
978
1003
979 return revs
1004 return revs
980
1005
981
1006
982 @contextlib.contextmanager
1007 @contextlib.contextmanager
983 def logservicecall(logger, service, **kwargs):
1008 def logservicecall(logger, service, **kwargs):
984 start = time.time()
1009 start = time.time()
985 logger(service, eventtype=b'start', **kwargs)
1010 logger(service, eventtype=b'start', **kwargs)
986 try:
1011 try:
987 yield
1012 yield
988 logger(
1013 logger(
989 service,
1014 service,
990 eventtype=b'success',
1015 eventtype=b'success',
991 elapsedms=(time.time() - start) * 1000,
1016 elapsedms=(time.time() - start) * 1000,
992 **kwargs
1017 **kwargs
993 )
1018 )
994 except Exception as e:
1019 except Exception as e:
995 logger(
1020 logger(
996 service,
1021 service,
997 eventtype=b'failure',
1022 eventtype=b'failure',
998 elapsedms=(time.time() - start) * 1000,
1023 elapsedms=(time.time() - start) * 1000,
999 errormsg=stringutil.forcebytestr(e),
1024 errormsg=stringutil.forcebytestr(e),
1000 **kwargs
1025 **kwargs
1001 )
1026 )
1002 raise
1027 raise
1003
1028
1004
1029
1005 def _getorcreateinfinitepushlogger(op):
1030 def _getorcreateinfinitepushlogger(op):
1006 logger = op.records[b'infinitepushlogger']
1031 logger = op.records[b'infinitepushlogger']
1007 if not logger:
1032 if not logger:
1008 ui = op.repo.ui
1033 ui = op.repo.ui
1009 try:
1034 try:
1010 username = procutil.getuser()
1035 username = procutil.getuser()
1011 except Exception:
1036 except Exception:
1012 username = b'unknown'
1037 username = b'unknown'
1013 # Generate random request id to be able to find all logged entries
1038 # Generate random request id to be able to find all logged entries
1014 # for the same request. Since requestid is pseudo-generated it may
1039 # for the same request. Since requestid is pseudo-generated it may
1015 # not be unique, but we assume that (hostname, username, requestid)
1040 # not be unique, but we assume that (hostname, username, requestid)
1016 # is unique.
1041 # is unique.
1017 random.seed()
1042 random.seed()
1018 requestid = random.randint(0, 2000000000)
1043 requestid = random.randint(0, 2000000000)
1019 hostname = socket.gethostname()
1044 hostname = socket.gethostname()
1020 logger = functools.partial(
1045 logger = functools.partial(
1021 ui.log,
1046 ui.log,
1022 b'infinitepush',
1047 b'infinitepush',
1023 user=username,
1048 user=username,
1024 requestid=requestid,
1049 requestid=requestid,
1025 hostname=hostname,
1050 hostname=hostname,
1026 reponame=ui.config(b'infinitepush', b'reponame'),
1051 reponame=ui.config(b'infinitepush', b'reponame'),
1027 )
1052 )
1028 op.records.add(b'infinitepushlogger', logger)
1053 op.records.add(b'infinitepushlogger', logger)
1029 else:
1054 else:
1030 logger = logger[0]
1055 logger = logger[0]
1031 return logger
1056 return logger
1032
1057
1033
1058
1034 def storetobundlestore(orig, repo, op, unbundler):
1059 def storetobundlestore(orig, repo, op, unbundler):
1035 """stores the incoming bundle coming from push command to the bundlestore
1060 """stores the incoming bundle coming from push command to the bundlestore
1036 instead of applying on the revlogs"""
1061 instead of applying on the revlogs"""
1037
1062
1038 repo.ui.status(_(b"storing changesets on the bundlestore\n"))
1063 repo.ui.status(_(b"storing changesets on the bundlestore\n"))
1039 bundler = bundle2.bundle20(repo.ui)
1064 bundler = bundle2.bundle20(repo.ui)
1040
1065
1041 # processing each part and storing it in bundler
1066 # processing each part and storing it in bundler
1042 with bundle2.partiterator(repo, op, unbundler) as parts:
1067 with bundle2.partiterator(repo, op, unbundler) as parts:
1043 for part in parts:
1068 for part in parts:
1044 bundlepart = None
1069 bundlepart = None
1045 if part.type == b'replycaps':
1070 if part.type == b'replycaps':
1046 # This configures the current operation to allow reply parts.
1071 # This configures the current operation to allow reply parts.
1047 bundle2._processpart(op, part)
1072 bundle2._processpart(op, part)
1048 else:
1073 else:
1049 bundlepart = bundle2.bundlepart(part.type, data=part.read())
1074 bundlepart = bundle2.bundlepart(part.type, data=part.read())
1050 for key, value in part.params.items():
1075 for key, value in part.params.items():
1051 bundlepart.addparam(key, value)
1076 bundlepart.addparam(key, value)
1052
1077
1053 # Certain parts require a response
1078 # Certain parts require a response
1054 if part.type in (b'pushkey', b'changegroup'):
1079 if part.type in (b'pushkey', b'changegroup'):
1055 if op.reply is not None:
1080 if op.reply is not None:
1056 rpart = op.reply.newpart(b'reply:%s' % part.type)
1081 rpart = op.reply.newpart(b'reply:%s' % part.type)
1057 rpart.addparam(
1082 rpart.addparam(
1058 b'in-reply-to', b'%d' % part.id, mandatory=False
1083 b'in-reply-to', b'%d' % part.id, mandatory=False
1059 )
1084 )
1060 rpart.addparam(b'return', b'1', mandatory=False)
1085 rpart.addparam(b'return', b'1', mandatory=False)
1061
1086
1062 op.records.add(
1087 op.records.add(
1063 part.type,
1088 part.type,
1064 {
1089 {
1065 b'return': 1,
1090 b'return': 1,
1066 },
1091 },
1067 )
1092 )
1068 if bundlepart:
1093 if bundlepart:
1069 bundler.addpart(bundlepart)
1094 bundler.addpart(bundlepart)
1070
1095
1071 # storing the bundle in the bundlestore
1096 # storing the bundle in the bundlestore
1072 buf = util.chunkbuffer(bundler.getchunks())
1097 buf = util.chunkbuffer(bundler.getchunks())
1073 fd, bundlefile = pycompat.mkstemp()
1098 fd, bundlefile = pycompat.mkstemp()
1074 try:
1099 try:
1075 try:
1100 try:
1076 fp = os.fdopen(fd, 'wb')
1101 fp = os.fdopen(fd, 'wb')
1077 fp.write(buf.read())
1102 fp.write(buf.read())
1078 finally:
1103 finally:
1079 fp.close()
1104 fp.close()
1080 storebundle(op, {}, bundlefile)
1105 storebundle(op, {}, bundlefile)
1081 finally:
1106 finally:
1082 try:
1107 try:
1083 os.unlink(bundlefile)
1108 os.unlink(bundlefile)
1084 except Exception:
1109 except Exception:
1085 # we would rather see the original exception
1110 # we would rather see the original exception
1086 pass
1111 pass
1087
1112
1088
1113
1089 def processparts(orig, repo, op, unbundler):
1114 def processparts(orig, repo, op, unbundler):
1090
1115
1091 # make sure we don't wrap processparts in case of `hg unbundle`
1116 # make sure we don't wrap processparts in case of `hg unbundle`
1092 if op.source == b'unbundle':
1117 if op.source == b'unbundle':
1093 return orig(repo, op, unbundler)
1118 return orig(repo, op, unbundler)
1094
1119
1095 # this server routes each push to bundle store
1120 # this server routes each push to bundle store
1096 if repo.ui.configbool(b'infinitepush', b'pushtobundlestore'):
1121 if repo.ui.configbool(b'infinitepush', b'pushtobundlestore'):
1097 return storetobundlestore(orig, repo, op, unbundler)
1122 return storetobundlestore(orig, repo, op, unbundler)
1098
1123
1099 if unbundler.params.get(b'infinitepush') != b'True':
1124 if unbundler.params.get(b'infinitepush') != b'True':
1100 return orig(repo, op, unbundler)
1125 return orig(repo, op, unbundler)
1101
1126
1102 handleallparts = repo.ui.configbool(b'infinitepush', b'storeallparts')
1127 handleallparts = repo.ui.configbool(b'infinitepush', b'storeallparts')
1103
1128
1104 bundler = bundle2.bundle20(repo.ui)
1129 bundler = bundle2.bundle20(repo.ui)
1105 cgparams = None
1130 cgparams = None
1106 with bundle2.partiterator(repo, op, unbundler) as parts:
1131 with bundle2.partiterator(repo, op, unbundler) as parts:
1107 for part in parts:
1132 for part in parts:
1108 bundlepart = None
1133 bundlepart = None
1109 if part.type == b'replycaps':
1134 if part.type == b'replycaps':
1110 # This configures the current operation to allow reply parts.
1135 # This configures the current operation to allow reply parts.
1111 bundle2._processpart(op, part)
1136 bundle2._processpart(op, part)
1112 elif part.type == bundleparts.scratchbranchparttype:
1137 elif part.type == bundleparts.scratchbranchparttype:
1113 # Scratch branch parts need to be converted to normal
1138 # Scratch branch parts need to be converted to normal
1114 # changegroup parts, and the extra parameters stored for later
1139 # changegroup parts, and the extra parameters stored for later
1115 # when we upload to the store. Eventually those parameters will
1140 # when we upload to the store. Eventually those parameters will
1116 # be put on the actual bundle instead of this part, then we can
1141 # be put on the actual bundle instead of this part, then we can
1117 # send a vanilla changegroup instead of the scratchbranch part.
1142 # send a vanilla changegroup instead of the scratchbranch part.
1118 cgversion = part.params.get(b'cgversion', b'01')
1143 cgversion = part.params.get(b'cgversion', b'01')
1119 bundlepart = bundle2.bundlepart(
1144 bundlepart = bundle2.bundlepart(
1120 b'changegroup', data=part.read()
1145 b'changegroup', data=part.read()
1121 )
1146 )
1122 bundlepart.addparam(b'version', cgversion)
1147 bundlepart.addparam(b'version', cgversion)
1123 cgparams = part.params
1148 cgparams = part.params
1124
1149
1125 # If we're not dumping all parts into the new bundle, we need to
1150 # If we're not dumping all parts into the new bundle, we need to
1126 # alert the future pushkey and phase-heads handler to skip
1151 # alert the future pushkey and phase-heads handler to skip
1127 # the part.
1152 # the part.
1128 if not handleallparts:
1153 if not handleallparts:
1129 op.records.add(
1154 op.records.add(
1130 scratchbranchparttype + b'_skippushkey', True
1155 scratchbranchparttype + b'_skippushkey', True
1131 )
1156 )
1132 op.records.add(
1157 op.records.add(
1133 scratchbranchparttype + b'_skipphaseheads', True
1158 scratchbranchparttype + b'_skipphaseheads', True
1134 )
1159 )
1135 else:
1160 else:
1136 if handleallparts:
1161 if handleallparts:
1137 # Ideally we would not process any parts, and instead just
1162 # Ideally we would not process any parts, and instead just
1138 # forward them to the bundle for storage, but since this
1163 # forward them to the bundle for storage, but since this
1139 # differs from previous behavior, we need to put it behind a
1164 # differs from previous behavior, we need to put it behind a
1140 # config flag for incremental rollout.
1165 # config flag for incremental rollout.
1141 bundlepart = bundle2.bundlepart(part.type, data=part.read())
1166 bundlepart = bundle2.bundlepart(part.type, data=part.read())
1142 for key, value in part.params.items():
1167 for key, value in part.params.items():
1143 bundlepart.addparam(key, value)
1168 bundlepart.addparam(key, value)
1144
1169
1145 # Certain parts require a response
1170 # Certain parts require a response
1146 if part.type == b'pushkey':
1171 if part.type == b'pushkey':
1147 if op.reply is not None:
1172 if op.reply is not None:
1148 rpart = op.reply.newpart(b'reply:pushkey')
1173 rpart = op.reply.newpart(b'reply:pushkey')
1149 rpart.addparam(
1174 rpart.addparam(
1150 b'in-reply-to', str(part.id), mandatory=False
1175 b'in-reply-to', str(part.id), mandatory=False
1151 )
1176 )
1152 rpart.addparam(b'return', b'1', mandatory=False)
1177 rpart.addparam(b'return', b'1', mandatory=False)
1153 else:
1178 else:
1154 bundle2._processpart(op, part)
1179 bundle2._processpart(op, part)
1155
1180
1156 if handleallparts:
1181 if handleallparts:
1157 op.records.add(
1182 op.records.add(
1158 part.type,
1183 part.type,
1159 {
1184 {
1160 b'return': 1,
1185 b'return': 1,
1161 },
1186 },
1162 )
1187 )
1163 if bundlepart:
1188 if bundlepart:
1164 bundler.addpart(bundlepart)
1189 bundler.addpart(bundlepart)
1165
1190
1166 # If commits were sent, store them
1191 # If commits were sent, store them
1167 if cgparams:
1192 if cgparams:
1168 buf = util.chunkbuffer(bundler.getchunks())
1193 buf = util.chunkbuffer(bundler.getchunks())
1169 fd, bundlefile = pycompat.mkstemp()
1194 fd, bundlefile = pycompat.mkstemp()
1170 try:
1195 try:
1171 try:
1196 try:
1172 fp = os.fdopen(fd, 'wb')
1197 fp = os.fdopen(fd, 'wb')
1173 fp.write(buf.read())
1198 fp.write(buf.read())
1174 finally:
1199 finally:
1175 fp.close()
1200 fp.close()
1176 storebundle(op, cgparams, bundlefile)
1201 storebundle(op, cgparams, bundlefile)
1177 finally:
1202 finally:
1178 try:
1203 try:
1179 os.unlink(bundlefile)
1204 os.unlink(bundlefile)
1180 except Exception:
1205 except Exception:
1181 # we would rather see the original exception
1206 # we would rather see the original exception
1182 pass
1207 pass
1183
1208
1184
1209
1185 def storebundle(op, params, bundlefile):
1210 def storebundle(op, params, bundlefile):
1186 log = _getorcreateinfinitepushlogger(op)
1211 log = _getorcreateinfinitepushlogger(op)
1187 parthandlerstart = time.time()
1212 parthandlerstart = time.time()
1188 log(scratchbranchparttype, eventtype=b'start')
1213 log(scratchbranchparttype, eventtype=b'start')
1189 index = op.repo.bundlestore.index
1214 index = op.repo.bundlestore.index
1190 store = op.repo.bundlestore.store
1215 store = op.repo.bundlestore.store
1191 op.records.add(scratchbranchparttype + b'_skippushkey', True)
1216 op.records.add(scratchbranchparttype + b'_skippushkey', True)
1192
1217
1193 bundle = None
1218 bundle = None
1194 try: # guards bundle
1219 try: # guards bundle
1195 bundlepath = b"bundle:%s+%s" % (op.repo.root, bundlefile)
1220 bundlepath = b"bundle:%s+%s" % (op.repo.root, bundlefile)
1196 bundle = hg.repository(op.repo.ui, bundlepath)
1221 bundle = hg.repository(op.repo.ui, bundlepath)
1197
1222
1198 bookmark = params.get(b'bookmark')
1223 bookmark = params.get(b'bookmark')
1199 bookprevnode = params.get(b'bookprevnode', b'')
1224 bookprevnode = params.get(b'bookprevnode', b'')
1200 force = params.get(b'force')
1225 force = params.get(b'force')
1201
1226
1202 if bookmark:
1227 if bookmark:
1203 oldnode = index.getnode(bookmark)
1228 oldnode = index.getnode(bookmark)
1204 else:
1229 else:
1205 oldnode = None
1230 oldnode = None
1206 bundleheads = bundle.revs(b'heads(bundle())')
1231 bundleheads = bundle.revs(b'heads(bundle())')
1207 if bookmark and len(bundleheads) > 1:
1232 if bookmark and len(bundleheads) > 1:
1208 raise error.Abort(
1233 raise error.Abort(
1209 _(b'cannot push more than one head to a scratch branch')
1234 _(b'cannot push more than one head to a scratch branch')
1210 )
1235 )
1211
1236
1212 revs = _getrevs(bundle, oldnode, force, bookmark)
1237 revs = _getrevs(bundle, oldnode, force, bookmark)
1213
1238
1214 # Notify the user of what is being pushed
1239 # Notify the user of what is being pushed
1215 plural = b's' if len(revs) > 1 else b''
1240 plural = b's' if len(revs) > 1 else b''
1216 op.repo.ui.warn(_(b"pushing %d commit%s:\n") % (len(revs), plural))
1241 op.repo.ui.warn(_(b"pushing %d commit%s:\n") % (len(revs), plural))
1217 maxoutput = 10
1242 maxoutput = 10
1218 for i in range(0, min(len(revs), maxoutput)):
1243 for i in range(0, min(len(revs), maxoutput)):
1219 firstline = bundle[revs[i]].description().split(b'\n')[0][:50]
1244 firstline = bundle[revs[i]].description().split(b'\n')[0][:50]
1220 op.repo.ui.warn(b" %s %s\n" % (revs[i], firstline))
1245 op.repo.ui.warn(b" %s %s\n" % (revs[i], firstline))
1221
1246
1222 if len(revs) > maxoutput + 1:
1247 if len(revs) > maxoutput + 1:
1223 op.repo.ui.warn(b" ...\n")
1248 op.repo.ui.warn(b" ...\n")
1224 firstline = bundle[revs[-1]].description().split(b'\n')[0][:50]
1249 firstline = bundle[revs[-1]].description().split(b'\n')[0][:50]
1225 op.repo.ui.warn(b" %s %s\n" % (revs[-1], firstline))
1250 op.repo.ui.warn(b" %s %s\n" % (revs[-1], firstline))
1226
1251
1227 nodesctx = [bundle[rev] for rev in revs]
1252 nodesctx = [bundle[rev] for rev in revs]
1228 inindex = lambda rev: bool(index.getbundle(bundle[rev].hex()))
1253 inindex = lambda rev: bool(index.getbundle(bundle[rev].hex()))
1229 if bundleheads:
1254 if bundleheads:
1230 newheadscount = sum(not inindex(rev) for rev in bundleheads)
1255 newheadscount = sum(not inindex(rev) for rev in bundleheads)
1231 else:
1256 else:
1232 newheadscount = 0
1257 newheadscount = 0
1233 # If there's a bookmark specified, there should be only one head,
1258 # If there's a bookmark specified, there should be only one head,
1234 # so we choose the last node, which will be that head.
1259 # so we choose the last node, which will be that head.
1235 # If a bug or malicious client allows there to be a bookmark
1260 # If a bug or malicious client allows there to be a bookmark
1236 # with multiple heads, we will place the bookmark on the last head.
1261 # with multiple heads, we will place the bookmark on the last head.
1237 bookmarknode = nodesctx[-1].hex() if nodesctx else None
1262 bookmarknode = nodesctx[-1].hex() if nodesctx else None
1238 key = None
1263 key = None
1239 if newheadscount:
1264 if newheadscount:
1240 with open(bundlefile, b'rb') as f:
1265 with open(bundlefile, b'rb') as f:
1241 bundledata = f.read()
1266 bundledata = f.read()
1242 with logservicecall(
1267 with logservicecall(
1243 log, b'bundlestore', bundlesize=len(bundledata)
1268 log, b'bundlestore', bundlesize=len(bundledata)
1244 ):
1269 ):
1245 bundlesizelimit = 100 * 1024 * 1024 # 100 MB
1270 bundlesizelimit = 100 * 1024 * 1024 # 100 MB
1246 if len(bundledata) > bundlesizelimit:
1271 if len(bundledata) > bundlesizelimit:
1247 error_msg = (
1272 error_msg = (
1248 b'bundle is too big: %d bytes. '
1273 b'bundle is too big: %d bytes. '
1249 + b'max allowed size is 100 MB'
1274 + b'max allowed size is 100 MB'
1250 )
1275 )
1251 raise error.Abort(error_msg % (len(bundledata),))
1276 raise error.Abort(error_msg % (len(bundledata),))
1252 key = store.write(bundledata)
1277 key = store.write(bundledata)
1253
1278
1254 with logservicecall(log, b'index', newheadscount=newheadscount), index:
1279 with logservicecall(log, b'index', newheadscount=newheadscount), index:
1255 if key:
1280 if key:
1256 index.addbundle(key, nodesctx)
1281 index.addbundle(key, nodesctx)
1257 if bookmark:
1282 if bookmark:
1258 index.addbookmark(bookmark, bookmarknode)
1283 index.addbookmark(bookmark, bookmarknode)
1259 _maybeaddpushbackpart(
1284 _maybeaddpushbackpart(
1260 op, bookmark, bookmarknode, bookprevnode, params
1285 op, bookmark, bookmarknode, bookprevnode, params
1261 )
1286 )
1262 log(
1287 log(
1263 scratchbranchparttype,
1288 scratchbranchparttype,
1264 eventtype=b'success',
1289 eventtype=b'success',
1265 elapsedms=(time.time() - parthandlerstart) * 1000,
1290 elapsedms=(time.time() - parthandlerstart) * 1000,
1266 )
1291 )
1267
1292
1268 except Exception as e:
1293 except Exception as e:
1269 log(
1294 log(
1270 scratchbranchparttype,
1295 scratchbranchparttype,
1271 eventtype=b'failure',
1296 eventtype=b'failure',
1272 elapsedms=(time.time() - parthandlerstart) * 1000,
1297 elapsedms=(time.time() - parthandlerstart) * 1000,
1273 errormsg=stringutil.forcebytestr(e),
1298 errormsg=stringutil.forcebytestr(e),
1274 )
1299 )
1275 raise
1300 raise
1276 finally:
1301 finally:
1277 if bundle:
1302 if bundle:
1278 bundle.close()
1303 bundle.close()
1279
1304
1280
1305
1281 @bundle2.parthandler(
1306 @bundle2.parthandler(
1282 scratchbranchparttype,
1307 scratchbranchparttype,
1283 (
1308 (
1284 b'bookmark',
1309 b'bookmark',
1285 b'bookprevnode',
1310 b'bookprevnode',
1286 b'force',
1311 b'force',
1287 b'pushbackbookmarks',
1312 b'pushbackbookmarks',
1288 b'cgversion',
1313 b'cgversion',
1289 ),
1314 ),
1290 )
1315 )
1291 def bundle2scratchbranch(op, part):
1316 def bundle2scratchbranch(op, part):
1292 '''unbundle a bundle2 part containing a changegroup to store'''
1317 '''unbundle a bundle2 part containing a changegroup to store'''
1293
1318
1294 bundler = bundle2.bundle20(op.repo.ui)
1319 bundler = bundle2.bundle20(op.repo.ui)
1295 cgversion = part.params.get(b'cgversion', b'01')
1320 cgversion = part.params.get(b'cgversion', b'01')
1296 cgpart = bundle2.bundlepart(b'changegroup', data=part.read())
1321 cgpart = bundle2.bundlepart(b'changegroup', data=part.read())
1297 cgpart.addparam(b'version', cgversion)
1322 cgpart.addparam(b'version', cgversion)
1298 bundler.addpart(cgpart)
1323 bundler.addpart(cgpart)
1299 buf = util.chunkbuffer(bundler.getchunks())
1324 buf = util.chunkbuffer(bundler.getchunks())
1300
1325
1301 fd, bundlefile = pycompat.mkstemp()
1326 fd, bundlefile = pycompat.mkstemp()
1302 try:
1327 try:
1303 try:
1328 try:
1304 fp = os.fdopen(fd, 'wb')
1329 fp = os.fdopen(fd, 'wb')
1305 fp.write(buf.read())
1330 fp.write(buf.read())
1306 finally:
1331 finally:
1307 fp.close()
1332 fp.close()
1308 storebundle(op, part.params, bundlefile)
1333 storebundle(op, part.params, bundlefile)
1309 finally:
1334 finally:
1310 try:
1335 try:
1311 os.unlink(bundlefile)
1336 os.unlink(bundlefile)
1312 except FileNotFoundError:
1337 except FileNotFoundError:
1313 pass
1338 pass
1314
1339
1315 return 1
1340 return 1
1316
1341
1317
1342
1318 def _maybeaddpushbackpart(op, bookmark, newnode, oldnode, params):
1343 def _maybeaddpushbackpart(op, bookmark, newnode, oldnode, params):
1319 if params.get(b'pushbackbookmarks'):
1344 if params.get(b'pushbackbookmarks'):
1320 if op.reply and b'pushback' in op.reply.capabilities:
1345 if op.reply and b'pushback' in op.reply.capabilities:
1321 params = {
1346 params = {
1322 b'namespace': b'bookmarks',
1347 b'namespace': b'bookmarks',
1323 b'key': bookmark,
1348 b'key': bookmark,
1324 b'new': newnode,
1349 b'new': newnode,
1325 b'old': oldnode,
1350 b'old': oldnode,
1326 }
1351 }
1327 op.reply.newpart(b'pushkey', mandatoryparams=params.items())
1352 op.reply.newpart(b'pushkey', mandatoryparams=params.items())
1328
1353
1329
1354
1330 def bundle2pushkey(orig, op, part):
1355 def bundle2pushkey(orig, op, part):
1331 """Wrapper of bundle2.handlepushkey()
1356 """Wrapper of bundle2.handlepushkey()
1332
1357
1333 The only goal is to skip calling the original function if flag is set.
1358 The only goal is to skip calling the original function if flag is set.
1334 It's set if infinitepush push is happening.
1359 It's set if infinitepush push is happening.
1335 """
1360 """
1336 if op.records[scratchbranchparttype + b'_skippushkey']:
1361 if op.records[scratchbranchparttype + b'_skippushkey']:
1337 if op.reply is not None:
1362 if op.reply is not None:
1338 rpart = op.reply.newpart(b'reply:pushkey')
1363 rpart = op.reply.newpart(b'reply:pushkey')
1339 rpart.addparam(b'in-reply-to', str(part.id), mandatory=False)
1364 rpart.addparam(b'in-reply-to', str(part.id), mandatory=False)
1340 rpart.addparam(b'return', b'1', mandatory=False)
1365 rpart.addparam(b'return', b'1', mandatory=False)
1341 return 1
1366 return 1
1342
1367
1343 return orig(op, part)
1368 return orig(op, part)
1344
1369
1345
1370
1346 def bundle2handlephases(orig, op, part):
1371 def bundle2handlephases(orig, op, part):
1347 """Wrapper of bundle2.handlephases()
1372 """Wrapper of bundle2.handlephases()
1348
1373
1349 The only goal is to skip calling the original function if flag is set.
1374 The only goal is to skip calling the original function if flag is set.
1350 It's set if infinitepush push is happening.
1375 It's set if infinitepush push is happening.
1351 """
1376 """
1352
1377
1353 if op.records[scratchbranchparttype + b'_skipphaseheads']:
1378 if op.records[scratchbranchparttype + b'_skipphaseheads']:
1354 return
1379 return
1355
1380
1356 return orig(op, part)
1381 return orig(op, part)
1357
1382
1358
1383
1359 def _asyncsavemetadata(root, nodes):
1384 def _asyncsavemetadata(root, nodes):
1360 """starts a separate process that fills metadata for the nodes
1385 """starts a separate process that fills metadata for the nodes
1361
1386
1362 This function creates a separate process and doesn't wait for it's
1387 This function creates a separate process and doesn't wait for it's
1363 completion. This was done to avoid slowing down pushes
1388 completion. This was done to avoid slowing down pushes
1364 """
1389 """
1365
1390
1366 maxnodes = 50
1391 maxnodes = 50
1367 if len(nodes) > maxnodes:
1392 if len(nodes) > maxnodes:
1368 return
1393 return
1369 nodesargs = []
1394 nodesargs = []
1370 for node in nodes:
1395 for node in nodes:
1371 nodesargs.append(b'--node')
1396 nodesargs.append(b'--node')
1372 nodesargs.append(node)
1397 nodesargs.append(node)
1373 with open(os.devnull, b'w+b') as devnull:
1398 with open(os.devnull, b'w+b') as devnull:
1374 cmdline = [
1399 cmdline = [
1375 util.hgexecutable(),
1400 util.hgexecutable(),
1376 b'debugfillinfinitepushmetadata',
1401 b'debugfillinfinitepushmetadata',
1377 b'-R',
1402 b'-R',
1378 root,
1403 root,
1379 ] + nodesargs
1404 ] + nodesargs
1380 # Process will run in background. We don't care about the return code
1405 # Process will run in background. We don't care about the return code
1381 subprocess.Popen(
1406 subprocess.Popen(
1382 pycompat.rapply(procutil.tonativestr, cmdline),
1407 pycompat.rapply(procutil.tonativestr, cmdline),
1383 close_fds=True,
1408 close_fds=True,
1384 shell=False,
1409 shell=False,
1385 stdin=devnull,
1410 stdin=devnull,
1386 stdout=devnull,
1411 stdout=devnull,
1387 stderr=devnull,
1412 stderr=devnull,
1388 )
1413 )
@@ -1,30 +1,33 b''
1 scratchnodes() {
1 scratchnodes() {
2 for node in `find ../repo/.hg/scratchbranches/index/nodemap/* | sort`; do
2 for node in `find ../repo/.hg/scratchbranches/index/nodemap/* | sort`; do
3 echo ${node##*/} `cat $node`
3 echo ${node##*/} `cat $node`
4 done
4 done
5 }
5 }
6
6
7 scratchbookmarks() {
7 scratchbookmarks() {
8 for bookmark in `find ../repo/.hg/scratchbranches/index/bookmarkmap/* -type f | sort`; do
8 for bookmark in `find ../repo/.hg/scratchbranches/index/bookmarkmap/* -type f | sort`; do
9 echo "${bookmark##*/bookmarkmap/} `cat $bookmark`"
9 echo "${bookmark##*/bookmarkmap/} `cat $bookmark`"
10 done
10 done
11 }
11 }
12
12
13 setupcommon() {
13 setupcommon() {
14 cat >> $HGRCPATH << EOF
14 cat >> $HGRCPATH << EOF
15 [extensions]
15 [extensions]
16 infinitepush=
16 infinitepush=
17 [infinitepush]
17 [infinitepush]
18 branchpattern=re:scratch/.*
18 branchpattern=re:scratch/.*
19 deprecation-abort=no
20 deprecation-message=yes
21
19 EOF
22 EOF
20 }
23 }
21
24
22 setupserver() {
25 setupserver() {
23 cat >> .hg/hgrc << EOF
26 cat >> .hg/hgrc << EOF
24 [infinitepush]
27 [infinitepush]
25 server=yes
28 server=yes
26 indextype=disk
29 indextype=disk
27 storetype=disk
30 storetype=disk
28 reponame=babar
31 reponame=babar
29 EOF
32 EOF
30 }
33 }
@@ -1,371 +1,755 b''
1 #require no-reposimplestore no-chg
1 #require no-reposimplestore no-chg
2
2
3 XXX-CHG this test hangs if `hg` is really `chg`. This was hidden by the use of
3 XXX-CHG this test hangs if `hg` is really `chg`. This was hidden by the use of
4 `alias hg=chg` by run-tests.py. With such alias removed, this test is revealed
4 `alias hg=chg` by run-tests.py. With such alias removed, this test is revealed
5 buggy. This need to be resolved sooner than later.
5 buggy. This need to be resolved sooner than later.
6
6
7
7
8 Testing infinipush extension and the confi options provided by it
8 Testing infinipush extension and the confi options provided by it
9
9
10 Create an ondisk bundlestore in .hg/scratchbranches
10 Create an ondisk bundlestore in .hg/scratchbranches
11 $ . "$TESTDIR/library-infinitepush.sh"
11 $ . "$TESTDIR/library-infinitepush.sh"
12 $ cp $HGRCPATH $TESTTMP/defaulthgrc
12 $ cp $HGRCPATH $TESTTMP/defaulthgrc
13 $ setupcommon
13 $ setupcommon
14 $ mkcommit() {
14 $ mkcommit() {
15 > echo "$1" > "$1"
15 > echo "$1" > "$1"
16 > hg add "$1"
16 > hg add "$1"
17 > hg ci -m "$1"
17 > hg ci -m "$1"
18 > }
18 > }
19 $ hg init repo
19 $ hg init repo
20 IMPORTANT: if you use this extension, please contact
21 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
22 unused and barring learning of users of this functionality, we drop this
23 extension in Mercurial 6.6.
20 $ cd repo
24 $ cd repo
21
25
22 Check that we can send a scratch on the server and it does not show there in
26 Check that we can send a scratch on the server and it does not show there in
23 the history but is stored on disk
27 the history but is stored on disk
24 $ setupserver
28 $ setupserver
25 $ cd ..
29 $ cd ..
26 $ hg clone ssh://user@dummy/repo client -q
30 $ hg clone ssh://user@dummy/repo client -q
31 remote: IMPORTANT: if you use this extension, please contact
32 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
33 remote: unused and barring learning of users of this functionality, we drop this
34 remote: extension in Mercurial 6.6.
35 IMPORTANT: if you use this extension, please contact
36 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
37 unused and barring learning of users of this functionality, we drop this
38 extension in Mercurial 6.6.
39 IMPORTANT: if you use this extension, please contact
40 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
41 unused and barring learning of users of this functionality, we drop this
42 extension in Mercurial 6.6.
27 $ cd client
43 $ cd client
28 $ mkcommit initialcommit
44 $ mkcommit initialcommit
45 IMPORTANT: if you use this extension, please contact
46 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
47 unused and barring learning of users of this functionality, we drop this
48 extension in Mercurial 6.6.
49 IMPORTANT: if you use this extension, please contact
50 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
51 unused and barring learning of users of this functionality, we drop this
52 extension in Mercurial 6.6.
29 $ hg push -r .
53 $ hg push -r .
54 IMPORTANT: if you use this extension, please contact
55 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
56 unused and barring learning of users of this functionality, we drop this
57 extension in Mercurial 6.6.
30 pushing to ssh://user@dummy/repo
58 pushing to ssh://user@dummy/repo
59 remote: IMPORTANT: if you use this extension, please contact
60 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
61 remote: unused and barring learning of users of this functionality, we drop this
62 remote: extension in Mercurial 6.6.
63 IMPORTANT: if you use this extension, please contact
64 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
65 unused and barring learning of users of this functionality, we drop this
66 extension in Mercurial 6.6.
31 searching for changes
67 searching for changes
32 remote: adding changesets
68 remote: adding changesets
33 remote: adding manifests
69 remote: adding manifests
34 remote: adding file changes
70 remote: adding file changes
35 remote: added 1 changesets with 1 changes to 1 files
71 remote: added 1 changesets with 1 changes to 1 files
36 $ mkcommit scratchcommit
72 $ mkcommit scratchcommit
73 IMPORTANT: if you use this extension, please contact
74 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
75 unused and barring learning of users of this functionality, we drop this
76 extension in Mercurial 6.6.
77 IMPORTANT: if you use this extension, please contact
78 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
79 unused and barring learning of users of this functionality, we drop this
80 extension in Mercurial 6.6.
37 $ hg push -r . -B scratch/mybranch
81 $ hg push -r . -B scratch/mybranch
82 IMPORTANT: if you use this extension, please contact
83 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
84 unused and barring learning of users of this functionality, we drop this
85 extension in Mercurial 6.6.
38 pushing to ssh://user@dummy/repo
86 pushing to ssh://user@dummy/repo
87 remote: IMPORTANT: if you use this extension, please contact
88 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
89 remote: unused and barring learning of users of this functionality, we drop this
90 remote: extension in Mercurial 6.6.
91 IMPORTANT: if you use this extension, please contact
92 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
93 unused and barring learning of users of this functionality, we drop this
94 extension in Mercurial 6.6.
39 searching for changes
95 searching for changes
96 remote: IMPORTANT: if you use this extension, please contact
97 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
98 remote: unused and barring learning of users of this functionality, we drop this
99 remote: extension in Mercurial 6.6.
40 remote: pushing 1 commit:
100 remote: pushing 1 commit:
41 remote: 20759b6926ce scratchcommit
101 remote: 20759b6926ce scratchcommit
42 $ hg log -G
102 $ hg log -G
103 IMPORTANT: if you use this extension, please contact
104 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
105 unused and barring learning of users of this functionality, we drop this
106 extension in Mercurial 6.6.
43 @ changeset: 1:20759b6926ce
107 @ changeset: 1:20759b6926ce
44 | bookmark: scratch/mybranch
108 | bookmark: scratch/mybranch
45 | tag: tip
109 | tag: tip
46 | user: test
110 | user: test
47 | date: Thu Jan 01 00:00:00 1970 +0000
111 | date: Thu Jan 01 00:00:00 1970 +0000
48 | summary: scratchcommit
112 | summary: scratchcommit
49 |
113 |
50 o changeset: 0:67145f466344
114 o changeset: 0:67145f466344
51 user: test
115 user: test
52 date: Thu Jan 01 00:00:00 1970 +0000
116 date: Thu Jan 01 00:00:00 1970 +0000
53 summary: initialcommit
117 summary: initialcommit
54
118
55 $ hg log -G -R ../repo
119 $ hg log -G -R ../repo
120 IMPORTANT: if you use this extension, please contact
121 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
122 unused and barring learning of users of this functionality, we drop this
123 extension in Mercurial 6.6.
56 o changeset: 0:67145f466344
124 o changeset: 0:67145f466344
57 tag: tip
125 tag: tip
58 user: test
126 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
127 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: initialcommit
128 summary: initialcommit
61
129
62 $ find ../repo/.hg/scratchbranches | sort
130 $ find ../repo/.hg/scratchbranches | sort
63 ../repo/.hg/scratchbranches
131 ../repo/.hg/scratchbranches
64 ../repo/.hg/scratchbranches/filebundlestore
132 ../repo/.hg/scratchbranches/filebundlestore
65 ../repo/.hg/scratchbranches/filebundlestore/b9
133 ../repo/.hg/scratchbranches/filebundlestore/b9
66 ../repo/.hg/scratchbranches/filebundlestore/b9/e1
134 ../repo/.hg/scratchbranches/filebundlestore/b9/e1
67 ../repo/.hg/scratchbranches/filebundlestore/b9/e1/b9e1ee5f93fb6d7c42496fc176c09839639dd9cc
135 ../repo/.hg/scratchbranches/filebundlestore/b9/e1/b9e1ee5f93fb6d7c42496fc176c09839639dd9cc
68 ../repo/.hg/scratchbranches/index
136 ../repo/.hg/scratchbranches/index
69 ../repo/.hg/scratchbranches/index/bookmarkmap
137 ../repo/.hg/scratchbranches/index/bookmarkmap
70 ../repo/.hg/scratchbranches/index/bookmarkmap/scratch
138 ../repo/.hg/scratchbranches/index/bookmarkmap/scratch
71 ../repo/.hg/scratchbranches/index/bookmarkmap/scratch/mybranch
139 ../repo/.hg/scratchbranches/index/bookmarkmap/scratch/mybranch
72 ../repo/.hg/scratchbranches/index/nodemap
140 ../repo/.hg/scratchbranches/index/nodemap
73 ../repo/.hg/scratchbranches/index/nodemap/20759b6926ce827d5a8c73eb1fa9726d6f7defb2
141 ../repo/.hg/scratchbranches/index/nodemap/20759b6926ce827d5a8c73eb1fa9726d6f7defb2
74
142
75 From another client we can get the scratchbranch if we ask for it explicitely
143 From another client we can get the scratchbranch if we ask for it explicitely
76
144
77 $ cd ..
145 $ cd ..
78 $ hg clone ssh://user@dummy/repo client2 -q
146 $ hg clone ssh://user@dummy/repo client2 -q
147 remote: IMPORTANT: if you use this extension, please contact
148 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
149 remote: unused and barring learning of users of this functionality, we drop this
150 remote: extension in Mercurial 6.6.
151 IMPORTANT: if you use this extension, please contact
152 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
153 unused and barring learning of users of this functionality, we drop this
154 extension in Mercurial 6.6.
155 IMPORTANT: if you use this extension, please contact
156 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
157 unused and barring learning of users of this functionality, we drop this
158 extension in Mercurial 6.6.
79 $ cd client2
159 $ cd client2
80 $ hg pull -B scratch/mybranch --traceback
160 $ hg pull -B scratch/mybranch --traceback
161 IMPORTANT: if you use this extension, please contact
162 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
163 unused and barring learning of users of this functionality, we drop this
164 extension in Mercurial 6.6.
165 remote: IMPORTANT: if you use this extension, please contact
166 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
167 remote: unused and barring learning of users of this functionality, we drop this
168 remote: extension in Mercurial 6.6.
169 IMPORTANT: if you use this extension, please contact
170 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
171 unused and barring learning of users of this functionality, we drop this
172 extension in Mercurial 6.6.
81 pulling from ssh://user@dummy/repo
173 pulling from ssh://user@dummy/repo
174 remote: IMPORTANT: if you use this extension, please contact
175 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
176 remote: unused and barring learning of users of this functionality, we drop this
177 remote: extension in Mercurial 6.6.
178 IMPORTANT: if you use this extension, please contact
179 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
180 unused and barring learning of users of this functionality, we drop this
181 extension in Mercurial 6.6.
82 searching for changes
182 searching for changes
183 remote: IMPORTANT: if you use this extension, please contact
184 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
185 remote: unused and barring learning of users of this functionality, we drop this
186 remote: extension in Mercurial 6.6.
83 adding changesets
187 adding changesets
84 adding manifests
188 adding manifests
85 adding file changes
189 adding file changes
86 added 1 changesets with 1 changes to 1 files
190 added 1 changesets with 1 changes to 1 files
87 new changesets 20759b6926ce (1 drafts)
191 new changesets 20759b6926ce (1 drafts)
88 (run 'hg update' to get a working copy)
192 (run 'hg update' to get a working copy)
89 $ hg log -G
193 $ hg log -G
194 IMPORTANT: if you use this extension, please contact
195 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
196 unused and barring learning of users of this functionality, we drop this
197 extension in Mercurial 6.6.
90 o changeset: 1:20759b6926ce
198 o changeset: 1:20759b6926ce
91 | bookmark: scratch/mybranch
199 | bookmark: scratch/mybranch
92 | tag: tip
200 | tag: tip
93 | user: test
201 | user: test
94 | date: Thu Jan 01 00:00:00 1970 +0000
202 | date: Thu Jan 01 00:00:00 1970 +0000
95 | summary: scratchcommit
203 | summary: scratchcommit
96 |
204 |
97 @ changeset: 0:67145f466344
205 @ changeset: 0:67145f466344
98 user: test
206 user: test
99 date: Thu Jan 01 00:00:00 1970 +0000
207 date: Thu Jan 01 00:00:00 1970 +0000
100 summary: initialcommit
208 summary: initialcommit
101
209
102 $ cd ..
210 $ cd ..
103
211
104 Push to non-scratch bookmark
212 Push to non-scratch bookmark
105
213
106 $ cd client
214 $ cd client
107 $ hg up 0
215 $ hg up 0
216 IMPORTANT: if you use this extension, please contact
217 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
218 unused and barring learning of users of this functionality, we drop this
219 extension in Mercurial 6.6.
108 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
220 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
109 $ mkcommit newcommit
221 $ mkcommit newcommit
222 IMPORTANT: if you use this extension, please contact
223 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
224 unused and barring learning of users of this functionality, we drop this
225 extension in Mercurial 6.6.
226 IMPORTANT: if you use this extension, please contact
227 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
228 unused and barring learning of users of this functionality, we drop this
229 extension in Mercurial 6.6.
110 created new head
230 created new head
111 $ hg push -r .
231 $ hg push -r .
232 IMPORTANT: if you use this extension, please contact
233 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
234 unused and barring learning of users of this functionality, we drop this
235 extension in Mercurial 6.6.
112 pushing to ssh://user@dummy/repo
236 pushing to ssh://user@dummy/repo
237 remote: IMPORTANT: if you use this extension, please contact
238 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
239 remote: unused and barring learning of users of this functionality, we drop this
240 remote: extension in Mercurial 6.6.
241 IMPORTANT: if you use this extension, please contact
242 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
243 unused and barring learning of users of this functionality, we drop this
244 extension in Mercurial 6.6.
113 searching for changes
245 searching for changes
114 remote: adding changesets
246 remote: adding changesets
115 remote: adding manifests
247 remote: adding manifests
116 remote: adding file changes
248 remote: adding file changes
117 remote: added 1 changesets with 1 changes to 1 files
249 remote: added 1 changesets with 1 changes to 1 files
118 $ hg log -G -T '{desc} {phase} {bookmarks}'
250 $ hg log -G -T '{desc} {phase} {bookmarks}'
251 IMPORTANT: if you use this extension, please contact
252 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
253 unused and barring learning of users of this functionality, we drop this
254 extension in Mercurial 6.6.
119 @ newcommit public
255 @ newcommit public
120 |
256 |
121 | o scratchcommit draft scratch/mybranch
257 | o scratchcommit draft scratch/mybranch
122 |/
258 |/
123 o initialcommit public
259 o initialcommit public
124
260
125
261
126 Push to scratch branch
262 Push to scratch branch
127 $ cd ../client2
263 $ cd ../client2
128 $ hg up -q scratch/mybranch
264 $ hg up -q scratch/mybranch
265 IMPORTANT: if you use this extension, please contact
266 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
267 unused and barring learning of users of this functionality, we drop this
268 extension in Mercurial 6.6.
129 $ mkcommit 'new scratch commit'
269 $ mkcommit 'new scratch commit'
270 IMPORTANT: if you use this extension, please contact
271 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
272 unused and barring learning of users of this functionality, we drop this
273 extension in Mercurial 6.6.
274 IMPORTANT: if you use this extension, please contact
275 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
276 unused and barring learning of users of this functionality, we drop this
277 extension in Mercurial 6.6.
130 $ hg push -r . -B scratch/mybranch
278 $ hg push -r . -B scratch/mybranch
279 IMPORTANT: if you use this extension, please contact
280 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
281 unused and barring learning of users of this functionality, we drop this
282 extension in Mercurial 6.6.
131 pushing to ssh://user@dummy/repo
283 pushing to ssh://user@dummy/repo
284 remote: IMPORTANT: if you use this extension, please contact
285 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
286 remote: unused and barring learning of users of this functionality, we drop this
287 remote: extension in Mercurial 6.6.
288 IMPORTANT: if you use this extension, please contact
289 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
290 unused and barring learning of users of this functionality, we drop this
291 extension in Mercurial 6.6.
132 searching for changes
292 searching for changes
293 remote: IMPORTANT: if you use this extension, please contact
294 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
295 remote: unused and barring learning of users of this functionality, we drop this
296 remote: extension in Mercurial 6.6.
133 remote: pushing 2 commits:
297 remote: pushing 2 commits:
134 remote: 20759b6926ce scratchcommit
298 remote: 20759b6926ce scratchcommit
135 remote: 1de1d7d92f89 new scratch commit
299 remote: 1de1d7d92f89 new scratch commit
136 $ hg log -G -T '{desc} {phase} {bookmarks}'
300 $ hg log -G -T '{desc} {phase} {bookmarks}'
301 IMPORTANT: if you use this extension, please contact
302 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
303 unused and barring learning of users of this functionality, we drop this
304 extension in Mercurial 6.6.
137 @ new scratch commit draft scratch/mybranch
305 @ new scratch commit draft scratch/mybranch
138 |
306 |
139 o scratchcommit draft
307 o scratchcommit draft
140 |
308 |
141 o initialcommit public
309 o initialcommit public
142
310
143 $ scratchnodes
311 $ scratchnodes
144 1de1d7d92f8965260391d0513fe8a8d5973d3042 bed63daed3beba97fff2e819a148cf415c217a85
312 1de1d7d92f8965260391d0513fe8a8d5973d3042 bed63daed3beba97fff2e819a148cf415c217a85
145 20759b6926ce827d5a8c73eb1fa9726d6f7defb2 bed63daed3beba97fff2e819a148cf415c217a85
313 20759b6926ce827d5a8c73eb1fa9726d6f7defb2 bed63daed3beba97fff2e819a148cf415c217a85
146
314
147 $ scratchbookmarks
315 $ scratchbookmarks
148 scratch/mybranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
316 scratch/mybranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
149
317
150 Push scratch bookmark with no new revs
318 Push scratch bookmark with no new revs
151 $ hg push -r . -B scratch/anotherbranch
319 $ hg push -r . -B scratch/anotherbranch
320 IMPORTANT: if you use this extension, please contact
321 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
322 unused and barring learning of users of this functionality, we drop this
323 extension in Mercurial 6.6.
152 pushing to ssh://user@dummy/repo
324 pushing to ssh://user@dummy/repo
325 remote: IMPORTANT: if you use this extension, please contact
326 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
327 remote: unused and barring learning of users of this functionality, we drop this
328 remote: extension in Mercurial 6.6.
329 IMPORTANT: if you use this extension, please contact
330 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
331 unused and barring learning of users of this functionality, we drop this
332 extension in Mercurial 6.6.
153 searching for changes
333 searching for changes
334 remote: IMPORTANT: if you use this extension, please contact
335 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
336 remote: unused and barring learning of users of this functionality, we drop this
337 remote: extension in Mercurial 6.6.
154 remote: pushing 2 commits:
338 remote: pushing 2 commits:
155 remote: 20759b6926ce scratchcommit
339 remote: 20759b6926ce scratchcommit
156 remote: 1de1d7d92f89 new scratch commit
340 remote: 1de1d7d92f89 new scratch commit
157 $ hg log -G -T '{desc} {phase} {bookmarks}'
341 $ hg log -G -T '{desc} {phase} {bookmarks}'
342 IMPORTANT: if you use this extension, please contact
343 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
344 unused and barring learning of users of this functionality, we drop this
345 extension in Mercurial 6.6.
158 @ new scratch commit draft scratch/anotherbranch scratch/mybranch
346 @ new scratch commit draft scratch/anotherbranch scratch/mybranch
159 |
347 |
160 o scratchcommit draft
348 o scratchcommit draft
161 |
349 |
162 o initialcommit public
350 o initialcommit public
163
351
164 $ scratchbookmarks
352 $ scratchbookmarks
165 scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
353 scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
166 scratch/mybranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
354 scratch/mybranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
167
355
168 Pull scratch and non-scratch bookmark at the same time
356 Pull scratch and non-scratch bookmark at the same time
169
357
170 $ hg -R ../repo book newbook
358 $ hg -R ../repo book newbook
359 IMPORTANT: if you use this extension, please contact
360 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
361 unused and barring learning of users of this functionality, we drop this
362 extension in Mercurial 6.6.
171 $ cd ../client
363 $ cd ../client
172 $ hg pull -B newbook -B scratch/mybranch --traceback
364 $ hg pull -B newbook -B scratch/mybranch --traceback
365 IMPORTANT: if you use this extension, please contact
366 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
367 unused and barring learning of users of this functionality, we drop this
368 extension in Mercurial 6.6.
369 remote: IMPORTANT: if you use this extension, please contact
370 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
371 remote: unused and barring learning of users of this functionality, we drop this
372 remote: extension in Mercurial 6.6.
373 IMPORTANT: if you use this extension, please contact
374 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
375 unused and barring learning of users of this functionality, we drop this
376 extension in Mercurial 6.6.
173 pulling from ssh://user@dummy/repo
377 pulling from ssh://user@dummy/repo
378 remote: IMPORTANT: if you use this extension, please contact
379 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
380 remote: unused and barring learning of users of this functionality, we drop this
381 remote: extension in Mercurial 6.6.
382 IMPORTANT: if you use this extension, please contact
383 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
384 unused and barring learning of users of this functionality, we drop this
385 extension in Mercurial 6.6.
174 searching for changes
386 searching for changes
387 remote: IMPORTANT: if you use this extension, please contact
388 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
389 remote: unused and barring learning of users of this functionality, we drop this
390 remote: extension in Mercurial 6.6.
175 adding changesets
391 adding changesets
176 adding manifests
392 adding manifests
177 adding file changes
393 adding file changes
178 adding remote bookmark newbook
394 adding remote bookmark newbook
179 added 1 changesets with 1 changes to 2 files
395 added 1 changesets with 1 changes to 2 files
180 new changesets 1de1d7d92f89 (1 drafts)
396 new changesets 1de1d7d92f89 (1 drafts)
181 (run 'hg update' to get a working copy)
397 (run 'hg update' to get a working copy)
182 $ hg log -G -T '{desc} {phase} {bookmarks}'
398 $ hg log -G -T '{desc} {phase} {bookmarks}'
399 IMPORTANT: if you use this extension, please contact
400 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
401 unused and barring learning of users of this functionality, we drop this
402 extension in Mercurial 6.6.
183 o new scratch commit draft scratch/mybranch
403 o new scratch commit draft scratch/mybranch
184 |
404 |
185 | @ newcommit public
405 | @ newcommit public
186 | |
406 | |
187 o | scratchcommit draft
407 o | scratchcommit draft
188 |/
408 |/
189 o initialcommit public
409 o initialcommit public
190
410
191
411
192 Push scratch revision without bookmark with --bundle-store
412 Push scratch revision without bookmark with --bundle-store
193
413
194 $ hg up -q tip
414 $ hg up -q tip
415 IMPORTANT: if you use this extension, please contact
416 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
417 unused and barring learning of users of this functionality, we drop this
418 extension in Mercurial 6.6.
195 $ mkcommit scratchcommitnobook
419 $ mkcommit scratchcommitnobook
420 IMPORTANT: if you use this extension, please contact
421 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
422 unused and barring learning of users of this functionality, we drop this
423 extension in Mercurial 6.6.
424 IMPORTANT: if you use this extension, please contact
425 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
426 unused and barring learning of users of this functionality, we drop this
427 extension in Mercurial 6.6.
196 $ hg log -G -T '{desc} {phase} {bookmarks}'
428 $ hg log -G -T '{desc} {phase} {bookmarks}'
429 IMPORTANT: if you use this extension, please contact
430 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
431 unused and barring learning of users of this functionality, we drop this
432 extension in Mercurial 6.6.
197 @ scratchcommitnobook draft
433 @ scratchcommitnobook draft
198 |
434 |
199 o new scratch commit draft scratch/mybranch
435 o new scratch commit draft scratch/mybranch
200 |
436 |
201 | o newcommit public
437 | o newcommit public
202 | |
438 | |
203 o | scratchcommit draft
439 o | scratchcommit draft
204 |/
440 |/
205 o initialcommit public
441 o initialcommit public
206
442
207 $ hg push -r . --bundle-store
443 $ hg push -r . --bundle-store
444 IMPORTANT: if you use this extension, please contact
445 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
446 unused and barring learning of users of this functionality, we drop this
447 extension in Mercurial 6.6.
208 pushing to ssh://user@dummy/repo
448 pushing to ssh://user@dummy/repo
449 remote: IMPORTANT: if you use this extension, please contact
450 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
451 remote: unused and barring learning of users of this functionality, we drop this
452 remote: extension in Mercurial 6.6.
453 IMPORTANT: if you use this extension, please contact
454 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
455 unused and barring learning of users of this functionality, we drop this
456 extension in Mercurial 6.6.
209 searching for changes
457 searching for changes
458 remote: IMPORTANT: if you use this extension, please contact
459 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
460 remote: unused and barring learning of users of this functionality, we drop this
461 remote: extension in Mercurial 6.6.
210 remote: pushing 3 commits:
462 remote: pushing 3 commits:
211 remote: 20759b6926ce scratchcommit
463 remote: 20759b6926ce scratchcommit
212 remote: 1de1d7d92f89 new scratch commit
464 remote: 1de1d7d92f89 new scratch commit
213 remote: 2b5d271c7e0d scratchcommitnobook
465 remote: 2b5d271c7e0d scratchcommitnobook
214 $ hg -R ../repo log -G -T '{desc} {phase}'
466 $ hg -R ../repo log -G -T '{desc} {phase}'
467 IMPORTANT: if you use this extension, please contact
468 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
469 unused and barring learning of users of this functionality, we drop this
470 extension in Mercurial 6.6.
215 o newcommit public
471 o newcommit public
216 |
472 |
217 o initialcommit public
473 o initialcommit public
218
474
219
475
220 $ scratchnodes
476 $ scratchnodes
221 1de1d7d92f8965260391d0513fe8a8d5973d3042 66fa08ff107451320512817bed42b7f467a1bec3
477 1de1d7d92f8965260391d0513fe8a8d5973d3042 66fa08ff107451320512817bed42b7f467a1bec3
222 20759b6926ce827d5a8c73eb1fa9726d6f7defb2 66fa08ff107451320512817bed42b7f467a1bec3
478 20759b6926ce827d5a8c73eb1fa9726d6f7defb2 66fa08ff107451320512817bed42b7f467a1bec3
223 2b5d271c7e0d25d811359a314d413ebcc75c9524 66fa08ff107451320512817bed42b7f467a1bec3
479 2b5d271c7e0d25d811359a314d413ebcc75c9524 66fa08ff107451320512817bed42b7f467a1bec3
224
480
225 Test with pushrebase
481 Test with pushrebase
226 $ mkcommit scratchcommitwithpushrebase
482 $ mkcommit scratchcommitwithpushrebase
483 IMPORTANT: if you use this extension, please contact
484 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
485 unused and barring learning of users of this functionality, we drop this
486 extension in Mercurial 6.6.
487 IMPORTANT: if you use this extension, please contact
488 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
489 unused and barring learning of users of this functionality, we drop this
490 extension in Mercurial 6.6.
227 $ hg push -r . -B scratch/mybranch
491 $ hg push -r . -B scratch/mybranch
492 IMPORTANT: if you use this extension, please contact
493 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
494 unused and barring learning of users of this functionality, we drop this
495 extension in Mercurial 6.6.
228 pushing to ssh://user@dummy/repo
496 pushing to ssh://user@dummy/repo
497 remote: IMPORTANT: if you use this extension, please contact
498 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
499 remote: unused and barring learning of users of this functionality, we drop this
500 remote: extension in Mercurial 6.6.
501 IMPORTANT: if you use this extension, please contact
502 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
503 unused and barring learning of users of this functionality, we drop this
504 extension in Mercurial 6.6.
229 searching for changes
505 searching for changes
506 remote: IMPORTANT: if you use this extension, please contact
507 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
508 remote: unused and barring learning of users of this functionality, we drop this
509 remote: extension in Mercurial 6.6.
230 remote: pushing 4 commits:
510 remote: pushing 4 commits:
231 remote: 20759b6926ce scratchcommit
511 remote: 20759b6926ce scratchcommit
232 remote: 1de1d7d92f89 new scratch commit
512 remote: 1de1d7d92f89 new scratch commit
233 remote: 2b5d271c7e0d scratchcommitnobook
513 remote: 2b5d271c7e0d scratchcommitnobook
234 remote: d8c4f54ab678 scratchcommitwithpushrebase
514 remote: d8c4f54ab678 scratchcommitwithpushrebase
235 $ hg -R ../repo log -G -T '{desc} {phase}'
515 $ hg -R ../repo log -G -T '{desc} {phase}'
516 IMPORTANT: if you use this extension, please contact
517 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
518 unused and barring learning of users of this functionality, we drop this
519 extension in Mercurial 6.6.
236 o newcommit public
520 o newcommit public
237 |
521 |
238 o initialcommit public
522 o initialcommit public
239
523
240 $ scratchnodes
524 $ scratchnodes
241 1de1d7d92f8965260391d0513fe8a8d5973d3042 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
525 1de1d7d92f8965260391d0513fe8a8d5973d3042 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
242 20759b6926ce827d5a8c73eb1fa9726d6f7defb2 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
526 20759b6926ce827d5a8c73eb1fa9726d6f7defb2 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
243 2b5d271c7e0d25d811359a314d413ebcc75c9524 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
527 2b5d271c7e0d25d811359a314d413ebcc75c9524 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
244 d8c4f54ab678fd67cb90bb3f272a2dc6513a59a7 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
528 d8c4f54ab678fd67cb90bb3f272a2dc6513a59a7 e3cb2ac50f9e1e6a5ead3217fc21236c84af4397
245
529
246 Change the order of pushrebase and infinitepush
530 Change the order of pushrebase and infinitepush
247 $ mkcommit scratchcommitwithpushrebase2
531 $ mkcommit scratchcommitwithpushrebase2
532 IMPORTANT: if you use this extension, please contact
533 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
534 unused and barring learning of users of this functionality, we drop this
535 extension in Mercurial 6.6.
536 IMPORTANT: if you use this extension, please contact
537 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
538 unused and barring learning of users of this functionality, we drop this
539 extension in Mercurial 6.6.
248 $ hg push -r . -B scratch/mybranch
540 $ hg push -r . -B scratch/mybranch
541 IMPORTANT: if you use this extension, please contact
542 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
543 unused and barring learning of users of this functionality, we drop this
544 extension in Mercurial 6.6.
249 pushing to ssh://user@dummy/repo
545 pushing to ssh://user@dummy/repo
546 remote: IMPORTANT: if you use this extension, please contact
547 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
548 remote: unused and barring learning of users of this functionality, we drop this
549 remote: extension in Mercurial 6.6.
550 IMPORTANT: if you use this extension, please contact
551 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
552 unused and barring learning of users of this functionality, we drop this
553 extension in Mercurial 6.6.
250 searching for changes
554 searching for changes
555 remote: IMPORTANT: if you use this extension, please contact
556 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
557 remote: unused and barring learning of users of this functionality, we drop this
558 remote: extension in Mercurial 6.6.
251 remote: pushing 5 commits:
559 remote: pushing 5 commits:
252 remote: 20759b6926ce scratchcommit
560 remote: 20759b6926ce scratchcommit
253 remote: 1de1d7d92f89 new scratch commit
561 remote: 1de1d7d92f89 new scratch commit
254 remote: 2b5d271c7e0d scratchcommitnobook
562 remote: 2b5d271c7e0d scratchcommitnobook
255 remote: d8c4f54ab678 scratchcommitwithpushrebase
563 remote: d8c4f54ab678 scratchcommitwithpushrebase
256 remote: 6c10d49fe927 scratchcommitwithpushrebase2
564 remote: 6c10d49fe927 scratchcommitwithpushrebase2
257 $ hg -R ../repo log -G -T '{desc} {phase}'
565 $ hg -R ../repo log -G -T '{desc} {phase}'
566 IMPORTANT: if you use this extension, please contact
567 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
568 unused and barring learning of users of this functionality, we drop this
569 extension in Mercurial 6.6.
258 o newcommit public
570 o newcommit public
259 |
571 |
260 o initialcommit public
572 o initialcommit public
261
573
262 $ scratchnodes
574 $ scratchnodes
263 1de1d7d92f8965260391d0513fe8a8d5973d3042 cd0586065eaf8b483698518f5fc32531e36fd8e0
575 1de1d7d92f8965260391d0513fe8a8d5973d3042 cd0586065eaf8b483698518f5fc32531e36fd8e0
264 20759b6926ce827d5a8c73eb1fa9726d6f7defb2 cd0586065eaf8b483698518f5fc32531e36fd8e0
576 20759b6926ce827d5a8c73eb1fa9726d6f7defb2 cd0586065eaf8b483698518f5fc32531e36fd8e0
265 2b5d271c7e0d25d811359a314d413ebcc75c9524 cd0586065eaf8b483698518f5fc32531e36fd8e0
577 2b5d271c7e0d25d811359a314d413ebcc75c9524 cd0586065eaf8b483698518f5fc32531e36fd8e0
266 6c10d49fe92751666c40263f96721b918170d3da cd0586065eaf8b483698518f5fc32531e36fd8e0
578 6c10d49fe92751666c40263f96721b918170d3da cd0586065eaf8b483698518f5fc32531e36fd8e0
267 d8c4f54ab678fd67cb90bb3f272a2dc6513a59a7 cd0586065eaf8b483698518f5fc32531e36fd8e0
579 d8c4f54ab678fd67cb90bb3f272a2dc6513a59a7 cd0586065eaf8b483698518f5fc32531e36fd8e0
268
580
269 Non-fastforward scratch bookmark push
581 Non-fastforward scratch bookmark push
270
582
271 $ hg log -GT "{rev}:{node} {desc}\n"
583 $ hg log -GT "{rev}:{node} {desc}\n"
584 IMPORTANT: if you use this extension, please contact
585 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
586 unused and barring learning of users of this functionality, we drop this
587 extension in Mercurial 6.6.
272 @ 6:6c10d49fe92751666c40263f96721b918170d3da scratchcommitwithpushrebase2
588 @ 6:6c10d49fe92751666c40263f96721b918170d3da scratchcommitwithpushrebase2
273 |
589 |
274 o 5:d8c4f54ab678fd67cb90bb3f272a2dc6513a59a7 scratchcommitwithpushrebase
590 o 5:d8c4f54ab678fd67cb90bb3f272a2dc6513a59a7 scratchcommitwithpushrebase
275 |
591 |
276 o 4:2b5d271c7e0d25d811359a314d413ebcc75c9524 scratchcommitnobook
592 o 4:2b5d271c7e0d25d811359a314d413ebcc75c9524 scratchcommitnobook
277 |
593 |
278 o 3:1de1d7d92f8965260391d0513fe8a8d5973d3042 new scratch commit
594 o 3:1de1d7d92f8965260391d0513fe8a8d5973d3042 new scratch commit
279 |
595 |
280 | o 2:91894e11e8255bf41aa5434b7b98e8b2aa2786eb newcommit
596 | o 2:91894e11e8255bf41aa5434b7b98e8b2aa2786eb newcommit
281 | |
597 | |
282 o | 1:20759b6926ce827d5a8c73eb1fa9726d6f7defb2 scratchcommit
598 o | 1:20759b6926ce827d5a8c73eb1fa9726d6f7defb2 scratchcommit
283 |/
599 |/
284 o 0:67145f4663446a9580364f70034fea6e21293b6f initialcommit
600 o 0:67145f4663446a9580364f70034fea6e21293b6f initialcommit
285
601
286 $ hg up 6c10d49fe927
602 $ hg up 6c10d49fe927
603 IMPORTANT: if you use this extension, please contact
604 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
605 unused and barring learning of users of this functionality, we drop this
606 extension in Mercurial 6.6.
287 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
607 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 $ echo 1 > amend
608 $ echo 1 > amend
289 $ hg add amend
609 $ hg add amend
610 IMPORTANT: if you use this extension, please contact
611 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
612 unused and barring learning of users of this functionality, we drop this
613 extension in Mercurial 6.6.
290 $ hg ci --amend -m 'scratch amended commit'
614 $ hg ci --amend -m 'scratch amended commit'
615 IMPORTANT: if you use this extension, please contact
616 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
617 unused and barring learning of users of this functionality, we drop this
618 extension in Mercurial 6.6.
291 saved backup bundle to $TESTTMP/client/.hg/strip-backup/6c10d49fe927-c99ffec5-amend.hg
619 saved backup bundle to $TESTTMP/client/.hg/strip-backup/6c10d49fe927-c99ffec5-amend.hg
292 $ hg log -G -T '{desc} {phase} {bookmarks}'
620 $ hg log -G -T '{desc} {phase} {bookmarks}'
621 IMPORTANT: if you use this extension, please contact
622 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
623 unused and barring learning of users of this functionality, we drop this
624 extension in Mercurial 6.6.
293 @ scratch amended commit draft scratch/mybranch
625 @ scratch amended commit draft scratch/mybranch
294 |
626 |
295 o scratchcommitwithpushrebase draft
627 o scratchcommitwithpushrebase draft
296 |
628 |
297 o scratchcommitnobook draft
629 o scratchcommitnobook draft
298 |
630 |
299 o new scratch commit draft
631 o new scratch commit draft
300 |
632 |
301 | o newcommit public
633 | o newcommit public
302 | |
634 | |
303 o | scratchcommit draft
635 o | scratchcommit draft
304 |/
636 |/
305 o initialcommit public
637 o initialcommit public
306
638
307
639
308 $ scratchbookmarks
640 $ scratchbookmarks
309 scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
641 scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
310 scratch/mybranch 6c10d49fe92751666c40263f96721b918170d3da
642 scratch/mybranch 6c10d49fe92751666c40263f96721b918170d3da
311 $ hg push -r . -B scratch/mybranch
643 $ hg push -r . -B scratch/mybranch
644 IMPORTANT: if you use this extension, please contact
645 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
646 unused and barring learning of users of this functionality, we drop this
647 extension in Mercurial 6.6.
312 pushing to ssh://user@dummy/repo
648 pushing to ssh://user@dummy/repo
649 remote: IMPORTANT: if you use this extension, please contact
650 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
651 remote: unused and barring learning of users of this functionality, we drop this
652 remote: extension in Mercurial 6.6.
653 IMPORTANT: if you use this extension, please contact
654 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
655 unused and barring learning of users of this functionality, we drop this
656 extension in Mercurial 6.6.
313 searching for changes
657 searching for changes
658 remote: IMPORTANT: if you use this extension, please contact
659 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
660 remote: unused and barring learning of users of this functionality, we drop this
661 remote: extension in Mercurial 6.6.
314 remote: pushing 5 commits:
662 remote: pushing 5 commits:
315 remote: 20759b6926ce scratchcommit
663 remote: 20759b6926ce scratchcommit
316 remote: 1de1d7d92f89 new scratch commit
664 remote: 1de1d7d92f89 new scratch commit
317 remote: 2b5d271c7e0d scratchcommitnobook
665 remote: 2b5d271c7e0d scratchcommitnobook
318 remote: d8c4f54ab678 scratchcommitwithpushrebase
666 remote: d8c4f54ab678 scratchcommitwithpushrebase
319 remote: 8872775dd97a scratch amended commit
667 remote: 8872775dd97a scratch amended commit
320 $ scratchbookmarks
668 $ scratchbookmarks
321 scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
669 scratch/anotherbranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
322 scratch/mybranch 8872775dd97a750e1533dc1fbbca665644b32547
670 scratch/mybranch 8872775dd97a750e1533dc1fbbca665644b32547
323 $ hg log -G -T '{desc} {phase} {bookmarks}'
671 $ hg log -G -T '{desc} {phase} {bookmarks}'
672 IMPORTANT: if you use this extension, please contact
673 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
674 unused and barring learning of users of this functionality, we drop this
675 extension in Mercurial 6.6.
324 @ scratch amended commit draft scratch/mybranch
676 @ scratch amended commit draft scratch/mybranch
325 |
677 |
326 o scratchcommitwithpushrebase draft
678 o scratchcommitwithpushrebase draft
327 |
679 |
328 o scratchcommitnobook draft
680 o scratchcommitnobook draft
329 |
681 |
330 o new scratch commit draft
682 o new scratch commit draft
331 |
683 |
332 | o newcommit public
684 | o newcommit public
333 | |
685 | |
334 o | scratchcommit draft
686 o | scratchcommit draft
335 |/
687 |/
336 o initialcommit public
688 o initialcommit public
337
689
338 Check that push path is not ignored. Add new path to the hgrc
690 Check that push path is not ignored. Add new path to the hgrc
339 $ cat >> .hg/hgrc << EOF
691 $ cat >> .hg/hgrc << EOF
340 > [paths]
692 > [paths]
341 > peer=ssh://user@dummy/client2
693 > peer=ssh://user@dummy/client2
342 > EOF
694 > EOF
343
695
344 Checkout last non-scrath commit
696 Checkout last non-scrath commit
345 $ hg up 91894e11e8255
697 $ hg up 91894e11e8255
698 IMPORTANT: if you use this extension, please contact
699 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
700 unused and barring learning of users of this functionality, we drop this
701 extension in Mercurial 6.6.
346 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
702 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
347 $ mkcommit peercommit
703 $ mkcommit peercommit
704 IMPORTANT: if you use this extension, please contact
705 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
706 unused and barring learning of users of this functionality, we drop this
707 extension in Mercurial 6.6.
708 IMPORTANT: if you use this extension, please contact
709 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
710 unused and barring learning of users of this functionality, we drop this
711 extension in Mercurial 6.6.
348 Use --force because this push creates new head
712 Use --force because this push creates new head
349 $ hg push peer -r . -f
713 $ hg push peer -r . -f
714 IMPORTANT: if you use this extension, please contact
715 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
716 unused and barring learning of users of this functionality, we drop this
717 extension in Mercurial 6.6.
350 pushing to ssh://user@dummy/client2
718 pushing to ssh://user@dummy/client2
719 remote: IMPORTANT: if you use this extension, please contact
720 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
721 remote: unused and barring learning of users of this functionality, we drop this
722 remote: extension in Mercurial 6.6.
723 IMPORTANT: if you use this extension, please contact
724 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
725 unused and barring learning of users of this functionality, we drop this
726 extension in Mercurial 6.6.
351 searching for changes
727 searching for changes
352 remote: adding changesets
728 remote: adding changesets
353 remote: adding manifests
729 remote: adding manifests
354 remote: adding file changes
730 remote: adding file changes
355 remote: added 2 changesets with 2 changes to 2 files (+1 heads)
731 remote: added 2 changesets with 2 changes to 2 files (+1 heads)
356 $ hg -R ../repo log -G -T '{desc} {phase} {bookmarks}'
732 $ hg -R ../repo log -G -T '{desc} {phase} {bookmarks}'
733 IMPORTANT: if you use this extension, please contact
734 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
735 unused and barring learning of users of this functionality, we drop this
736 extension in Mercurial 6.6.
357 o newcommit public
737 o newcommit public
358 |
738 |
359 o initialcommit public
739 o initialcommit public
360
740
361 $ hg -R ../client2 log -G -T '{desc} {phase} {bookmarks}'
741 $ hg -R ../client2 log -G -T '{desc} {phase} {bookmarks}'
742 IMPORTANT: if you use this extension, please contact
743 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
744 unused and barring learning of users of this functionality, we drop this
745 extension in Mercurial 6.6.
362 o peercommit public
746 o peercommit public
363 |
747 |
364 o newcommit public
748 o newcommit public
365 |
749 |
366 | @ new scratch commit draft scratch/anotherbranch scratch/mybranch
750 | @ new scratch commit draft scratch/anotherbranch scratch/mybranch
367 | |
751 | |
368 | o scratchcommit draft
752 | o scratchcommit draft
369 |/
753 |/
370 o initialcommit public
754 o initialcommit public
371
755
@@ -1,441 +1,579 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 Testing the case when there is no infinitepush extension present on the client
3 Testing the case when there is no infinitepush extension present on the client
4 side and the server routes each push to bundlestore. This case is very much
4 side and the server routes each push to bundlestore. This case is very much
5 similar to CI use case.
5 similar to CI use case.
6
6
7 Setup
7 Setup
8 -----
8 -----
9
9
10 $ . "$TESTDIR/library-infinitepush.sh"
10 $ . "$TESTDIR/library-infinitepush.sh"
11 $ cat >> $HGRCPATH <<EOF
11 $ cat >> $HGRCPATH <<EOF
12 > [alias]
12 > [alias]
13 > glog = log -GT "{rev}:{node|short} {desc}\n{phase}"
13 > glog = log -GT "{rev}:{node|short} {desc}\n{phase}"
14 > EOF
14 > EOF
15 $ cp $HGRCPATH $TESTTMP/defaulthgrc
15 $ cp $HGRCPATH $TESTTMP/defaulthgrc
16 $ hg init repo
16 $ hg init repo
17 $ cd repo
17 $ cd repo
18 $ setupserver
18 $ setupserver
19 $ echo "pushtobundlestore = True" >> .hg/hgrc
19 $ echo "pushtobundlestore = True" >> .hg/hgrc
20 $ echo "[extensions]" >> .hg/hgrc
20 $ echo "[extensions]" >> .hg/hgrc
21 $ echo "infinitepush=" >> .hg/hgrc
21 $ echo "infinitepush=" >> .hg/hgrc
22 $ echo "[infinitepush]" >> .hg/hgrc
23 $ echo "deprecation-abort=no" >> .hg/hgrc
22 $ echo initialcommit > initialcommit
24 $ echo initialcommit > initialcommit
23 $ hg ci -Aqm "initialcommit"
25 $ hg ci -Aqm "initialcommit"
26 IMPORTANT: if you use this extension, please contact
27 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
28 unused and barring learning of users of this functionality, we drop this
29 extension in Mercurial 6.6.
30 IMPORTANT: if you use this extension, please contact (chg !)
31 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be (chg !)
32 unused and barring learning of users of this functionality, we drop this (chg !)
33 extension in Mercurial 6.6. (chg !)
24 $ hg phase --public .
34 $ hg phase --public .
35 IMPORTANT: if you use this extension, please contact
36 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
37 unused and barring learning of users of this functionality, we drop this
38 extension in Mercurial 6.6.
25
39
26 $ cd ..
40 $ cd ..
27 $ hg clone repo client -q
41 $ hg clone repo client -q
42 IMPORTANT: if you use this extension, please contact
43 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
44 unused and barring learning of users of this functionality, we drop this
45 extension in Mercurial 6.6.
28 $ hg clone repo client2 -q
46 $ hg clone repo client2 -q
47 IMPORTANT: if you use this extension, please contact
48 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
49 unused and barring learning of users of this functionality, we drop this
50 extension in Mercurial 6.6.
29 $ hg clone ssh://user@dummy/repo client3 -q
51 $ hg clone ssh://user@dummy/repo client3 -q
52 remote: IMPORTANT: if you use this extension, please contact
53 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
54 remote: unused and barring learning of users of this functionality, we drop this
55 remote: extension in Mercurial 6.6.
30 $ cd client
56 $ cd client
31
57
32 Pushing a new commit from the client to the server
58 Pushing a new commit from the client to the server
33 -----------------------------------------------------
59 -----------------------------------------------------
34
60
35 $ echo foobar > a
61 $ echo foobar > a
36 $ hg ci -Aqm "added a"
62 $ hg ci -Aqm "added a"
37 $ hg glog
63 $ hg glog
38 @ 1:6cb0989601f1 added a
64 @ 1:6cb0989601f1 added a
39 | draft
65 | draft
40 o 0:67145f466344 initialcommit
66 o 0:67145f466344 initialcommit
41 public
67 public
42
68
43 $ hg push
69 $ hg push
44 pushing to $TESTTMP/repo
70 pushing to $TESTTMP/repo
71 IMPORTANT: if you use this extension, please contact
72 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
73 unused and barring learning of users of this functionality, we drop this
74 extension in Mercurial 6.6.
45 searching for changes
75 searching for changes
46 storing changesets on the bundlestore
76 storing changesets on the bundlestore
77 IMPORTANT: if you use this extension, please contact
78 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
79 unused and barring learning of users of this functionality, we drop this
80 extension in Mercurial 6.6.
47 pushing 1 commit:
81 pushing 1 commit:
48 6cb0989601f1 added a
82 6cb0989601f1 added a
49
83
50 $ scratchnodes
84 $ scratchnodes
51 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
85 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
52
86
53 Understanding how data is stored on the bundlestore in server
87 Understanding how data is stored on the bundlestore in server
54 -------------------------------------------------------------
88 -------------------------------------------------------------
55
89
56 There are two things, filebundlestore and index
90 There are two things, filebundlestore and index
57 $ ls ../repo/.hg/scratchbranches
91 $ ls ../repo/.hg/scratchbranches
58 filebundlestore
92 filebundlestore
59 index
93 index
60
94
61 filebundlestore stores the bundles
95 filebundlestore stores the bundles
62 $ ls ../repo/.hg/scratchbranches/filebundlestore/3b/41/
96 $ ls ../repo/.hg/scratchbranches/filebundlestore/3b/41/
63 3b414252ff8acab801318445d88ff48faf4a28c3
97 3b414252ff8acab801318445d88ff48faf4a28c3
64
98
65 index/nodemap stores a map of node id and file in which bundle is stored in filebundlestore
99 index/nodemap stores a map of node id and file in which bundle is stored in filebundlestore
66 $ ls ../repo/.hg/scratchbranches/index/
100 $ ls ../repo/.hg/scratchbranches/index/
67 nodemap
101 nodemap
68 $ ls ../repo/.hg/scratchbranches/index/nodemap/
102 $ ls ../repo/.hg/scratchbranches/index/nodemap/
69 6cb0989601f1fb5805238edfb16f3606713d9a0b
103 6cb0989601f1fb5805238edfb16f3606713d9a0b
70
104
71 $ cd ../repo
105 $ cd ../repo
72
106
73 Checking that the commit was not applied to revlog on the server
107 Checking that the commit was not applied to revlog on the server
74 ------------------------------------------------------------------
108 ------------------------------------------------------------------
75
109
76 $ hg glog
110 $ hg glog
111 IMPORTANT: if you use this extension, please contact
112 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
113 unused and barring learning of users of this functionality, we drop this
114 extension in Mercurial 6.6.
77 @ 0:67145f466344 initialcommit
115 @ 0:67145f466344 initialcommit
78 public
116 public
79
117
80 Applying the changeset from the bundlestore
118 Applying the changeset from the bundlestore
81 --------------------------------------------
119 --------------------------------------------
82
120
83 $ hg unbundle .hg/scratchbranches/filebundlestore/3b/41/3b414252ff8acab801318445d88ff48faf4a28c3
121 $ hg unbundle .hg/scratchbranches/filebundlestore/3b/41/3b414252ff8acab801318445d88ff48faf4a28c3
122 IMPORTANT: if you use this extension, please contact
123 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
124 unused and barring learning of users of this functionality, we drop this
125 extension in Mercurial 6.6.
84 adding changesets
126 adding changesets
85 adding manifests
127 adding manifests
86 adding file changes
128 adding file changes
87 added 1 changesets with 1 changes to 1 files
129 added 1 changesets with 1 changes to 1 files
88 new changesets 6cb0989601f1
130 new changesets 6cb0989601f1
89 (run 'hg update' to get a working copy)
131 (run 'hg update' to get a working copy)
90
132
91 $ hg glog
133 $ hg glog
134 IMPORTANT: if you use this extension, please contact
135 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
136 unused and barring learning of users of this functionality, we drop this
137 extension in Mercurial 6.6.
92 o 1:6cb0989601f1 added a
138 o 1:6cb0989601f1 added a
93 | public
139 | public
94 @ 0:67145f466344 initialcommit
140 @ 0:67145f466344 initialcommit
95 public
141 public
96
142
97 Pushing more changesets from the local repo
143 Pushing more changesets from the local repo
98 --------------------------------------------
144 --------------------------------------------
99
145
100 $ cd ../client
146 $ cd ../client
101 $ echo b > b
147 $ echo b > b
102 $ hg ci -Aqm "added b"
148 $ hg ci -Aqm "added b"
103 $ echo c > c
149 $ echo c > c
104 $ hg ci -Aqm "added c"
150 $ hg ci -Aqm "added c"
105 $ hg glog
151 $ hg glog
106 @ 3:bf8a6e3011b3 added c
152 @ 3:bf8a6e3011b3 added c
107 | draft
153 | draft
108 o 2:eaba929e866c added b
154 o 2:eaba929e866c added b
109 | draft
155 | draft
110 o 1:6cb0989601f1 added a
156 o 1:6cb0989601f1 added a
111 | public
157 | public
112 o 0:67145f466344 initialcommit
158 o 0:67145f466344 initialcommit
113 public
159 public
114
160
115 $ hg push
161 $ hg push
116 pushing to $TESTTMP/repo
162 pushing to $TESTTMP/repo
163 IMPORTANT: if you use this extension, please contact
164 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
165 unused and barring learning of users of this functionality, we drop this
166 extension in Mercurial 6.6.
117 searching for changes
167 searching for changes
118 storing changesets on the bundlestore
168 storing changesets on the bundlestore
169 IMPORTANT: if you use this extension, please contact
170 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
171 unused and barring learning of users of this functionality, we drop this
172 extension in Mercurial 6.6.
119 pushing 2 commits:
173 pushing 2 commits:
120 eaba929e866c added b
174 eaba929e866c added b
121 bf8a6e3011b3 added c
175 bf8a6e3011b3 added c
122
176
123 Checking that changesets are not applied on the server
177 Checking that changesets are not applied on the server
124 ------------------------------------------------------
178 ------------------------------------------------------
125
179
126 $ hg glog -R ../repo
180 $ hg glog -R ../repo
181 IMPORTANT: if you use this extension, please contact
182 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
183 unused and barring learning of users of this functionality, we drop this
184 extension in Mercurial 6.6.
127 o 1:6cb0989601f1 added a
185 o 1:6cb0989601f1 added a
128 | public
186 | public
129 @ 0:67145f466344 initialcommit
187 @ 0:67145f466344 initialcommit
130 public
188 public
131
189
132 Both of the new changesets are stored in a single bundle-file
190 Both of the new changesets are stored in a single bundle-file
133 $ scratchnodes
191 $ scratchnodes
134 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
192 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
135 bf8a6e3011b345146bbbedbcb1ebd4837571492a 239585f5e61f0c09ce7106bdc1097bff731738f4
193 bf8a6e3011b345146bbbedbcb1ebd4837571492a 239585f5e61f0c09ce7106bdc1097bff731738f4
136 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 239585f5e61f0c09ce7106bdc1097bff731738f4
194 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 239585f5e61f0c09ce7106bdc1097bff731738f4
137
195
138 Pushing more changesets to the server
196 Pushing more changesets to the server
139 -------------------------------------
197 -------------------------------------
140
198
141 $ echo d > d
199 $ echo d > d
142 $ hg ci -Aqm "added d"
200 $ hg ci -Aqm "added d"
143 $ echo e > e
201 $ echo e > e
144 $ hg ci -Aqm "added e"
202 $ hg ci -Aqm "added e"
145
203
146 XXX: we should have pushed only the parts which are not in bundlestore
204 XXX: we should have pushed only the parts which are not in bundlestore
147 $ hg push
205 $ hg push
148 pushing to $TESTTMP/repo
206 pushing to $TESTTMP/repo
207 IMPORTANT: if you use this extension, please contact
208 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
209 unused and barring learning of users of this functionality, we drop this
210 extension in Mercurial 6.6.
149 searching for changes
211 searching for changes
150 storing changesets on the bundlestore
212 storing changesets on the bundlestore
213 IMPORTANT: if you use this extension, please contact
214 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
215 unused and barring learning of users of this functionality, we drop this
216 extension in Mercurial 6.6.
151 pushing 4 commits:
217 pushing 4 commits:
152 eaba929e866c added b
218 eaba929e866c added b
153 bf8a6e3011b3 added c
219 bf8a6e3011b3 added c
154 1bb96358eda2 added d
220 1bb96358eda2 added d
155 b4e4bce66051 added e
221 b4e4bce66051 added e
156
222
157 Sneak peek into the bundlestore at the server
223 Sneak peek into the bundlestore at the server
158 $ scratchnodes
224 $ scratchnodes
159 1bb96358eda285b536c6d1c66846a7cdb2336cea 98fbae0016662521b0007da1b7bc349cd3caacd1
225 1bb96358eda285b536c6d1c66846a7cdb2336cea 98fbae0016662521b0007da1b7bc349cd3caacd1
160 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
226 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
161 b4e4bce660512ad3e71189e14588a70ac8e31fef 98fbae0016662521b0007da1b7bc349cd3caacd1
227 b4e4bce660512ad3e71189e14588a70ac8e31fef 98fbae0016662521b0007da1b7bc349cd3caacd1
162 bf8a6e3011b345146bbbedbcb1ebd4837571492a 98fbae0016662521b0007da1b7bc349cd3caacd1
228 bf8a6e3011b345146bbbedbcb1ebd4837571492a 98fbae0016662521b0007da1b7bc349cd3caacd1
163 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 98fbae0016662521b0007da1b7bc349cd3caacd1
229 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 98fbae0016662521b0007da1b7bc349cd3caacd1
164
230
165 Checking if `hg pull` pulls something or `hg incoming` shows something
231 Checking if `hg pull` pulls something or `hg incoming` shows something
166 -----------------------------------------------------------------------
232 -----------------------------------------------------------------------
167
233
168 $ hg incoming
234 $ hg incoming
235 IMPORTANT: if you use this extension, please contact
236 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
237 unused and barring learning of users of this functionality, we drop this
238 extension in Mercurial 6.6.
169 comparing with $TESTTMP/repo
239 comparing with $TESTTMP/repo
170 searching for changes
240 searching for changes
171 no changes found
241 no changes found
172 [1]
242 [1]
173
243
174 $ hg pull
244 $ hg pull
175 pulling from $TESTTMP/repo
245 pulling from $TESTTMP/repo
246 IMPORTANT: if you use this extension, please contact
247 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
248 unused and barring learning of users of this functionality, we drop this
249 extension in Mercurial 6.6.
176 searching for changes
250 searching for changes
177 no changes found
251 no changes found
178
252
179 Pulling from second client which is a localpeer to test `hg pull -r <rev>`
253 Pulling from second client which is a localpeer to test `hg pull -r <rev>`
180 --------------------------------------------------------------------------
254 --------------------------------------------------------------------------
181
255
182 Pulling the revision which is applied
256 Pulling the revision which is applied
183
257
184 $ cd ../client2
258 $ cd ../client2
185 $ hg pull -r 6cb0989601f1
259 $ hg pull -r 6cb0989601f1
186 pulling from $TESTTMP/repo
260 pulling from $TESTTMP/repo
261 IMPORTANT: if you use this extension, please contact
262 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
263 unused and barring learning of users of this functionality, we drop this
264 extension in Mercurial 6.6.
187 searching for changes
265 searching for changes
188 adding changesets
266 adding changesets
189 adding manifests
267 adding manifests
190 adding file changes
268 adding file changes
191 added 1 changesets with 1 changes to 1 files
269 added 1 changesets with 1 changes to 1 files
192 new changesets 6cb0989601f1
270 new changesets 6cb0989601f1
193 (run 'hg update' to get a working copy)
271 (run 'hg update' to get a working copy)
194 $ hg glog
272 $ hg glog
195 o 1:6cb0989601f1 added a
273 o 1:6cb0989601f1 added a
196 | public
274 | public
197 @ 0:67145f466344 initialcommit
275 @ 0:67145f466344 initialcommit
198 public
276 public
199
277
200 Pulling the revision which is in bundlestore
278 Pulling the revision which is in bundlestore
201 XXX: we should support pulling revisions from a local peers bundlestore without
279 XXX: we should support pulling revisions from a local peers bundlestore without
202 client side wrapping
280 client side wrapping
203
281
204 $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef
282 $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef
205 pulling from $TESTTMP/repo
283 pulling from $TESTTMP/repo
284 IMPORTANT: if you use this extension, please contact
285 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
286 unused and barring learning of users of this functionality, we drop this
287 extension in Mercurial 6.6.
206 abort: unknown revision 'b4e4bce660512ad3e71189e14588a70ac8e31fef'
288 abort: unknown revision 'b4e4bce660512ad3e71189e14588a70ac8e31fef'
207 [10]
289 [10]
208 $ hg glog
290 $ hg glog
209 o 1:6cb0989601f1 added a
291 o 1:6cb0989601f1 added a
210 | public
292 | public
211 @ 0:67145f466344 initialcommit
293 @ 0:67145f466344 initialcommit
212 public
294 public
213
295
214 $ cd ../client
296 $ cd ../client
215
297
216 Pulling from third client which is not a localpeer
298 Pulling from third client which is not a localpeer
217 ---------------------------------------------------
299 ---------------------------------------------------
218
300
219 Pulling the revision which is applied
301 Pulling the revision which is applied
220
302
221 $ cd ../client3
303 $ cd ../client3
222 $ hg pull -r 6cb0989601f1
304 $ hg pull -r 6cb0989601f1
223 pulling from ssh://user@dummy/repo
305 pulling from ssh://user@dummy/repo
306 remote: IMPORTANT: if you use this extension, please contact
307 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
308 remote: unused and barring learning of users of this functionality, we drop this
309 remote: extension in Mercurial 6.6.
224 searching for changes
310 searching for changes
225 adding changesets
311 adding changesets
226 adding manifests
312 adding manifests
227 adding file changes
313 adding file changes
228 added 1 changesets with 1 changes to 1 files
314 added 1 changesets with 1 changes to 1 files
229 new changesets 6cb0989601f1
315 new changesets 6cb0989601f1
230 (run 'hg update' to get a working copy)
316 (run 'hg update' to get a working copy)
231 $ hg glog
317 $ hg glog
232 o 1:6cb0989601f1 added a
318 o 1:6cb0989601f1 added a
233 | public
319 | public
234 @ 0:67145f466344 initialcommit
320 @ 0:67145f466344 initialcommit
235 public
321 public
236
322
237 Pulling the revision which is in bundlestore
323 Pulling the revision which is in bundlestore
238
324
239 Trying to specify short hash
325 Trying to specify short hash
240 XXX: we should support this
326 XXX: we should support this
241 $ hg pull -r b4e4bce660512
327 $ hg pull -r b4e4bce660512
242 pulling from ssh://user@dummy/repo
328 pulling from ssh://user@dummy/repo
329 remote: IMPORTANT: if you use this extension, please contact
330 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
331 remote: unused and barring learning of users of this functionality, we drop this
332 remote: extension in Mercurial 6.6.
243 abort: unknown revision 'b4e4bce660512'
333 abort: unknown revision 'b4e4bce660512'
244 [255]
334 [255]
245
335
246 XXX: we should show better message when the pull is happening from bundlestore
336 XXX: we should show better message when the pull is happening from bundlestore
247 $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef
337 $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef
248 pulling from ssh://user@dummy/repo
338 pulling from ssh://user@dummy/repo
339 remote: IMPORTANT: if you use this extension, please contact
340 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
341 remote: unused and barring learning of users of this functionality, we drop this
342 remote: extension in Mercurial 6.6.
249 searching for changes
343 searching for changes
344 remote: IMPORTANT: if you use this extension, please contact
345 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
346 remote: unused and barring learning of users of this functionality, we drop this
347 remote: extension in Mercurial 6.6.
250 adding changesets
348 adding changesets
251 adding manifests
349 adding manifests
252 adding file changes
350 adding file changes
253 added 4 changesets with 4 changes to 4 files
351 added 4 changesets with 4 changes to 4 files
254 new changesets eaba929e866c:b4e4bce66051
352 new changesets eaba929e866c:b4e4bce66051
255 (run 'hg update' to get a working copy)
353 (run 'hg update' to get a working copy)
256 $ hg glog
354 $ hg glog
257 o 5:b4e4bce66051 added e
355 o 5:b4e4bce66051 added e
258 | public
356 | public
259 o 4:1bb96358eda2 added d
357 o 4:1bb96358eda2 added d
260 | public
358 | public
261 o 3:bf8a6e3011b3 added c
359 o 3:bf8a6e3011b3 added c
262 | public
360 | public
263 o 2:eaba929e866c added b
361 o 2:eaba929e866c added b
264 | public
362 | public
265 o 1:6cb0989601f1 added a
363 o 1:6cb0989601f1 added a
266 | public
364 | public
267 @ 0:67145f466344 initialcommit
365 @ 0:67145f466344 initialcommit
268 public
366 public
269
367
270 $ cd ../client
368 $ cd ../client
271
369
272 Checking storage of phase information with the bundle on bundlestore
370 Checking storage of phase information with the bundle on bundlestore
273 ---------------------------------------------------------------------
371 ---------------------------------------------------------------------
274
372
275 creating a draft commit
373 creating a draft commit
276 $ cat >> $HGRCPATH <<EOF
374 $ cat >> $HGRCPATH <<EOF
277 > [phases]
375 > [phases]
278 > publish = False
376 > publish = False
279 > EOF
377 > EOF
280 $ echo f > f
378 $ echo f > f
281 $ hg ci -Aqm "added f"
379 $ hg ci -Aqm "added f"
282 $ hg glog -r '.^::'
380 $ hg glog -r '.^::'
283 @ 6:9b42578d4447 added f
381 @ 6:9b42578d4447 added f
284 | draft
382 | draft
285 o 5:b4e4bce66051 added e
383 o 5:b4e4bce66051 added e
286 | public
384 | public
287 ~
385 ~
288
386
289 $ hg push
387 $ hg push
290 pushing to $TESTTMP/repo
388 pushing to $TESTTMP/repo
389 IMPORTANT: if you use this extension, please contact
390 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
391 unused and barring learning of users of this functionality, we drop this
392 extension in Mercurial 6.6.
291 searching for changes
393 searching for changes
292 storing changesets on the bundlestore
394 storing changesets on the bundlestore
395 IMPORTANT: if you use this extension, please contact
396 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
397 unused and barring learning of users of this functionality, we drop this
398 extension in Mercurial 6.6.
293 pushing 5 commits:
399 pushing 5 commits:
294 eaba929e866c added b
400 eaba929e866c added b
295 bf8a6e3011b3 added c
401 bf8a6e3011b3 added c
296 1bb96358eda2 added d
402 1bb96358eda2 added d
297 b4e4bce66051 added e
403 b4e4bce66051 added e
298 9b42578d4447 added f
404 9b42578d4447 added f
299
405
300 XXX: the phase of 9b42578d4447 should not be changed here
406 XXX: the phase of 9b42578d4447 should not be changed here
301 $ hg glog -r .
407 $ hg glog -r .
302 @ 6:9b42578d4447 added f
408 @ 6:9b42578d4447 added f
303 | public
409 | public
304 ~
410 ~
305
411
306 applying the bundle on the server to check preservation of phase-information
412 applying the bundle on the server to check preservation of phase-information
307
413
308 $ cd ../repo
414 $ cd ../repo
309 $ scratchnodes
415 $ scratchnodes
310 1bb96358eda285b536c6d1c66846a7cdb2336cea 280a46a259a268f0e740c81c5a7751bdbfaec85f
416 1bb96358eda285b536c6d1c66846a7cdb2336cea 280a46a259a268f0e740c81c5a7751bdbfaec85f
311 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
417 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
312 9b42578d44473575994109161430d65dd147d16d 280a46a259a268f0e740c81c5a7751bdbfaec85f
418 9b42578d44473575994109161430d65dd147d16d 280a46a259a268f0e740c81c5a7751bdbfaec85f
313 b4e4bce660512ad3e71189e14588a70ac8e31fef 280a46a259a268f0e740c81c5a7751bdbfaec85f
419 b4e4bce660512ad3e71189e14588a70ac8e31fef 280a46a259a268f0e740c81c5a7751bdbfaec85f
314 bf8a6e3011b345146bbbedbcb1ebd4837571492a 280a46a259a268f0e740c81c5a7751bdbfaec85f
420 bf8a6e3011b345146bbbedbcb1ebd4837571492a 280a46a259a268f0e740c81c5a7751bdbfaec85f
315 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 280a46a259a268f0e740c81c5a7751bdbfaec85f
421 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 280a46a259a268f0e740c81c5a7751bdbfaec85f
316
422
317 $ hg unbundle .hg/scratchbranches/filebundlestore/28/0a/280a46a259a268f0e740c81c5a7751bdbfaec85f
423 $ hg unbundle .hg/scratchbranches/filebundlestore/28/0a/280a46a259a268f0e740c81c5a7751bdbfaec85f
424 IMPORTANT: if you use this extension, please contact
425 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
426 unused and barring learning of users of this functionality, we drop this
427 extension in Mercurial 6.6.
318 adding changesets
428 adding changesets
319 adding manifests
429 adding manifests
320 adding file changes
430 adding file changes
321 added 5 changesets with 5 changes to 5 files
431 added 5 changesets with 5 changes to 5 files
322 new changesets eaba929e866c:9b42578d4447 (1 drafts)
432 new changesets eaba929e866c:9b42578d4447 (1 drafts)
323 (run 'hg update' to get a working copy)
433 (run 'hg update' to get a working copy)
324
434
325 $ hg glog
435 $ hg glog
436 IMPORTANT: if you use this extension, please contact
437 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
438 unused and barring learning of users of this functionality, we drop this
439 extension in Mercurial 6.6.
326 o 6:9b42578d4447 added f
440 o 6:9b42578d4447 added f
327 | draft
441 | draft
328 o 5:b4e4bce66051 added e
442 o 5:b4e4bce66051 added e
329 | public
443 | public
330 o 4:1bb96358eda2 added d
444 o 4:1bb96358eda2 added d
331 | public
445 | public
332 o 3:bf8a6e3011b3 added c
446 o 3:bf8a6e3011b3 added c
333 | public
447 | public
334 o 2:eaba929e866c added b
448 o 2:eaba929e866c added b
335 | public
449 | public
336 o 1:6cb0989601f1 added a
450 o 1:6cb0989601f1 added a
337 | public
451 | public
338 @ 0:67145f466344 initialcommit
452 @ 0:67145f466344 initialcommit
339 public
453 public
340
454
341 Checking storage of obsmarkers in the bundlestore
455 Checking storage of obsmarkers in the bundlestore
342 --------------------------------------------------
456 --------------------------------------------------
343
457
344 enabling obsmarkers and rebase extension
458 enabling obsmarkers and rebase extension
345
459
346 $ cat >> $HGRCPATH << EOF
460 $ cat >> $HGRCPATH << EOF
347 > [experimental]
461 > [experimental]
348 > evolution = all
462 > evolution = all
349 > [extensions]
463 > [extensions]
350 > rebase =
464 > rebase =
351 > EOF
465 > EOF
352
466
353 $ cd ../client
467 $ cd ../client
354
468
355 $ hg phase -r . --draft --force
469 $ hg phase -r . --draft --force
356 $ hg rebase -r 6 -d 3
470 $ hg rebase -r 6 -d 3
357 rebasing 6:9b42578d4447 tip "added f"
471 rebasing 6:9b42578d4447 tip "added f"
358
472
359 $ hg glog
473 $ hg glog
360 @ 7:99949238d9ac added f
474 @ 7:99949238d9ac added f
361 | draft
475 | draft
362 | o 5:b4e4bce66051 added e
476 | o 5:b4e4bce66051 added e
363 | | public
477 | | public
364 | o 4:1bb96358eda2 added d
478 | o 4:1bb96358eda2 added d
365 |/ public
479 |/ public
366 o 3:bf8a6e3011b3 added c
480 o 3:bf8a6e3011b3 added c
367 | public
481 | public
368 o 2:eaba929e866c added b
482 o 2:eaba929e866c added b
369 | public
483 | public
370 o 1:6cb0989601f1 added a
484 o 1:6cb0989601f1 added a
371 | public
485 | public
372 o 0:67145f466344 initialcommit
486 o 0:67145f466344 initialcommit
373 public
487 public
374
488
375 $ hg push -f
489 $ hg push -f
376 pushing to $TESTTMP/repo
490 pushing to $TESTTMP/repo
491 IMPORTANT: if you use this extension, please contact
492 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
493 unused and barring learning of users of this functionality, we drop this
494 extension in Mercurial 6.6.
377 searching for changes
495 searching for changes
378 storing changesets on the bundlestore
496 storing changesets on the bundlestore
497 IMPORTANT: if you use this extension, please contact
498 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
499 unused and barring learning of users of this functionality, we drop this
500 extension in Mercurial 6.6.
379 pushing 1 commit:
501 pushing 1 commit:
380 99949238d9ac added f
502 99949238d9ac added f
381
503
382 XXX: the phase should not have changed here
504 XXX: the phase should not have changed here
383 $ hg glog -r .
505 $ hg glog -r .
384 @ 7:99949238d9ac added f
506 @ 7:99949238d9ac added f
385 | public
507 | public
386 ~
508 ~
387
509
388 Unbundling on server to see obsmarkers being applied
510 Unbundling on server to see obsmarkers being applied
389
511
390 $ cd ../repo
512 $ cd ../repo
391
513
392 $ scratchnodes
514 $ scratchnodes
393 1bb96358eda285b536c6d1c66846a7cdb2336cea 280a46a259a268f0e740c81c5a7751bdbfaec85f
515 1bb96358eda285b536c6d1c66846a7cdb2336cea 280a46a259a268f0e740c81c5a7751bdbfaec85f
394 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
516 6cb0989601f1fb5805238edfb16f3606713d9a0b 3b414252ff8acab801318445d88ff48faf4a28c3
395 99949238d9ac7f2424a33a46dface6f866afd059 090a24fe63f31d3b4bee714447f835c8c362ff57
517 99949238d9ac7f2424a33a46dface6f866afd059 090a24fe63f31d3b4bee714447f835c8c362ff57
396 9b42578d44473575994109161430d65dd147d16d 280a46a259a268f0e740c81c5a7751bdbfaec85f
518 9b42578d44473575994109161430d65dd147d16d 280a46a259a268f0e740c81c5a7751bdbfaec85f
397 b4e4bce660512ad3e71189e14588a70ac8e31fef 280a46a259a268f0e740c81c5a7751bdbfaec85f
519 b4e4bce660512ad3e71189e14588a70ac8e31fef 280a46a259a268f0e740c81c5a7751bdbfaec85f
398 bf8a6e3011b345146bbbedbcb1ebd4837571492a 280a46a259a268f0e740c81c5a7751bdbfaec85f
520 bf8a6e3011b345146bbbedbcb1ebd4837571492a 280a46a259a268f0e740c81c5a7751bdbfaec85f
399 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 280a46a259a268f0e740c81c5a7751bdbfaec85f
521 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 280a46a259a268f0e740c81c5a7751bdbfaec85f
400
522
401 $ hg glog
523 $ hg glog
524 IMPORTANT: if you use this extension, please contact
525 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
526 unused and barring learning of users of this functionality, we drop this
527 extension in Mercurial 6.6.
528 IMPORTANT: if you use this extension, please contact (chg !)
529 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be (chg !)
530 unused and barring learning of users of this functionality, we drop this (chg !)
531 extension in Mercurial 6.6. (chg !)
402 o 6:9b42578d4447 added f
532 o 6:9b42578d4447 added f
403 | draft
533 | draft
404 o 5:b4e4bce66051 added e
534 o 5:b4e4bce66051 added e
405 | public
535 | public
406 o 4:1bb96358eda2 added d
536 o 4:1bb96358eda2 added d
407 | public
537 | public
408 o 3:bf8a6e3011b3 added c
538 o 3:bf8a6e3011b3 added c
409 | public
539 | public
410 o 2:eaba929e866c added b
540 o 2:eaba929e866c added b
411 | public
541 | public
412 o 1:6cb0989601f1 added a
542 o 1:6cb0989601f1 added a
413 | public
543 | public
414 @ 0:67145f466344 initialcommit
544 @ 0:67145f466344 initialcommit
415 public
545 public
416
546
417 $ hg unbundle .hg/scratchbranches/filebundlestore/09/0a/090a24fe63f31d3b4bee714447f835c8c362ff57
547 $ hg unbundle .hg/scratchbranches/filebundlestore/09/0a/090a24fe63f31d3b4bee714447f835c8c362ff57
548 IMPORTANT: if you use this extension, please contact
549 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
550 unused and barring learning of users of this functionality, we drop this
551 extension in Mercurial 6.6.
418 adding changesets
552 adding changesets
419 adding manifests
553 adding manifests
420 adding file changes
554 adding file changes
421 added 1 changesets with 0 changes to 1 files (+1 heads)
555 added 1 changesets with 0 changes to 1 files (+1 heads)
422 1 new obsolescence markers
556 1 new obsolescence markers
423 obsoleted 1 changesets
557 obsoleted 1 changesets
424 new changesets 99949238d9ac (1 drafts)
558 new changesets 99949238d9ac (1 drafts)
425 (run 'hg heads' to see heads, 'hg merge' to merge)
559 (run 'hg heads' to see heads, 'hg merge' to merge)
426
560
427 $ hg glog
561 $ hg glog
562 IMPORTANT: if you use this extension, please contact
563 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
564 unused and barring learning of users of this functionality, we drop this
565 extension in Mercurial 6.6.
428 o 7:99949238d9ac added f
566 o 7:99949238d9ac added f
429 | draft
567 | draft
430 | o 5:b4e4bce66051 added e
568 | o 5:b4e4bce66051 added e
431 | | public
569 | | public
432 | o 4:1bb96358eda2 added d
570 | o 4:1bb96358eda2 added d
433 |/ public
571 |/ public
434 o 3:bf8a6e3011b3 added c
572 o 3:bf8a6e3011b3 added c
435 | public
573 | public
436 o 2:eaba929e866c added b
574 o 2:eaba929e866c added b
437 | public
575 | public
438 o 1:6cb0989601f1 added a
576 o 1:6cb0989601f1 added a
439 | public
577 | public
440 @ 0:67145f466344 initialcommit
578 @ 0:67145f466344 initialcommit
441 public
579 public
@@ -1,172 +1,472 b''
1 #require no-reposimplestore no-chg
1 #require no-reposimplestore no-chg
2
2
3 XXX-CHG this test hangs if `hg` is really `chg`. This was hidden by the use of
3 XXX-CHG this test hangs if `hg` is really `chg`. This was hidden by the use of
4 `alias hg=chg` by run-tests.py. With such alias removed, this test is revealed
4 `alias hg=chg` by run-tests.py. With such alias removed, this test is revealed
5 buggy. This need to be resolved sooner than later.
5 buggy. This need to be resolved sooner than later.
6
6
7
7
8 Testing infinipush extension and the confi options provided by it
8 Testing infinipush extension and the confi options provided by it
9
9
10 Setup
10 Setup
11
11
12 $ . "$TESTDIR/library-infinitepush.sh"
12 $ . "$TESTDIR/library-infinitepush.sh"
13 $ cp $HGRCPATH $TESTTMP/defaulthgrc
13 $ cp $HGRCPATH $TESTTMP/defaulthgrc
14 $ setupcommon
14 $ setupcommon
15 $ hg init repo
15 $ hg init repo
16 IMPORTANT: if you use this extension, please contact
17 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
18 unused and barring learning of users of this functionality, we drop this
19 extension in Mercurial 6.6.
16 $ cd repo
20 $ cd repo
17 $ setupserver
21 $ setupserver
18 $ echo initialcommit > initialcommit
22 $ echo initialcommit > initialcommit
19 $ hg ci -Aqm "initialcommit"
23 $ hg ci -Aqm "initialcommit"
24 IMPORTANT: if you use this extension, please contact
25 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
26 unused and barring learning of users of this functionality, we drop this
27 extension in Mercurial 6.6.
20 $ hg phase --public .
28 $ hg phase --public .
29 IMPORTANT: if you use this extension, please contact
30 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
31 unused and barring learning of users of this functionality, we drop this
32 extension in Mercurial 6.6.
21
33
22 $ cd ..
34 $ cd ..
23 $ hg clone ssh://user@dummy/repo client -q
35 $ hg clone ssh://user@dummy/repo client -q
36 remote: IMPORTANT: if you use this extension, please contact
37 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
38 remote: unused and barring learning of users of this functionality, we drop this
39 remote: extension in Mercurial 6.6.
40 IMPORTANT: if you use this extension, please contact
41 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
42 unused and barring learning of users of this functionality, we drop this
43 extension in Mercurial 6.6.
44 IMPORTANT: if you use this extension, please contact
45 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
46 unused and barring learning of users of this functionality, we drop this
47 extension in Mercurial 6.6.
24
48
25 Create two heads. Push first head alone, then two heads together. Make sure that
49 Create two heads. Push first head alone, then two heads together. Make sure that
26 multihead push works.
50 multihead push works.
27 $ cd client
51 $ cd client
28 $ echo multihead1 > multihead1
52 $ echo multihead1 > multihead1
29 $ hg add multihead1
53 $ hg add multihead1
54 IMPORTANT: if you use this extension, please contact
55 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
56 unused and barring learning of users of this functionality, we drop this
57 extension in Mercurial 6.6.
30 $ hg ci -m "multihead1"
58 $ hg ci -m "multihead1"
59 IMPORTANT: if you use this extension, please contact
60 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
61 unused and barring learning of users of this functionality, we drop this
62 extension in Mercurial 6.6.
31 $ hg up null
63 $ hg up null
64 IMPORTANT: if you use this extension, please contact
65 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
66 unused and barring learning of users of this functionality, we drop this
67 extension in Mercurial 6.6.
32 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
68 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
33 $ echo multihead2 > multihead2
69 $ echo multihead2 > multihead2
34 $ hg ci -Am "multihead2"
70 $ hg ci -Am "multihead2"
71 IMPORTANT: if you use this extension, please contact
72 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
73 unused and barring learning of users of this functionality, we drop this
74 extension in Mercurial 6.6.
35 adding multihead2
75 adding multihead2
36 created new head
76 created new head
37 $ hg push -r . --bundle-store
77 $ hg push -r . --bundle-store
78 IMPORTANT: if you use this extension, please contact
79 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
80 unused and barring learning of users of this functionality, we drop this
81 extension in Mercurial 6.6.
38 pushing to ssh://user@dummy/repo
82 pushing to ssh://user@dummy/repo
83 remote: IMPORTANT: if you use this extension, please contact
84 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
85 remote: unused and barring learning of users of this functionality, we drop this
86 remote: extension in Mercurial 6.6.
87 IMPORTANT: if you use this extension, please contact
88 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
89 unused and barring learning of users of this functionality, we drop this
90 extension in Mercurial 6.6.
39 searching for changes
91 searching for changes
92 remote: IMPORTANT: if you use this extension, please contact
93 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
94 remote: unused and barring learning of users of this functionality, we drop this
95 remote: extension in Mercurial 6.6.
40 remote: pushing 1 commit:
96 remote: pushing 1 commit:
41 remote: ee4802bf6864 multihead2
97 remote: ee4802bf6864 multihead2
42 $ hg push -r '1:2' --bundle-store
98 $ hg push -r '1:2' --bundle-store
99 IMPORTANT: if you use this extension, please contact
100 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
101 unused and barring learning of users of this functionality, we drop this
102 extension in Mercurial 6.6.
43 pushing to ssh://user@dummy/repo
103 pushing to ssh://user@dummy/repo
104 remote: IMPORTANT: if you use this extension, please contact
105 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
106 remote: unused and barring learning of users of this functionality, we drop this
107 remote: extension in Mercurial 6.6.
108 IMPORTANT: if you use this extension, please contact
109 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
110 unused and barring learning of users of this functionality, we drop this
111 extension in Mercurial 6.6.
44 searching for changes
112 searching for changes
113 remote: IMPORTANT: if you use this extension, please contact
114 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
115 remote: unused and barring learning of users of this functionality, we drop this
116 remote: extension in Mercurial 6.6.
45 remote: pushing 2 commits:
117 remote: pushing 2 commits:
46 remote: bc22f9a30a82 multihead1
118 remote: bc22f9a30a82 multihead1
47 remote: ee4802bf6864 multihead2
119 remote: ee4802bf6864 multihead2
48 $ scratchnodes
120 $ scratchnodes
49 bc22f9a30a821118244deacbd732e394ed0b686c de1b7d132ba98f0172cd974e3e69dfa80faa335c
121 bc22f9a30a821118244deacbd732e394ed0b686c de1b7d132ba98f0172cd974e3e69dfa80faa335c
50 ee4802bf6864326a6b3dcfff5a03abc2a0a69b8f de1b7d132ba98f0172cd974e3e69dfa80faa335c
122 ee4802bf6864326a6b3dcfff5a03abc2a0a69b8f de1b7d132ba98f0172cd974e3e69dfa80faa335c
51
123
52 Create two new scratch bookmarks
124 Create two new scratch bookmarks
53 $ hg up 0
125 $ hg up 0
126 IMPORTANT: if you use this extension, please contact
127 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
128 unused and barring learning of users of this functionality, we drop this
129 extension in Mercurial 6.6.
54 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
130 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
55 $ echo scratchfirstpart > scratchfirstpart
131 $ echo scratchfirstpart > scratchfirstpart
56 $ hg ci -Am "scratchfirstpart"
132 $ hg ci -Am "scratchfirstpart"
133 IMPORTANT: if you use this extension, please contact
134 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
135 unused and barring learning of users of this functionality, we drop this
136 extension in Mercurial 6.6.
57 adding scratchfirstpart
137 adding scratchfirstpart
58 created new head
138 created new head
59 $ hg push -r . -B scratch/firstpart
139 $ hg push -r . -B scratch/firstpart
140 IMPORTANT: if you use this extension, please contact
141 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
142 unused and barring learning of users of this functionality, we drop this
143 extension in Mercurial 6.6.
60 pushing to ssh://user@dummy/repo
144 pushing to ssh://user@dummy/repo
145 remote: IMPORTANT: if you use this extension, please contact
146 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
147 remote: unused and barring learning of users of this functionality, we drop this
148 remote: extension in Mercurial 6.6.
149 IMPORTANT: if you use this extension, please contact
150 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
151 unused and barring learning of users of this functionality, we drop this
152 extension in Mercurial 6.6.
61 searching for changes
153 searching for changes
154 remote: IMPORTANT: if you use this extension, please contact
155 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
156 remote: unused and barring learning of users of this functionality, we drop this
157 remote: extension in Mercurial 6.6.
62 remote: pushing 1 commit:
158 remote: pushing 1 commit:
63 remote: 176993b87e39 scratchfirstpart
159 remote: 176993b87e39 scratchfirstpart
64 $ hg up 0
160 $ hg up 0
161 IMPORTANT: if you use this extension, please contact
162 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
163 unused and barring learning of users of this functionality, we drop this
164 extension in Mercurial 6.6.
65 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
165 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
66 $ echo scratchsecondpart > scratchsecondpart
166 $ echo scratchsecondpart > scratchsecondpart
67 $ hg ci -Am "scratchsecondpart"
167 $ hg ci -Am "scratchsecondpart"
168 IMPORTANT: if you use this extension, please contact
169 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
170 unused and barring learning of users of this functionality, we drop this
171 extension in Mercurial 6.6.
68 adding scratchsecondpart
172 adding scratchsecondpart
69 created new head
173 created new head
70 $ hg push -r . -B scratch/secondpart
174 $ hg push -r . -B scratch/secondpart
175 IMPORTANT: if you use this extension, please contact
176 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
177 unused and barring learning of users of this functionality, we drop this
178 extension in Mercurial 6.6.
71 pushing to ssh://user@dummy/repo
179 pushing to ssh://user@dummy/repo
180 remote: IMPORTANT: if you use this extension, please contact
181 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
182 remote: unused and barring learning of users of this functionality, we drop this
183 remote: extension in Mercurial 6.6.
184 IMPORTANT: if you use this extension, please contact
185 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
186 unused and barring learning of users of this functionality, we drop this
187 extension in Mercurial 6.6.
72 searching for changes
188 searching for changes
189 remote: IMPORTANT: if you use this extension, please contact
190 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
191 remote: unused and barring learning of users of this functionality, we drop this
192 remote: extension in Mercurial 6.6.
73 remote: pushing 1 commit:
193 remote: pushing 1 commit:
74 remote: 8db3891c220e scratchsecondpart
194 remote: 8db3891c220e scratchsecondpart
75
195
76 Pull two bookmarks from the second client
196 Pull two bookmarks from the second client
77 $ cd ..
197 $ cd ..
78 $ hg clone ssh://user@dummy/repo client2 -q
198 $ hg clone ssh://user@dummy/repo client2 -q
199 remote: IMPORTANT: if you use this extension, please contact
200 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
201 remote: unused and barring learning of users of this functionality, we drop this
202 remote: extension in Mercurial 6.6.
203 IMPORTANT: if you use this extension, please contact
204 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
205 unused and barring learning of users of this functionality, we drop this
206 extension in Mercurial 6.6.
207 IMPORTANT: if you use this extension, please contact
208 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
209 unused and barring learning of users of this functionality, we drop this
210 extension in Mercurial 6.6.
79 $ cd client2
211 $ cd client2
80 $ hg pull -B scratch/firstpart -B scratch/secondpart
212 $ hg pull -B scratch/firstpart -B scratch/secondpart
213 IMPORTANT: if you use this extension, please contact
214 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
215 unused and barring learning of users of this functionality, we drop this
216 extension in Mercurial 6.6.
217 remote: IMPORTANT: if you use this extension, please contact
218 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
219 remote: unused and barring learning of users of this functionality, we drop this
220 remote: extension in Mercurial 6.6.
221 IMPORTANT: if you use this extension, please contact
222 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
223 unused and barring learning of users of this functionality, we drop this
224 extension in Mercurial 6.6.
81 pulling from ssh://user@dummy/repo
225 pulling from ssh://user@dummy/repo
226 remote: IMPORTANT: if you use this extension, please contact
227 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
228 remote: unused and barring learning of users of this functionality, we drop this
229 remote: extension in Mercurial 6.6.
230 IMPORTANT: if you use this extension, please contact
231 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
232 unused and barring learning of users of this functionality, we drop this
233 extension in Mercurial 6.6.
82 searching for changes
234 searching for changes
235 remote: IMPORTANT: if you use this extension, please contact
236 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
237 remote: unused and barring learning of users of this functionality, we drop this
238 remote: extension in Mercurial 6.6.
239 remote: IMPORTANT: if you use this extension, please contact
240 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
241 remote: unused and barring learning of users of this functionality, we drop this
242 remote: extension in Mercurial 6.6.
83 adding changesets
243 adding changesets
84 adding manifests
244 adding manifests
85 adding file changes
245 adding file changes
86 adding changesets
246 adding changesets
87 adding manifests
247 adding manifests
88 adding file changes
248 adding file changes
89 added 2 changesets with 2 changes to 2 files (+1 heads)
249 added 2 changesets with 2 changes to 2 files (+1 heads)
90 new changesets * (glob)
250 new changesets * (glob)
91 (run 'hg heads' to see heads, 'hg merge' to merge)
251 (run 'hg heads' to see heads, 'hg merge' to merge)
92 $ hg log -r scratch/secondpart -T '{node}'
252 $ hg log -r scratch/secondpart -T '{node}'
253 IMPORTANT: if you use this extension, please contact
254 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
255 unused and barring learning of users of this functionality, we drop this
256 extension in Mercurial 6.6.
93 8db3891c220e216f6da214e8254bd4371f55efca (no-eol)
257 8db3891c220e216f6da214e8254bd4371f55efca (no-eol)
94 $ hg log -r scratch/firstpart -T '{node}'
258 $ hg log -r scratch/firstpart -T '{node}'
259 IMPORTANT: if you use this extension, please contact
260 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
261 unused and barring learning of users of this functionality, we drop this
262 extension in Mercurial 6.6.
95 176993b87e39bd88d66a2cccadabe33f0b346339 (no-eol)
263 176993b87e39bd88d66a2cccadabe33f0b346339 (no-eol)
96 Make two commits to the scratch branch
264 Make two commits to the scratch branch
97
265
98 $ echo testpullbycommithash1 > testpullbycommithash1
266 $ echo testpullbycommithash1 > testpullbycommithash1
99 $ hg ci -Am "testpullbycommithash1"
267 $ hg ci -Am "testpullbycommithash1"
268 IMPORTANT: if you use this extension, please contact
269 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
270 unused and barring learning of users of this functionality, we drop this
271 extension in Mercurial 6.6.
100 adding testpullbycommithash1
272 adding testpullbycommithash1
101 created new head
273 created new head
102 $ hg log -r '.' -T '{node}\n' > ../testpullbycommithash1
274 $ hg log -r '.' -T '{node}\n' > ../testpullbycommithash1
275 IMPORTANT: if you use this extension, please contact
276 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
277 unused and barring learning of users of this functionality, we drop this
278 extension in Mercurial 6.6.
103 $ echo testpullbycommithash2 > testpullbycommithash2
279 $ echo testpullbycommithash2 > testpullbycommithash2
104 $ hg ci -Aqm "testpullbycommithash2"
280 $ hg ci -Aqm "testpullbycommithash2"
281 IMPORTANT: if you use this extension, please contact
282 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
283 unused and barring learning of users of this functionality, we drop this
284 extension in Mercurial 6.6.
105 $ hg push -r . -B scratch/mybranch -q
285 $ hg push -r . -B scratch/mybranch -q
286 IMPORTANT: if you use this extension, please contact
287 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
288 unused and barring learning of users of this functionality, we drop this
289 extension in Mercurial 6.6.
290 remote: IMPORTANT: if you use this extension, please contact
291 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
292 remote: unused and barring learning of users of this functionality, we drop this
293 remote: extension in Mercurial 6.6.
294 IMPORTANT: if you use this extension, please contact
295 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
296 unused and barring learning of users of this functionality, we drop this
297 extension in Mercurial 6.6.
106
298
107 Create third client and pull by commit hash.
299 Create third client and pull by commit hash.
108 Make sure testpullbycommithash2 has not fetched
300 Make sure testpullbycommithash2 has not fetched
109 $ cd ..
301 $ cd ..
110 $ hg clone ssh://user@dummy/repo client3 -q
302 $ hg clone ssh://user@dummy/repo client3 -q
303 remote: IMPORTANT: if you use this extension, please contact
304 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
305 remote: unused and barring learning of users of this functionality, we drop this
306 remote: extension in Mercurial 6.6.
307 IMPORTANT: if you use this extension, please contact
308 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
309 unused and barring learning of users of this functionality, we drop this
310 extension in Mercurial 6.6.
311 IMPORTANT: if you use this extension, please contact
312 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
313 unused and barring learning of users of this functionality, we drop this
314 extension in Mercurial 6.6.
111 $ cd client3
315 $ cd client3
112 $ hg pull -r `cat ../testpullbycommithash1`
316 $ hg pull -r `cat ../testpullbycommithash1`
317 IMPORTANT: if you use this extension, please contact
318 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
319 unused and barring learning of users of this functionality, we drop this
320 extension in Mercurial 6.6.
113 pulling from ssh://user@dummy/repo
321 pulling from ssh://user@dummy/repo
322 remote: IMPORTANT: if you use this extension, please contact
323 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
324 remote: unused and barring learning of users of this functionality, we drop this
325 remote: extension in Mercurial 6.6.
326 IMPORTANT: if you use this extension, please contact
327 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
328 unused and barring learning of users of this functionality, we drop this
329 extension in Mercurial 6.6.
114 searching for changes
330 searching for changes
331 remote: IMPORTANT: if you use this extension, please contact
332 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
333 remote: unused and barring learning of users of this functionality, we drop this
334 remote: extension in Mercurial 6.6.
115 adding changesets
335 adding changesets
116 adding manifests
336 adding manifests
117 adding file changes
337 adding file changes
118 added 1 changesets with 1 changes to 1 files
338 added 1 changesets with 1 changes to 1 files
119 new changesets 33910bfe6ffe (1 drafts)
339 new changesets 33910bfe6ffe (1 drafts)
120 (run 'hg update' to get a working copy)
340 (run 'hg update' to get a working copy)
121 $ hg log -G -T '{desc} {phase} {bookmarks}'
341 $ hg log -G -T '{desc} {phase} {bookmarks}'
342 IMPORTANT: if you use this extension, please contact
343 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
344 unused and barring learning of users of this functionality, we drop this
345 extension in Mercurial 6.6.
122 o testpullbycommithash1 draft
346 o testpullbycommithash1 draft
123 |
347 |
124 @ initialcommit public
348 @ initialcommit public
125
349
126 Make public commit in the repo and pull it.
350 Make public commit in the repo and pull it.
127 Make sure phase on the client is public.
351 Make sure phase on the client is public.
128 $ cd ../repo
352 $ cd ../repo
129 $ echo publiccommit > publiccommit
353 $ echo publiccommit > publiccommit
130 $ hg ci -Aqm "publiccommit"
354 $ hg ci -Aqm "publiccommit"
355 IMPORTANT: if you use this extension, please contact
356 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
357 unused and barring learning of users of this functionality, we drop this
358 extension in Mercurial 6.6.
131 $ hg phase --public .
359 $ hg phase --public .
360 IMPORTANT: if you use this extension, please contact
361 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
362 unused and barring learning of users of this functionality, we drop this
363 extension in Mercurial 6.6.
132 $ cd ../client3
364 $ cd ../client3
133 $ hg pull
365 $ hg pull
366 IMPORTANT: if you use this extension, please contact
367 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
368 unused and barring learning of users of this functionality, we drop this
369 extension in Mercurial 6.6.
134 pulling from ssh://user@dummy/repo
370 pulling from ssh://user@dummy/repo
371 remote: IMPORTANT: if you use this extension, please contact
372 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
373 remote: unused and barring learning of users of this functionality, we drop this
374 remote: extension in Mercurial 6.6.
375 IMPORTANT: if you use this extension, please contact
376 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
377 unused and barring learning of users of this functionality, we drop this
378 extension in Mercurial 6.6.
135 searching for changes
379 searching for changes
136 adding changesets
380 adding changesets
137 adding manifests
381 adding manifests
138 adding file changes
382 adding file changes
139 added 1 changesets with 1 changes to 1 files (+1 heads)
383 added 1 changesets with 1 changes to 1 files (+1 heads)
140 new changesets a79b6597f322
384 new changesets a79b6597f322
141 (run 'hg heads' to see heads, 'hg merge' to merge)
385 (run 'hg heads' to see heads, 'hg merge' to merge)
142 $ hg log -G -T '{desc} {phase} {bookmarks} {node|short}'
386 $ hg log -G -T '{desc} {phase} {bookmarks} {node|short}'
387 IMPORTANT: if you use this extension, please contact
388 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
389 unused and barring learning of users of this functionality, we drop this
390 extension in Mercurial 6.6.
143 o publiccommit public a79b6597f322
391 o publiccommit public a79b6597f322
144 |
392 |
145 | o testpullbycommithash1 draft 33910bfe6ffe
393 | o testpullbycommithash1 draft 33910bfe6ffe
146 |/
394 |/
147 @ initialcommit public 67145f466344
395 @ initialcommit public 67145f466344
148
396
149 $ hg up a79b6597f322
397 $ hg up a79b6597f322
398 IMPORTANT: if you use this extension, please contact
399 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
400 unused and barring learning of users of this functionality, we drop this
401 extension in Mercurial 6.6.
150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
402 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 $ echo scratchontopofpublic > scratchontopofpublic
403 $ echo scratchontopofpublic > scratchontopofpublic
152 $ hg ci -Aqm "scratchontopofpublic"
404 $ hg ci -Aqm "scratchontopofpublic"
405 IMPORTANT: if you use this extension, please contact
406 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
407 unused and barring learning of users of this functionality, we drop this
408 extension in Mercurial 6.6.
153 $ hg push -r . -B scratch/scratchontopofpublic
409 $ hg push -r . -B scratch/scratchontopofpublic
410 IMPORTANT: if you use this extension, please contact
411 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
412 unused and barring learning of users of this functionality, we drop this
413 extension in Mercurial 6.6.
154 pushing to ssh://user@dummy/repo
414 pushing to ssh://user@dummy/repo
415 remote: IMPORTANT: if you use this extension, please contact
416 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
417 remote: unused and barring learning of users of this functionality, we drop this
418 remote: extension in Mercurial 6.6.
419 IMPORTANT: if you use this extension, please contact
420 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
421 unused and barring learning of users of this functionality, we drop this
422 extension in Mercurial 6.6.
155 searching for changes
423 searching for changes
424 remote: IMPORTANT: if you use this extension, please contact
425 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
426 remote: unused and barring learning of users of this functionality, we drop this
427 remote: extension in Mercurial 6.6.
156 remote: pushing 1 commit:
428 remote: pushing 1 commit:
157 remote: c70aee6da07d scratchontopofpublic
429 remote: c70aee6da07d scratchontopofpublic
158 $ cd ../client2
430 $ cd ../client2
159 $ hg pull -B scratch/scratchontopofpublic
431 $ hg pull -B scratch/scratchontopofpublic
432 IMPORTANT: if you use this extension, please contact
433 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
434 unused and barring learning of users of this functionality, we drop this
435 extension in Mercurial 6.6.
436 remote: IMPORTANT: if you use this extension, please contact
437 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
438 remote: unused and barring learning of users of this functionality, we drop this
439 remote: extension in Mercurial 6.6.
440 IMPORTANT: if you use this extension, please contact
441 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
442 unused and barring learning of users of this functionality, we drop this
443 extension in Mercurial 6.6.
160 pulling from ssh://user@dummy/repo
444 pulling from ssh://user@dummy/repo
445 remote: IMPORTANT: if you use this extension, please contact
446 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
447 remote: unused and barring learning of users of this functionality, we drop this
448 remote: extension in Mercurial 6.6.
449 IMPORTANT: if you use this extension, please contact
450 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
451 unused and barring learning of users of this functionality, we drop this
452 extension in Mercurial 6.6.
161 searching for changes
453 searching for changes
454 remote: IMPORTANT: if you use this extension, please contact
455 remote: mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
456 remote: unused and barring learning of users of this functionality, we drop this
457 remote: extension in Mercurial 6.6.
162 adding changesets
458 adding changesets
163 adding manifests
459 adding manifests
164 adding file changes
460 adding file changes
165 adding changesets
461 adding changesets
166 adding manifests
462 adding manifests
167 adding file changes
463 adding file changes
168 added 2 changesets with 2 changes to 2 files (+1 heads)
464 added 2 changesets with 2 changes to 2 files (+1 heads)
169 new changesets a79b6597f322:c70aee6da07d (1 drafts)
465 new changesets a79b6597f322:c70aee6da07d (1 drafts)
170 (run 'hg heads .' to see heads, 'hg merge' to merge)
466 (run 'hg heads .' to see heads, 'hg merge' to merge)
171 $ hg log -r scratch/scratchontopofpublic -T '{phase}'
467 $ hg log -r scratch/scratchontopofpublic -T '{phase}'
468 IMPORTANT: if you use this extension, please contact
469 mercurial-devel@mercurial-scm.org IMMEDIATELY. This extension is believed to be
470 unused and barring learning of users of this functionality, we drop this
471 extension in Mercurial 6.6.
172 draft (no-eol)
472 draft (no-eol)
General Comments 0
You need to be logged in to leave comments. Login now