equal
deleted
inserted
replaced
1 from mercurial import revset |
1 from mercurial import revset |
|
2 |
|
3 from . import constants |
2 |
4 |
3 def topicset(repo, subset, x): |
5 def topicset(repo, subset, x): |
4 """`topic([topic])` |
6 """`topic([topic])` |
5 Specified topic or all changes with any topic specified. |
7 Specified topic or all changes with any topic specified. |
6 |
8 |
15 topic = revset.getstring(args[0], 'topic() argument must be a string') |
17 topic = revset.getstring(args[0], 'topic() argument must be a string') |
16 _kind, _pattern, matcher = revset._stringmatcher(topic) |
18 _kind, _pattern, matcher = revset._stringmatcher(topic) |
17 else: |
19 else: |
18 matcher = lambda t: bool(t) |
20 matcher = lambda t: bool(t) |
19 drafts = subset.filter(lambda r: repo[r].mutable()) |
21 drafts = subset.filter(lambda r: repo[r].mutable()) |
20 return drafts.filter(lambda r: matcher(repo[r].extra().get('topic', ''))) |
22 return drafts.filter( |
|
23 lambda r: matcher(repo[r].extra().get(constants.extrakey, ''))) |
21 |
24 |
22 def modsetup(): |
25 def modsetup(): |
23 revset.symbols.update({'topic': topicset}) |
26 revset.symbols.update({'topic': topicset}) |