dontbuild() revset selector
authorGregory Szorc <gps@mozilla.com>
Fri, 08 Nov 2013 00:28:12 -0800
changeset 65 d4dd9768a411706c413694814e6d679cd322228c
parent 64 05f97a21b0c18ed99f48c3cee392d031aa73d6ae
child 66 4a8116044c658cba94c6bab9bc92892fc262df36
push id46
push usergszorc@mozilla.com
push dateFri, 08 Nov 2013 08:28:17 +0000
dontbuild() revset selector
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -113,16 +113,19 @@ bugs via `hg buginfo`.
 Revisions Sets
 ==============
 
 This extension adds the following revision set selectors functions.
 
 bug(BUG)
    Retreive changesets that reference a specific bug. e.g. ``bug(784841)``.
 
+dontbuild()
+   Retrieve changesets that are marked as DONTBUILD.
+
 me()
    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.
 
 firstpushtree(TREE)
@@ -689,16 +692,23 @@ def revset_bug(repo, subset, x):
         raise ParseError(err)
 
     nodes = repo.changetracker.changesets_with_bug(n)
     revs = set(repo[node].rev() for node in nodes)
 
     return [r for r in subset if r in revs]
 
 
+def revset_dontbuild(repo, subset, x):
+    if x:
+        raise ParseError(_('dontbuild() does not take any arguments'))
+
+    return [r for r in subset if 'DONTBUILD' in repo[r].description()]
+
+
 def revset_me(repo, subset, x):
     """``me()``
     Changesets that you are involved in.
     """
     if x:
         raise ParseError(_('me() does not take any arguments'))
 
     me = repo.ui.config('ui', 'username')
@@ -921,16 +931,17 @@ def extsetup(ui):
         extensions.find('bzexport')
         bz_available = True
     except KeyError:
         pass
 
     extensions.wrapcommand(commands.table, 'pull', pullexpand)
 
     revset.symbols['bug'] = revset_bug
+    revset.symbols['dontbuild'] = revset_dontbuild
     revset.symbols['me'] = revset_me
     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