HG(CAT)

🌸 HG(CAT) 🌸

okay bestie, sit down, hydrate, because we're doing hg cat and it's actually so good?? this is the manual page for hg cat from the Mercurial docs, and by the end you're gonna be printing files from any revision like it's nothing. periodt. πŸ’…


✨ NAME ✨

hg cat β€” output the current or given revision of files 🐱


🫢 SYNOPSIS 🫢

hg cat [OPTION]... FILE...

πŸ’– DESCRIPTION πŸ’–

so basically: it prints the files you name as they were at the revision you give it. iconic behaviour honestly.

if you don't hand it a revision? it just uses the parent of the working directory. easy. no drama. 🌈

you can also send the output to a file instead of your terminal, and when you do that, the name of that output file comes from a template string. see hg help templates for the whole vibe. on top of the common template keywords, these formatting rules are supported:

  • %% β€” a literal % character
  • %s β€” basename of the file being printed
  • %d β€” dirname of the file being printed, or . if you're in the repository root
  • %p β€” root-relative path name of the file being printed
  • %H β€” changeset hash (40 hexadecimal digits)
  • %R β€” changeset revision number
  • %h β€” short-form changeset hash (12 hexadecimal digits)
  • %r β€” zero-padded changeset revision number
  • %b β€” basename of the exporting repository
  • \ β€” a literal \ character

πŸŽ€ Template πŸŽ€

the following keywords are supported in addition to the common template keywords and functions. see also hg help templates. πŸ’œ

  • data β€” String. File content.
  • path β€” String. Repository-absolute path of the file.
also: it returns 0 on success. we love a clean exit. 🫢

πŸ‘‘ OPTIONS πŸ‘‘

  • -o, --output <FORMAT> β€” print output to a file with a formatted name
  • -r, --rev <REV> β€” print the given revision
  • --decode β€” apply any matching decode filter
  • -I, --include <PATTERN[+]> β€” include names matching the given patterns
  • -X, --exclude <PATTERN[+]> β€” exclude names matching the given patterns
  • -T, --template <TEMPLATE> β€” display with template
[+] marked option can be specified multiple times β€” yes bestie, stack 'em. πŸ”₯

and that's the whole page, no cap. this was the hg cat entry (that's the HG(CAT) page title, iykyk) from the Mercurial manual you've got pulled up β€” the footer on the original just repeats HG(CAT) with no extra version or date info attached, so no receipts to hand you there, sorry bestie 😭. go print some files at some old revisions, you're gonna eat. πŸ’–βœ¨πŸ¦‹