如何启用Mercurial扩展(例如mq)?

发布于 2024-12-19 09:29:10 字数 181 浏览 2 评论 0原文

我已经从 Ubuntu 软件包存储库安装了 Mercurial。但是我不知道如何启用扩展(q* 命令)。我该怎么做呢?帮助显示

enabled extensions:
style  (no help text available)

我要启用mq和hgk。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

御弟哥哥 2024-12-26 09:29:10

hgrc 中启用扩展。

扩展

Mercurial 有一个用于添加新功能的扩展机制。到
启用扩展,在此部分中为其创建一个条目。

如果您知道该扩展已在 Python 的搜索路径中,那么您
可以给出模块的名称,后跟 =,后面没有任何内容
<代码>=。

否则,请给出您选择的名称,后跟 =,然后是
.py 文件的路径(包括文件扩展名)
定义扩展名。

...

~/.hgrc 示例:

<前><代码>[扩展名]
#(mq 扩展将从 Mercurial 的路径加载)
MQ =
#(此扩展将从指定的文件中加载)
myfeature = ~/.hgext/myfeature.py

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

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

千笙结 2024-12-26 09:29:10

如果您想一次性执行此操作,您还可以在不编辑 hgrc 的情况下启用扩展。 [来源]

hg --config extensions.histedit= --help

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

hg --config extensions.histedit= --help
梦冥 2024-12-26 09:29:10

这两个扩展的文档显示了如何启用它们:MQHgk

启用扩展的常用方法是在 .hgrc(或某些 Windows 系统上的 Mercurial.ini)中添加一行。 hgrc 文档对此进行了解释。

在以下情况下,请将其添加到您的配置文件中:

[extensions]
mq =
hgk=

您可以将其放入全局配置文件或存储库配置文件中,具体取决于您是否希望在每个存储库中或仅在特定存储库中激活扩展。

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.

七度光 2024-12-26 09:29:10

hg help extensions 的输出以

使用附加功能

Mercurial 能够通过使用添加新功能
扩展。扩展可能会添加新命令,向现有命令添加选项
命令、更改命令的默认行为或实现挂钩。

出于多种原因,默认情况下不会加载扩展程序:它们可以
增加启动开销;它们可能仅供高级使用;他们
可能会提供潜在危险的能力(例如让你摧毁
或修改历史记录);他们可能还没有准备好迎接黄金时段;或者他们可能
改变 Mercurial 的一些常见行为。因此,这取决于用户
根据需要激活扩展。

要启用“foo”扩展,可以随 Mercurial 一起提供,也可以在
Python 搜索路径,在配置文件中为其创建一个条目,
像这样:

<前><代码>[扩展名]
富=

您还可以指定扩展程序的完整路径:

<前><代码>[扩展名]
myfeature = ~/.hgext/myfeature.py

因此只需添加

[extensions]
mq =

即可启用 MQ 扩展。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文