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. πβ¨π¦
π¦ where this page comes from
- arch rolling: mercurial 7.2.4-1 Β· GPL
- fedora 43: mercurial 7.1.1-1.fc43 Β· GPL-2.0-or-later
- fedora 43: mercurial 7.1.1-2.fc43 Β· GPL-2.0-or-later
- fedora 44: mercurial 7.2-1.fc44 Β· GPL-2.0-or-later
- fedora 44: mercurial 7.2.4-1.fc44 Β· GPL-2.0-or-later
- nixos 26.05: mercurial 7.1.2
- nixos 26.05: mercurial-full 7.1.2
- nixpkgs unstable: mercurial 7.2.2
- nixpkgs unstable: mercurial-full 7.2.2
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms