Ubuntu 上安装 Mercurial 的正确方法

发布于 2024-10-31 23:04:15 字数 222 浏览 5 评论 0原文

我对 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 技术交流群。

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

发布评论

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

评论(7

多彩岁月 2024-11-07 23:04:15

只需使用:

sudo apt-get install mercurial

它应该将其安装在默认文件夹中并正确更新您的环境变量。那么你应该能够从命令行使用“hg”,就像 svn 一样,尽管 Hg 是一个更好的源代码控制工具。

Just use:

sudo apt-get install mercurial

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.

不喜欢何必死缠烂打 2024-11-07 23:04:15

新答案

之前我指的是 TortoiseHG PPA,它也包含 Mercurial。目前(2015 年)Mercurial 的最新版本位于另一个 PPA 中,仅特定于 Mercurial。

重要说明:此版本与 TortoiseHG 不兼容,如果您安装更新的 Mercurial,Tortoise 将被删除!

如果您不关心 Tortoise,只想要更新的 Mercurial 软件包,请使用下一个命令安装:

sudo add-apt-repository -y ppa:mercurial-ppa/releases
sudo apt-get update
sudo apt-get install -y mercurial

但是,这也不会给您绝对最新的版本。要享受最新版本,您可能需要通过 PIP 安装它:

sudo apt-get install -y python-pip python-dev
sudo pip install mercurial --upgrade

这将为您提供最新版本(来自 PPA 的 3.6.2 与 3.3.2)。似乎这个也与存储库中的 TortoiseHG 不兼容。


旧答案

虽然可以从默认存储库中获得,但那里的版本已经过时了。在撰写本文时:2.2.2 与 2.5.2。所以我建议使用 PPA:

sudo add-apt-repository -y ppa:tortoisehg-ppa/releases
sudo apt-get update
sudo apt-get install mercurial tortoisehg

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:

sudo add-apt-repository -y ppa:mercurial-ppa/releases
sudo apt-get update
sudo apt-get install -y mercurial

However, this won't give you the absolutely latest version either. To enjoy the latest version, you may want to install it via PIP:

sudo apt-get install -y python-pip python-dev
sudo pip install mercurial --upgrade

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:

sudo add-apt-repository -y ppa:tortoisehg-ppa/releases
sudo apt-get update
sudo apt-get install mercurial tortoisehg

TortoiseHG is not required, but is recommended.

删除→记忆 2024-11-07 23:04:15

是的,你可以安装它,

sudo apt-get install mercurial

但对我来说它提供了非常旧的版本(2.0.2)。您可以通过hg版本来检查。要获取更新版本,您可以执行以下操作

sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install -U mercurial

现在我有 3.0.1 版本

aniket@ubuntu:~$ hg version
Mercurial Distributed SCM (version 3.0.1)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2014 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

更多详细信息:在 Linux 上安装 Mercurial

PS:上面的链接转到我的个人博客,其中包含其他详细信息。

Yeah you can install it by just

sudo apt-get install mercurial

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 do

sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install -U mercurial

Now I have 3.0.1 version

aniket@ubuntu:~$ hg version
Mercurial Distributed SCM (version 3.0.1)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2014 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

More details : Installing Mercurial on Linux

PS: Above link goes to my personal blog which has additional details.

泡沫很甜 2024-11-07 23:04:15

Mercurial 可从 Universe 存储库获取。
如果尚未启用,请在 USC 中启用该存储库。
然后只需在终端中输入以下内容即可。

sudo apt-get install mercurial

配置文件保存在/etc/mercurial/hgrc中
您可以通过编辑该文件来配置 Mercurial。
要在 gedit 中打开该文件,请输入以下命令

sudo gksudo gedit /etc/mercurial/hgrc

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.

sudo apt-get install mercurial

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

sudo gksudo gedit /etc/mercurial/hgrc
慵挽 2024-11-07 23:04:15

如果您使用的是旧版本的 Ubuntu(也许是 12.04?),请使用 Mercurial PPA

sudo add-apt-repository ppa:mercurial-ppa/releases
sudo apt-get update
sudo apt-get install mercurial

例如,在撰写本文时,这会在 Ubuntu 12.04 上安装 Mercurial 3.0.1。

If you are using an older version of Ubuntu (12.04 perhaps?), use the Mercurial PPA.

sudo add-apt-repository ppa:mercurial-ppa/releases
sudo apt-get update
sudo apt-get install mercurial

As of this writing, this installs mercurial 3.0.1 on Ubuntu 12.04 for example.

眉目亦如画i 2024-11-07 23:04:15

只是为了让大家知道,
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.

万劫不复 2024-11-07 23:04:15

Ubuntu 存储库中的 Mercurial 版本相对较旧。我尝试使用 PPA 来获取更新的版本。但 Ubuntu 抱怨“存储库......没有发布文件”并禁用它。
然后我使用替代方法安装最新的 Mercurial 版本:

sudo pip3 install mercurial --upgrade

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:

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