Mercurial > public > mercurial-scm > hg
comparison mercurial/wireprotov2server.py @ 40049:39074a35f7db
wireprotov2: always advertise raw repo requirements
I'm pretty sure my original thinking behind making it conditional
on stream clone support was that the behavior mirrored wire protocol
version 1.
I don't see a compelling reason for us to not advertise the server's
storage requirements. The proper way to advertise stream clone support
in wireprotov2 would be to not advertise the command(s) required to
perform stream clone or to advertise a separate capability denoting
stream clone support.
Stream clone isn't yet implemented on wireprotov2, so we can cross
this bridge later.
Differential Revision: https://phab.mercurial-scm.org/D4863
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 03 Oct 2018 10:04:04 -0700 |
parents | b099e6032f38 |
children | 9b19b8ce3804 |
comparison
equal
deleted
inserted
replaced
40048:a732d70253b0 | 40049:39074a35f7db |
---|---|
18 discovery, | 18 discovery, |
19 encoding, | 19 encoding, |
20 error, | 20 error, |
21 narrowspec, | 21 narrowspec, |
22 pycompat, | 22 pycompat, |
23 streamclone, | |
24 util, | 23 util, |
25 wireprotoframing, | 24 wireprotoframing, |
26 wireprototypes, | 25 wireprototypes, |
27 ) | 26 ) |
28 from .utils import ( | 27 from .utils import ( |
520 caps['commands'][command] = { | 519 caps['commands'][command] = { |
521 'args': args, | 520 'args': args, |
522 'permissions': [entry.permission], | 521 'permissions': [entry.permission], |
523 } | 522 } |
524 | 523 |
525 if streamclone.allowservergeneration(repo): | 524 caps['rawrepoformats'] = sorted(repo.requirements & |
526 caps['rawrepoformats'] = sorted(repo.requirements & | 525 repo.supportedformats) |
527 repo.supportedformats) | |
528 | 526 |
529 targets = getadvertisedredirecttargets(repo, proto) | 527 targets = getadvertisedredirecttargets(repo, proto) |
530 if targets: | 528 if targets: |
531 caps[b'redirect'] = { | 529 caps[b'redirect'] = { |
532 b'targets': [], | 530 b'targets': [], |