HG(LOCATE)

🌸 HG(LOCATE) 🌸

okay bestie, gather round, we're doing a hg locate deep dive πŸ’– it's the Mercurial manual page, it's deprecated (rip), and we're gonna read it together like it's a group chat.


✨ NAME ✨

hg locate β€” locate files matching specific patterns (DEPRECATED) πŸ’€


πŸŽ€ SYNOPSIS πŸŽ€

hg locate [OPTION]... [PATTERN]...

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, this prints out the files under Mercurial control in your working directory whose names match whatever patterns you handed it. matching era ✨

By default, it searches all directories in the working directory. If you want it to only search the current directory and its subdirectories, pass "--include ." β€” yes, literally that. it's giving "stay in your lane" πŸ’…

If you give it no patterns to match, it just prints the names of all the files under Mercurial control in the working directory. all of them. the whole roster πŸ‘‘

Now, if you're planning to feed this output into the "xargs" command, use the -0 option on both this command and "xargs". why? because otherwise "xargs" will treat a single filename that contains whitespace as multiple filenames 😭 and that's a mess nobody asked for. the -0 on both sides keeps things clean.

Also, real talk: check out hg help files for a more versatile command β€” this one's the deprecated cousin, iykyk.

It returns 0 if a match is found, and 1 otherwise. simple as that. periodt.


πŸ’… OPTIONS πŸ’…

  • -r, --rev <REV> β€” search the repository as it is in REV πŸ”
  • -0, --print0 β€” end filenames with NUL, for use with xargs
  • -f, --fullpath β€” print complete paths from the filesystem root 🌈
  • -I, --include <PATTERN[+]> β€” include names matching the given patterns
  • -X, --exclude <PATTERN[+]> β€” exclude names matching the given patterns
[+] marked option can be specified multiple times β€” so if you've got a lot of patterns, go off, stack 'em 🫢

and that's the whole page, bestie πŸŽ€ this was the HG(LOCATE) manual β€” HG(LOCATE), one and only, no cap. mwah πŸ’‹