HG(ARCHIVE)
HG(ARCHIVE) π
okay bestie, you know hg archive? it's the manual page for it. yes, that manual page. come sit, we're doing this together π«Ά
β¨ NAME β¨
hg archive β create an unversioned archive of a repository revision
like. it takes your repo and yeets a clean copy out of it, no version control history attached. iconic behavior honestly π
πΈ SYNOPSIS πΈ
hg archive [OPTION]... DEST
DEST is where it lands. everything else is vibes (options). π
π¦ DESCRIPTION π¦
So by default β no cap β the revision it grabs is the parent of the working directory. that's the default. that's what you get if you say nothing. if you want a different revision, you use -r/--rev and tell it which one. periodt.
The archive type? it just knows. automatically detected based on file extension β¨ and if the auto-detect is giving wrong, you override it with -t/--type. simple as that.
π Examples π
- create a zip file containing the
1.0release:
hg archive -r 1.0 project-1.0.zip
- create a tarball excluding
.hgfiles:
hg archive project.tar.gz -X ".hg*"
π Valid types are: π
filesβ a directory full of files (this is the default, btw)tarβ tar archive, uncompressedtbz2β tar archive, compressed usingbzip2tgzβ tar archive, compressed usinggziptxzβ tar archive, compressed usinglzma(only in Python 3, so like, mind that)uzipβ zip archive, uncompressedzipβ zip archive, compressed usingdeflate
The exact name of the destination archive or directory is given using a format string β and if you're like "format string?? elaborate" then go read hg help export for the details. i'm not making that up, it's literally where the details live π
Every member added to an archive file gets a directory prefix prepended to it. you control that prefix with -p/--prefix, which takes a format string. the default prefix? the basename of the archive, with suffixes removed. cute, right? π
Returns 0 on success. yes ma'am. β
π OPTIONS π
--no-decodeβ do not pass files through decoders. just raw. leave them be π-p,--prefix <PREFIX>β directory prefix for files in archive-r,--rev <REV>β revision to distribute-t,--type <TYPE>β type of distribution to create-S,--subreposβ recurse into subrepositories (going deeper, bestie π³οΈ)-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-Iand-X? stack 'em. go off. π β¨
and that's the whole page, bestie. every flag, every type, every example, all of it. nothing skipped, nothing invented. i would never do you like that. π«Ά
big kiss goodbye from the HG(ARCHIVE) corner of the manual β that's the source and the version stamp right there in the footer, dated the same as ever, no extra lore attached. mwah. ππ
π¦ 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