comparison hgext/narrow/narrowcommands.py @ 39934:a24f4638d6c1

narrow: move the ellipses server capability to core This will be used in core logic to determining whether a server is ellipses enabled or not. And also this will ease moving narrow related things to core. Differential Revision: https://phab.mercurial-scm.org/D4809
author Pulkit Goyal <pulkit@yandex-team.ru>
date Sun, 30 Sep 2018 03:45:51 +0530
parents d5498db5f86a
children 693dda764efe
comparison
equal deleted inserted replaced
39933:d5498db5f86a 39934:a24f4638d6c1
30 sparse, 30 sparse,
31 util, 31 util,
32 wireprotoserver, 32 wireprotoserver,
33 ) 33 )
34 34
35 from . import (
36 narrowwirepeer,
37 )
38
39 table = {} 35 table = {}
40 command = registrar.command(table) 36 command = registrar.command(table)
41 37
42 def setup(): 38 def setup():
43 """Wraps user-facing mercurial commands with narrow-aware versions.""" 39 """Wraps user-facing mercurial commands with narrow-aware versions."""
146 kwargs['oldexcludepats'] = exclude 142 kwargs['oldexcludepats'] = exclude
147 kwargs['includepats'] = include 143 kwargs['includepats'] = include
148 kwargs['excludepats'] = exclude 144 kwargs['excludepats'] = exclude
149 # calculate known nodes only in ellipses cases because in non-ellipses cases 145 # calculate known nodes only in ellipses cases because in non-ellipses cases
150 # we have all the nodes 146 # we have all the nodes
151 if narrowwirepeer.ELLIPSESCAP in pullop.remote.capabilities(): 147 if wireprotoserver.ELLIPSESCAP in pullop.remote.capabilities():
152 kwargs['known'] = [node.hex(ctx.node()) for ctx in 148 kwargs['known'] = [node.hex(ctx.node()) for ctx in
153 repo.set('::%ln', pullop.common) 149 repo.set('::%ln', pullop.common)
154 if ctx.node() != node.nullid] 150 if ctx.node() != node.nullid]
155 if not kwargs['known']: 151 if not kwargs['known']:
156 # Mercurial serializes an empty list as '' and deserializes it as 152 # Mercurial serializes an empty list as '' and deserializes it as