Mercurial > hg
comparison tests/pullext.py @ 45372:77b8588dd84e
requirements: introduce new requirements related module
It was not clear where all requirements should and related APIs should be, this
patch introduces a requirements module which will have all exitsing requirements
and related APIs.
Differential Revision: https://phab.mercurial-scm.org/D8917
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 08 Aug 2020 16:24:12 +0530 |
parents | 9f70512ae2cf |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
45371:e58e234096de | 45372:77b8588dd84e |
---|---|
11 from mercurial import ( | 11 from mercurial import ( |
12 commands, | 12 commands, |
13 error, | 13 error, |
14 extensions, | 14 extensions, |
15 localrepo, | 15 localrepo, |
16 requirements, | |
16 ) | 17 ) |
17 from mercurial.interfaces import repository | |
18 | 18 |
19 | 19 |
20 def clonecommand(orig, ui, repo, *args, **kwargs): | 20 def clonecommand(orig, ui, repo, *args, **kwargs): |
21 if kwargs.get('include') or kwargs.get('exclude'): | 21 if kwargs.get('include') or kwargs.get('exclude'): |
22 kwargs['narrow'] = True | 22 kwargs['narrow'] = True |
29 | 29 |
30 return orig(ui, repo, *args, **kwargs) | 30 return orig(ui, repo, *args, **kwargs) |
31 | 31 |
32 | 32 |
33 def featuresetup(ui, features): | 33 def featuresetup(ui, features): |
34 features.add(repository.NARROW_REQUIREMENT) | 34 features.add(requirements.NARROW_REQUIREMENT) |
35 | 35 |
36 | 36 |
37 def extsetup(ui): | 37 def extsetup(ui): |
38 entry = extensions.wrapcommand(commands.table, b'clone', clonecommand) | 38 entry = extensions.wrapcommand(commands.table, b'clone', clonecommand) |
39 | 39 |