Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/sparse.py @ 33301:ca4b78eb11e7
sparse: move active profiles function into core
Also includes some light formatting changes.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 06 Jul 2017 12:26:04 -0700 |
parents | f7a106b3f089 |
children | 36a415b5a4b2 |
comparison
equal
deleted
inserted
replaced
33300:f7a106b3f089 | 33301:ca4b78eb11e7 |
---|---|
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 from __future__ import absolute_import | 8 from __future__ import absolute_import |
9 | 9 |
10 from .i18n import _ | 10 from .i18n import _ |
11 from .node import nullid | |
11 from . import ( | 12 from . import ( |
12 error, | 13 error, |
13 ) | 14 ) |
14 | 15 |
15 # Whether sparse features are enabled. This variable is intended to be | 16 # Whether sparse features are enabled. This variable is intended to be |
113 | 114 |
114 if includes: | 115 if includes: |
115 includes.add('.hg*') | 116 includes.add('.hg*') |
116 | 117 |
117 return includes, excludes, profiles | 118 return includes, excludes, profiles |
119 | |
120 def activeprofiles(repo): | |
121 revs = [repo.changelog.rev(node) for node in | |
122 repo.dirstate.parents() if node != nullid] | |
123 | |
124 profiles = set() | |
125 for rev in revs: | |
126 profiles.update(patternsforrev(repo, rev)[2]) | |
127 | |
128 return profiles |