Ubuntu 上安装 Mercurial 的正确方法
我对 Mercurial 和 Ubuntu 都很陌生。
我似乎已经笨拙地安装了一些其他软件包,所以我想看看其他人会如何做这件事。
我应该使用 apt-get 命令吗?如果是这样,在这种情况下我将如何使用它?在我的文件系统上安装 Mercurial 的最佳位置是哪里?如何使其成为我的 shell 的一部分(我正在考虑 svn 式),以便我可以正确地签入和更新内容?
谢谢, 亚历克斯
I am kind of new to both, Mercurial and Ubuntu.
I seem to have awkwardly installed a few other software packages already, so I wanted to see how others would go about doing this.
Should I use the apt-get command? If so, how would I use it in this case? Where is the best place to install Mercurial on my file system, and how do I make it part of my shell (I am thinking svn-ish) so I can properly check things in and update?
Thanks,
Alex
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
只需使用:
它应该将其安装在默认文件夹中并正确更新您的环境变量。那么你应该能够从命令行使用“hg”,就像 svn 一样,尽管 Hg 是一个更好的源代码控制工具。
Just use:
It should install it in the default folder and update your environment variables correctly. then you should be able to use 'hg' from the command line, just like svn, although Hg is a much better source control tool.
新答案
之前我指的是 TortoiseHG PPA,它也包含 Mercurial。目前(2015 年)Mercurial 的最新版本位于另一个 PPA 中,仅特定于 Mercurial。
重要说明:此版本与 TortoiseHG 不兼容,如果您安装更新的 Mercurial,Tortoise 将被删除!
如果您不关心 Tortoise,只想要更新的 Mercurial 软件包,请使用下一个命令安装:
但是,这也不会给您绝对最新的版本。要享受最新版本,您可能需要通过 PIP 安装它:
这将为您提供最新版本(来自 PPA 的 3.6.2 与 3.3.2)。似乎这个也与存储库中的 TortoiseHG 不兼容。
旧答案
虽然可以从默认存储库中获得,但那里的版本已经过时了。在撰写本文时:2.2.2 与 2.5.2。所以我建议使用 PPA:
TortoiseHG 不是必需的,但建议使用。
NEW ANSWER
Previously I was pointing to TortoiseHG PPA, which also contained Mercurial. For now (year 2015) the more recent version of Mercurial is in another PPA, specific for Mercurial only.
Important note: this version is incompatible with TortoiseHG, and Tortoise will be REMOVED, if you install the more recent Mercurial!
If you don't care of Tortoise and just want more recent Mercurial package, use next command to install:
However, this won't give you the absolutely latest version either. To enjoy the latest version, you may want to install it via PIP:
This would give you the very latest version (3.6.2 vs 3.3.2 from the PPA). Seems this one is also not compatible with TortoiseHG from the repos.
OLD ANSWER
Though available from default repos, the version there is outdated. At the time of writing: 2.2.2 vs 2.5.2. So I would recommend to use the PPA:
TortoiseHG is not required, but is recommended.
是的,你可以安装它,
但对我来说它提供了非常旧的版本(2.0.2)。您可以通过
hg版本
来检查。要获取更新版本,您可以执行以下操作现在我有 3.0.1 版本
更多详细信息:在 Linux 上安装 Mercurial
PS:上面的链接转到我的个人博客,其中包含其他详细信息。
Yeah you can install it by just
but for me it gave very old version (2.0.2). You can check this by
hg version
. To get the newer version you can doNow I have 3.0.1 version
More details : Installing Mercurial on Linux
PS: Above link goes to my personal blog which has additional details.
Mercurial 可从 Universe 存储库获取。
如果尚未启用,请在 USC 中启用该存储库。
然后只需在终端中输入以下内容即可。
配置文件保存在/etc/mercurial/hgrc中
您可以通过编辑该文件来配置 Mercurial。
要在 gedit 中打开该文件,请输入以下命令
Mercurial is available from the Universe repositories.
Enable that repository in USC if it's not already enabled.
Then just type the following into a terminal.
The configuration file is saved in /etc/mercurial/hgrc
You can configure mercurial by editing that file.
To open that file in gedit type the following command
如果您使用的是旧版本的 Ubuntu(也许是 12.04?),请使用 Mercurial PPA。
例如,在撰写本文时,这会在 Ubuntu 12.04 上安装 Mercurial 3.0.1。
If you are using an older version of Ubuntu (12.04 perhaps?), use the Mercurial PPA.
As of this writing, this installs mercurial 3.0.1 on Ubuntu 12.04 for example.
只是为了让大家知道,
sudo apt-get install Mercurial
正在提供版本 3.0.1(撰写本文时最新)
所以无需尝试其他东西,因为这就是您需要的一切。
just to let everyone know,
sudo apt-get install mercurial
is delivering version 3.0.1 (latest as the time of writing this post)
so no need to try other stuff as this is everything you'll need.
Ubuntu 存储库中的 Mercurial 版本相对较旧。我尝试使用 PPA 来获取更新的版本。但 Ubuntu 抱怨“存储库......没有发布文件”并禁用它。
然后我使用替代方法安装最新的 Mercurial 版本:
The Mercurial version in the Ubuntu repository is relatively old. I tried to use the PPA, to get more recent version. But Ubuntu complains that "The repository ... does not have a Release file" and disables it.
Then I used alternative way to install latest Mercurial version: