D3728: grep: adds unmodified mode

Yuya Nishihara yuya at tcha.org
Sat Jun 16 09:17:27 EDT 2018


> +    allfiles = opts.get('allfiles')
>      follow = opts.get('follow') or opts.get('follow_first')
>      revs = _walkrevs(repo, opts)
>      if not revs:
> @@ -1990,7 +1991,11 @@
>                  ctx = change(rev)
>                  if not fns:
>                      def fns_generator():
> -                        for f in ctx.files():
> +                        if allfiles and len(revs) == 1:

Can you make it error out if len(revs) > 1 isn't supported?
For example,

```
    allfiles = opts.get('allfiles')
    follow = opts.get('follow') or opts.get('follow_first')
    revs = _walkrevs(repo, opts)
    if allfiles and len(revs) > 1:
        raise error.Abort(_(...))  # or ProgrammingError if that never happens
```


More information about the Mercurial-devel mailing list