D3826: grep: change default behaviour of grep

Yuya Nishihara yuya at tcha.org
Mon Jul 9 08:22:17 EDT 2018


Looks mostly good. Can you rebase this onto the current tip and update the
help?

>    $ hg grep '.*'
> -  port:4:export
> -  port:4:vaportight
> -  port:4:import/export
> +  port:2147483647:export
> +  port:2147483647:vaportight
> +  port:2147483647:import/export

[snip]

It's probably better to leave the existing tests to test the old behavior
by adding some arguments (maybe `-r tip:0`) unless we're sure that the new
behavior covers things that should be tested.

> +    if not opts.get('rev') and not diff:
> +        opts.get('rev').append("wdir()")

Nit: If you want to care for missing `opts['rev']`, this should be
`opts['rev'] = ["wdir()"]`.


More information about the Mercurial-devel mailing list