Commit 8b2a37bd authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

evolve: update the capabilities and commands name for obshashrange

We makes is clear that these version are useful for earlier testing but they are
not ready for any kind of real usage yet.
parent c99e926d465a
......@@ -147,7 +147,8 @@ def buildpullobsmarkersboundaries(pullop, bundle2=True):
def _canobshashrange(local, remote):
return (local.ui.configbool('experimental', 'obshashrange', False)
and remote.capable('_evoext_obshashrange_1'))
and remote.capable('_donotusemeever_evoext_obshashrange_1'))
def _obshashrange_capabilities(orig, repo, proto):
"""wrapper to advertise new capability"""
......@@ -155,7 +156,7 @@ def _obshashrange_capabilities(orig, repo, proto):
enabled = repo.ui.configbool('experimental', 'obshashrange', False)
if obsolete.isenabled(repo, obsolete.exchangeopt) and enabled:
caps = caps.split()
caps.append('_evoext_obshashrange_1')
caps.append('_donotusemeever_evoext_obshashrange_1')
caps.sort()
caps = ' '.join(caps)
return caps
......@@ -324,7 +325,7 @@ def _queryrange(ui, repo, remote, allentries):
bundler = bundle2.bundle20(ui, bundle2.bundle2caps(remote))
capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo))
bundler.newpart('replycaps', data=capsblob)
bundler.newpart('_evoexp_obsrangehash_0', data=gen())
bundler.newpart('_donotusemeever_evoext_obshashrange_1', data=gen())
stream = util.chunkbuffer(bundler.getchunks())
try:
......@@ -341,11 +342,11 @@ def _queryrange(ui, repo, remote, allentries):
if exc.hint is not None:
ui.status(_('remote: %s\n') % ('(%s)' % exc.hint))
raise error.Abort(_('push failed on remote'))
for rep in op.records['_evoexp_obsrangehash_0']:
for rep in op.records['_donotusemeever_evoext_obshashrange_1']:
yield mapping[rep['key']], rep['value']
@bundle2.parthandler('_evoexp_obsrangehash_0', ())
@bundle2.parthandler('_donotusemeever_evoext_obshashrange_1', ())
def _processqueryrange(op, inpart):
assert op.reply is not None
replies = []
......@@ -357,16 +358,16 @@ def _processqueryrange(op, inpart):
rhash = _range(op.repo, r, index).obshash
replies.append(data + rhash)
data = inpart.read(24)
op.reply.newpart('reply:_evoexp_obsrangehash_0', data=iter(replies))
op.reply.newpart('reply:_donotusemeever_evoext_obshashrange_1', data=iter(replies))
@bundle2.parthandler('reply:_evoexp_obsrangehash_0', ())
@bundle2.parthandler('reply:_donotusemeever_evoext_obshashrange_1', ())
def _processqueryrangereply(op, inpart):
data = inpart.read(44)
while data:
key = data[:24]
rhash = data[24:]
op.records.add('_evoexp_obsrangehash_0', {'key': key, 'value': rhash})
op.records.add('_donotusemeever_evoext_obshashrange_1', {'key': key, 'value': rhash})
data = inpart.read(44)
##################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment