[PATCH] locate: update help with replacement

Danek Duvall danek.duvall at oracle.com
Wed Dec 9 11:51:32 CST 2015


timeless wrote:

> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1449682015 0
> #      Wed Dec 09 17:26:55 2015 +0000
> # Node ID 98cc8438650f95b9f40d7e8659f6d4e8c254cd14
> # Parent  42aa0e570eaa364a622bc4443b0bcb79b1100a58
> locate: update help with replacement
> 
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -4866,22 +4866,12 @@
>  def locate(ui, repo, *pats, **opts):
>      """locate files matching specific patterns (DEPRECATED)
>  
> -    Print files under Mercurial control in the working directory whose
> -    names match the given patterns.
> -
> -    By default, this command searches all directories in the working
> -    directory. To search just the current directory and its
> -    subdirectories, use "--include .".
> -
> -    If no patterns are given to match, this command prints the names
> -    of all files under Mercurial control in the working directory.
> -
> -    If you want to feed the output of this command into the "xargs"
> -    command, use the -0 option to both this command and "xargs". This
> -    will avoid the problem of "xargs" treating single filenames that
> -    contain whitespace as multiple filenames.
> -
> -    See :hg:`help files` for a more versatile command.
> +    Please use `hg files` instead::
> +
> +        hg locate => hg files
> +        hg locate -f => hg files --template `hg root`"/{abspath}\\n"
> +
> +    See :hg:`help files`.

That first one isn't quite right, though.  "hg files" looks only in the
current directory by default, rather than giving you all matching files
(with relative paths), and it also explicitly requires "glob:**" when
running from the root of the working directory.

And where is {abspath} documented?

Thanks,
Danek


More information about the Mercurial-devel mailing list