equal
deleted
inserted
replaced
1879 |
1879 |
1880 This function returns an iterator yielding contexts. Before |
1880 This function returns an iterator yielding contexts. Before |
1881 yielding each context, the iterator will first call the prepare |
1881 yielding each context, the iterator will first call the prepare |
1882 function on each context in the window in forward order.''' |
1882 function on each context in the window in forward order.''' |
1883 |
1883 |
|
1884 allfiles = opts.get('allfiles') |
1884 follow = opts.get('follow') or opts.get('follow_first') |
1885 follow = opts.get('follow') or opts.get('follow_first') |
1885 revs = _walkrevs(repo, opts) |
1886 revs = _walkrevs(repo, opts) |
1886 if not revs: |
1887 if not revs: |
1887 return [] |
1888 return [] |
|
1889 if allfiles and len(revs) > 1: |
|
1890 raise error.Abort(_("multiple revisions not supported with --allfiles")) |
1888 wanted = set() |
1891 wanted = set() |
1889 slowpath = match.anypats() or (not match.always() and opts.get('removed')) |
1892 slowpath = match.anypats() or (not match.always() and opts.get('removed')) |
1890 fncache = {} |
1893 fncache = {} |
1891 change = repo.__getitem__ |
1894 change = repo.__getitem__ |
1892 |
1895 |
1988 for rev in sorted(nrevs): |
1991 for rev in sorted(nrevs): |
1989 fns = fncache.get(rev) |
1992 fns = fncache.get(rev) |
1990 ctx = change(rev) |
1993 ctx = change(rev) |
1991 if not fns: |
1994 if not fns: |
1992 def fns_generator(): |
1995 def fns_generator(): |
1993 for f in ctx.files(): |
1996 if allfiles: |
|
1997 fiter = iter(ctx) |
|
1998 else: |
|
1999 fiter = ctx.files() |
|
2000 for f in fiter: |
1994 if match(f): |
2001 if match(f): |
1995 yield f |
2002 yield f |
1996 fns = fns_generator() |
2003 fns = fns_generator() |
1997 prepare(ctx, fns) |
2004 prepare(ctx, fns) |
1998 for rev in nrevs: |
2005 for rev in nrevs: |