bug() revset should parse bugs at run-time
authorGregory Szorc <gps@mozilla.com>
Mon, 18 Nov 2013 13:38:04 -0800
changeset 85 a791d156bddee738b956ee1abf42cfd42f80481d
parent 84 2948a807c49c820016867a3f137f1e6c95ee1538
child 86 d1eddd7792201d2ca8ad90572f1bb96cf0833b60
push id62
push usergszorc@mozilla.com
push dateMon, 18 Nov 2013 21:38:06 +0000
bug() revset should parse bugs at run-time
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -754,20 +754,17 @@ def revset_bug(repo, subset, x):
     err = _('bug() requires an integer argument.')
     n = revset.getstring(x, err)
 
     try:
         n = int(n)
     except Exception:
         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]
+    return [r for r in subset if n in parse_bugs(repo[r].description())]
 
 
 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()]