comparison mercurial/hg.py @ 39553:130e5df346d5

exchange: support defining narrow file patterns for pull This commit teaches exchange.pull() about the desire to perform a narrow file pull. We simply pass include and exclude patterns to the function. The values are validated and stored on the pulloperation instance. hg.clone() has been taught to pass these arguments to exchange.pull(). If the arguments are not passed to exchange.pull(), the active narrow patterns from the repository will automatically be used. We /could/ always use the narrow patterns from the repo. However, allowing explicit values to be passed in allows us to perform data fetching that doesn't necessarily align with the repo configuration. This provides more flexibility. Differential Revision: https://phab.mercurial-scm.org/D4539
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 11 Sep 2018 17:21:18 -0700
parents 65b5900f30be
children cb675e95a2c2
comparison
equal deleted inserted replaced
39552:4c807ec07888 39553:130e5df346d5
747 stream = None 747 stream = None
748 # internal config: ui.quietbookmarkmove 748 # internal config: ui.quietbookmarkmove
749 overrides = {('ui', 'quietbookmarkmove'): True} 749 overrides = {('ui', 'quietbookmarkmove'): True}
750 with local.ui.configoverride(overrides, 'clone'): 750 with local.ui.configoverride(overrides, 'clone'):
751 exchange.pull(local, srcpeer, revs, 751 exchange.pull(local, srcpeer, revs,
752 streamclonerequested=stream) 752 streamclonerequested=stream,
753 includepats=storeincludepats,
754 excludepats=storeexcludepats)
753 elif srcrepo: 755 elif srcrepo:
754 # TODO lift restriction once exchange.push() accepts narrow 756 # TODO lift restriction once exchange.push() accepts narrow
755 # push. 757 # push.
756 if narrow: 758 if narrow:
757 raise error.Abort(_('narrow clone not available for ' 759 raise error.Abort(_('narrow clone not available for '