hgext3rd/topic/revset.py
changeset 4064 a2c0133006c6
parent 4063 00c65abf99cd
child 4095 aabf436c11cb
equal deleted inserted replaced
4063:00c65abf99cd 4064:a2c0133006c6
    59 
    59 
    60         if kind == 'literal':
    60         if kind == 'literal':
    61             # note: falls through to the revset case if no topic with this name
    61             # note: falls through to the revset case if no topic with this name
    62             # exists and pattern kind is not specified explicitly
    62             # exists and pattern kind is not specified explicitly
    63 
    63 
    64             alltopics = set([repo.currenttopic])
    64             if pattern not in repo.topics and topic.startswith('literal:'):
    65             for r in repo.unfiltered().set('all()'):
       
    66                 alltopics.add(r.topic(force=True))
       
    67             alltopics.discard('')
       
    68 
       
    69             if pattern in alltopics:
       
    70                 return (subset & mutable).filter(matches)
       
    71 
       
    72             if topic.startswith('literal:'):
       
    73                 raise error.RepoLookupError("topic '%s' does not exist"
    65                 raise error.RepoLookupError("topic '%s' does not exist"
    74                                             % pattern)
    66                                             % pattern)
       
    67             return (subset & mutable).filter(matches)
    75         else:
    68         else:
    76             return (subset & mutable).filter(matches)
    69             return (subset & mutable).filter(matches)
    77 
    70 
    78     s = revset.getset(repo, revset.fullreposet(repo), x)
    71     s = revset.getset(repo, revset.fullreposet(repo), x)
    79     topics = set(repo[r].topic() for r in s)
    72     topics = set(repo[r].topic() for r in s)