comparison mercurial/exchange.py @ 40492:440f5b65be57

exchange: pass includepats and excludepats as arguments to getbundle() This will help in implementing narrow stream clones. Also narrow extension used to add these arguments, now we add them by default if they are not empty. Since reading includepats and excludepats on the server only works when narrow is enabled, we check if narrow if enabled or not before passing them. Differential Revision: https://phab.mercurial-scm.org/D5119
author Pulkit Goyal <pulkit@yandex-team.ru>
date Tue, 16 Oct 2018 17:53:26 +0300
parents dd816e5391f6
children 9b8d1ad851f8
comparison
equal deleted inserted replaced
40491:c311424ea579 40492:440f5b65be57
38 scmutil, 38 scmutil,
39 sslutil, 39 sslutil,
40 streamclone, 40 streamclone,
41 url as urlmod, 41 url as urlmod,
42 util, 42 util,
43 wireprototypes,
43 ) 44 )
44 from .utils import ( 45 from .utils import (
45 stringutil, 46 stringutil,
46 ) 47 )
47 48
1631 1632
1632 # declare pull perimeters 1633 # declare pull perimeters
1633 kwargs['common'] = pullop.common 1634 kwargs['common'] = pullop.common
1634 kwargs['heads'] = pullop.heads or pullop.rheads 1635 kwargs['heads'] = pullop.heads or pullop.rheads
1635 1636
1637 # check server supports narrow and then adding includepats and excludepats
1638 servernarrow = pullop.remote.capable(wireprototypes.NARROWCAP)
1639 if servernarrow and pullop.includepats:
1640 kwargs['includepats'] = pullop.includepats
1641 if servernarrow and pullop.excludepats:
1642 kwargs['excludepats'] = pullop.excludepats
1643
1636 if streaming: 1644 if streaming:
1637 kwargs['cg'] = False 1645 kwargs['cg'] = False
1638 kwargs['stream'] = True 1646 kwargs['stream'] = True
1639 pullop.stepsdone.add('changegroup') 1647 pullop.stepsdone.add('changegroup')
1640 pullop.stepsdone.add('phases') 1648 pullop.stepsdone.add('phases')