Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
2a6ee654
Commit
2a6ee654
authored
13 years ago
by
Martin Geisler
Browse files
Options
Downloads
Patches
Plain Diff
hgrc.5: document shell aliases
parent
89e7d35e
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/hgrc.5.txt
+20
-0
20 additions, 0 deletions
doc/hgrc.5.txt
with
20 additions
and
0 deletions
doc/hgrc.5.txt
+
20
−
0
View file @
2a6ee654
...
...
@@ -200,6 +200,26 @@
existing commands, which will then override the original
definitions. This is almost always a bad idea!
An alias can start with an exclamation point (``!``) to make it a
shell alias. A shell alias is executed with the shell and will let you
run arbitrary commands. As an example, ::
echo = !echo
will let you do ``hg echo foo`` to have ``foo`` printed in your
terminal. A better example might be::
purge = !$HG status --no-status --unknown -0 | xargs -0 rm
which will make ``hg purge`` delete all unknown files in the
repository in the same manner as the purge extension.
Shell aliases are executed in an environment where ``$HG`` expand to
the path of the Mercurial that was used to execute the alias. This is
useful when you want to call further Mercurial commands in a shell
alias, as was done above for the purge alias. In addition,
``$HG_ARGS`` expand to the arguments given to Mercurial. In the ``hg
echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
``auth``
""""""""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment