Question

I have installed Mercurial from the Ubuntu package repository. However I don't know how to enable extensions (q* commands). How should I do that? The help shows that

enabled extensions:
style  (no help text available)

I want to enable mq and hgk.

Was it helpful?

Solution

Enable extensions in hgrc.

extensions

Mercurial has an extension mechanism for adding new features. To enable an extension, create an entry for it in this section.

If you know that the extension is already in Python's search path, you can give the name of the module, followed by =, with nothing after the =.

Otherwise, give a name that you choose, followed by =, followed by the path to the .py file (including the file name extension) that defines the extension.

...

Example for ~/.hgrc:

[extensions]
# (the mq extension will get loaded from Mercurial's path)
mq =
# (this extension will get loaded from the file specified)
myfeature = ~/.hgext/myfeature.py

http://www.selenic.com/mercurial/hgrc.5.html#extensions

OTHER TIPS

You can also enable an extension without editing the hgrc, if you want to do it one off. [Source]

hg --config extensions.histedit= --help

The documentation of both extensions shows how to enable them : MQ, Hgk.

The usual way to enable an extension is to add a line to your .hgrc (or Mercurial.ini on some Windows system). It is explained in the hgrc documentation.

In your following case, add this to your configuration file :

[extensions]
mq =
hgk=

You can put it in your global configuration file or the repository one, depending if you want to have the extensions activated in every repository or just a specific one.

The output of hg help extensions starts with

Using additional features

Mercurial has the ability to add new features through the use of extensions. Extensions may add new commands, add options to existing commands, change the default behavior of commands, or implement hooks.

Extensions are not loaded by default for a variety of reasons: they can increase startup overhead; they may be meant for advanced usage only; they may provide potentially dangerous abilities (such as letting you destroy or modify history); they might not be ready for prime time; or they may alter some usual behaviors of stock Mercurial. It is thus up to the user to activate extensions as needed.

To enable the "foo" extension, either shipped with Mercurial or in the Python search path, create an entry for it in your configuration file, like this:

[extensions]
foo =

You may also specify the full path to an extension:

[extensions]
myfeature = ~/.hgext/myfeature.py

So just add

[extensions]
mq =

to enable the MQ extension.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top