mercurial/cmdutil.py
changeset 38342 b8f45fc27370
parent 38341 50f5fc232c16
child 38347 89db59e5cf3e
--- a/mercurial/cmdutil.py	Wed Jun 13 22:50:32 2018 +0530
+++ b/mercurial/cmdutil.py	Wed Jun 13 16:22:54 2018 +0530
@@ -1881,10 +1881,13 @@
     yielding each context, the iterator will first call the prepare
     function on each context in the window in forward order.'''
 
+    allfiles = opts.get('allfiles')
     follow = opts.get('follow') or opts.get('follow_first')
     revs = _walkrevs(repo, opts)
     if not revs:
         return []
+    if allfiles and len(revs) > 1:
+        raise error.Abort(_("multiple revisions not supported with --allfiles"))
     wanted = set()
     slowpath = match.anypats() or (not match.always() and opts.get('removed'))
     fncache = {}
@@ -1990,7 +1993,11 @@
                 ctx = change(rev)
                 if not fns:
                     def fns_generator():
-                        for f in ctx.files():
+                        if allfiles:
+                            fiter = iter(ctx)
+                        else:
+                            fiter = ctx.files()
+                        for f in fiter:
                             if match(f):
                                 yield f
                     fns = fns_generator()