mercurial/localrepo.py
changeset 14902 96a72cbc6c29
parent 14870 f73c7b70df68
child 14904 ff2d907a5af8
--- a/mercurial/localrepo.py	Thu Jul 21 14:05:45 2011 -0500
+++ b/mercurial/localrepo.py	Thu Jul 21 14:06:55 2011 -0500
@@ -10,7 +10,7 @@
 import repo, changegroup, subrepo, discovery, pushkey
 import changelog, dirstate, filelog, manifest, context, bookmarks
 import lock, transaction, store, encoding
-import scmutil, util, extensions, hook, error
+import scmutil, util, extensions, hook, error, revset
 import match as matchmod
 import merge as mergemod
 import tags as tagsmod
@@ -217,6 +217,17 @@
         for i in xrange(len(self)):
             yield i
 
+    def set(self, expr, *args):
+        '''
+        Yield a context for each matching revision, after doing arg
+        replacement via formatrevspec
+        '''
+
+        expr = revset.formatspec(expr, *args)
+        m = revset.match(None, expr)
+        for r in m(self, range(len(self))):
+            yield self[r]
+
     def url(self):
         return 'file:' + self.root