有人成功使用 TortoiseHg 的“自动排除列表”吗?
我有一个配置文件,我经常修改它以进行一些测试。大约 95% 的情况下,我修改此文件时,我不希望提交到存储库。在提交期间始终保持警惕是很麻烦的。
我在 TortoiseHg 中发现了这个据说很漂亮的功能,称为“自动排除列表”,它应该采用逗号分隔的文件列表,您希望默认为未选中(在提交、恢复、上架时)。这听起来是一种让我的生活变得更简单的完美、非黑客的方式。
问题是我无法让它做任何事情。我使用文件名(带/不带路径)、glob:文件名、引号、最后的逗号等 - 都没有运气。我在网上找到了关于此功能的很少信息(TortoiseHg UI 已经没有告诉我任何信息)。
仅供参考:TortoiseHg(版本 1.1)与 Mercurial-1.6、Python-2.6.4、PyGTK-2.16.0、GTK-2.16.6
有什么建议,或者此功能是否成功?
I have a config file which I often modify in order to do some testing. About 95% of the time I modify this file, I do not wish to commit to the repo. It's a nuisance to always be on the lookout during commits.
I discovered this supposedly nifty feature in TortoiseHg called "Auto Exclude List" which is supposed to take a comma-separated list of files that you want to default to unchecked (on commits, reverts, shelves). This sounded like a perfect, non-hackish way to make my life simpler.
The problem is that I cannot get it to do anything. I use the filename (with/without path), glob:filename, quotes, final comma, etc - all with no luck. I find little information about this feature online (nothing that the TortoiseHg UI doesn't tell me already).
FYI: TortoiseHg (version 1.1) with Mercurial-1.6, Python-2.6.4, PyGTK-2.16.0, GTK-2.16.6
Any suggestions, or success with this feature?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这绝对是您想要的功能。我在颠覆中似乎永恒地努力解决同一问题的模板文件解决方案,所以我很高兴发现 TortoiseHg 中的排除功能。
这绝对对我有用。一件重要的事情是了解这会产生什么影响。如果排除的项目之一发生更改,它仍会显示在提交对话框中。唯一的区别是,与其他更改的文件不同,它不会在对话框中自动在其旁边显示复选标记。
从可用性的角度来看,这很好,因为您不必有意识地考虑避免令人讨厌的更改(我称之为“噪音”)。您只需正常提交,对这些文件的更改可能会累积,但它们不会进入提交,因此它们不会分散变更集中实际工作的注意力。
这也意味着您可以推送到其他存储库,而不必成为“那个人”。但是,您仍然无法在工作副本中提取和更新未提交的更改,因此您必须定期提交或恢复这些文件。
您还必须留意对您实际确实想要提交的文件的更改。如果您习惯于恢复这些文件,那么当您不小心删除了其中一个文件上的辛苦工作时,您可能会猛然惊醒。
文件名的规范位于
[tortoisehg]
部分下的.hg\hgrc
文件中。 (更新):文件规范与存储库根相关,并且是明确的单个文件名,以逗号分隔。不允许通配符。我的看起来像这样:
对我来说就像一个魅力。
This is definitely the feature you want. I struggled with the template file solution to the same issue for what seemed like an eternity in subversion, so I was very happy to discover the exclusion feature in TortoiseHg.
It definitely works for me. One important thing is to understand what effect this has. If one of the excluded items is changed, it still shows up in the commit dialog. The only difference is that, unlike other changed files, it will not automatically have a check mark next to it in the dialog.
From a usability standpoint, this is nice because you don't have to consciously think about avoiding nuisance changes (which I call "noise"). You just commit as normal and the changes to those files may accumulate but they don't get into the commit so they don't distract from the real work in the changeset.
It also means you can push to other repositories without being "that guy". However, you still can't pull and update with uncommitted changes in your working copy, so you have to commit or revert those files periodically.
You also have to be on the lookout for changes to those files that you actually do want to commit. If you're in the habit of reverting those files, you may be in for a rude awakening when you accidentally erase your hard work on one of them.
The specification of the filenames goes in the
.hg\hgrc
file under the section[tortoisehg]
. (Update): The file specifications are relative to the repo root and are the explicit individual filenames, separated by commas. No globbing is allowed.Mine looks like this:
Works like a charm for me.
您是否尝试过将
.hgignore
文件与您的Mercurial 存储库?为此,请在 Mercurial 存储库的根目录中创建一个名为
.hgignore
的文件,并遵循上面链接中指定的语法。请注意,在开始忽略您指定的文件之前,您需要将此文件hg add
和hg commit
到您的存储库中。例如,如果您想要将所有 *.txt 和 *.o 文件排除在提交考虑之外,
.hgignore
文件的示例可能是:Have you tried using an
.hgignore
file with your Mercurial repository?To do this, create a file in root of your Mercurial repository called
.hgignore
and follow the syntax specified in the link above. Note you will need tohg add
andhg commit
this file into your repository before it begins ignoring the files you've specified.For instance, if you wanted to exclude all *.txt and *.o files from being considered for commits, an example of a
.hgignore
file might be: