Differences between revisions 9 and 18 (spanning 9 versions)
Revision 9 as of 2007-09-27 15:21:05
Size: 641
Comment: alias is not official yet
Revision 18 as of 2013-08-08 00:05:19
Size: 939
Editor: rcl
Comment: update style
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Alias Extension == #pragma section-numbers 2
= Alias Extension =
Line 3: Line 4:
'''This extension is not distributed with Mercurial yet''', but is already available in development repositories (see DeveloperRepos) Define convenient command aliases.
Line 5: Line 6:
Download site: http://hg.kublai.com/mercurial/extensions/alias <<TableOfContents>>
Line 7: Line 8:
== Status ==
Line 8: Line 10:
''Author: Brendan Cully'' '''This extension has been moved into core Mercurial as of 1.3.'''
Line 10: Line 12:
''Original author: Brendan Cully''
Line 11: Line 14:
=== Overview === == Overview ==
Line 13: Line 16:
Just enable the extension, then define your own command aliases in your hgrc.
For example, the configuration below gives you a new {{{llog}}} command.
Define your own shortcuts for Mercurial's command-line user interface.
Line 16: Line 18:
=== Configuration ===
Configure your .hgrc to enable the extension by adding following lines:
== Configuration ==

Add the following lines to a hgrc to add a `llog` command:
Line 20: Line 23:
[extensions]
alias =
Line 28: Line 28:
(In 1.2.1 and earlier, you also need to activate the extension from the {{{[extensions]}}} section.)

== Ideas for improvements ==
 * Support for global options like `--config` in extension definitions
 * Shell aliases
 * Argument substitution
 {{{
mq = hg -R $(hg root)/.hg/patches $*
}}}
 * Pipes
 {{{
hgrep = hg manifest | grep $*
}}}
 * Recursive alias definitions:
 {{{
foo = bar
bar = log
}}}
Line 29: Line 48:
CategoryExtension CategoryBundledExtension CategoryHistorical

Alias Extension

Define convenient command aliases.

1. Status

This extension has been moved into core Mercurial as of 1.3.

Original author: Brendan Cully

2. Overview

Define your own shortcuts for Mercurial's command-line user interface.

3. Configuration

Add the following lines to a hgrc to add a llog command:

[alias]
# short log
llog = log --limit 10

(In 1.2.1 and earlier, you also need to activate the extension from the [extensions] section.)

4. Ideas for improvements

  • Support for global options like --config in extension definitions

  • Shell aliases
  • Argument substitution
    mq = hg -R $(hg root)/.hg/patches $*
  • Pipes
    hgrep = hg manifest | grep $*
  • Recursive alias definitions:
    foo = bar
    bar = log


CategoryBundledExtension CategoryHistorical

AliasExtension (last edited 2013-08-08 00:05:19 by rcl)