Add nobug() revset query
authorGregory Szorc <>
Fri, 08 Nov 2013 00:51:46 -0800
changeset 67 40cd3c48f7817119e1f65f5cad8566bf78039079
parent 66 4a8116044c658cba94c6bab9bc92892fc262df36
child 68 1a0274f1ff870879696d163639630a08f68718b3
push id48
push dateFri, 08 Nov 2013 08:51:53 +0000
Add nobug() revset query
--- a/
+++ b/
@@ -123,16 +123,19 @@ dontbuild()
    Retrieve changesets that you are involved with.
    Currently, this only retrieves changesets you authored (via ui.username).
    In the future, this extension will index review syntax in commit messages
    and return changesets that you reviewed.
+   Retrieve changesets that don't reference a bug in the commit message.
    Retrieve changesets that initially landed on the specified tree.
    Retrieve changesets that are currently in the specified tree.
    Trees are specified with a known alias. e.g. ``tree(central)``.
@@ -724,16 +727,23 @@ def revset_me(repo, subset, x):
     for r in subset:
         if matcher(encoding.lower(repo[r].user())):
             yield r
         # TODO check reviewer blocks.
+def revset_nobug(repo, subset, x):
+    if x:
+        raise ParseError(_('nobug() does not take any arguments'))
+    return [r for r in subset if not parse_bugs(repo[r].description())]
 def revset_tree(repo, subset, x):
     Changesets currently in the specified Mozilla tree.
     A tree is the name of a repository. e.g. ``central``.
     err = _('tree() requires a string argument.')
     tree = revset.getstring(x, err)
@@ -949,16 +959,17 @@ def extsetup(ui):
     except KeyError:
     extensions.wrapcommand(commands.table, 'pull', pullexpand)
     revset.symbols['bug'] = revset_bug
     revset.symbols['dontbuild'] = revset_dontbuild
     revset.symbols['me'] = revset_me
+    revset.symbols['nobug'] = revset_nobug
     revset.symbols['tree'] = revset_tree
     revset.symbols['firstpushtree'] = revset_firstpushtree
     templatekw.keywords['bug'] = template_bug
     templatekw.keywords['bugs'] = template_bugs
     templatekw.keywords['firstrelease'] = template_firstrelease
     templatekw.keywords['firstbeta'] = template_firstbeta
     templatekw.keywords['firstaurora'] = template_firstaurora