Has anyone had success with TortoiseHg's “Auto Exclude List”?

依然范特西╮ 提交于 2019-12-22 03:50:51

问题


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?


回答1:


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:

[tortoisehg]
ciexclude = msi.sql,Service\AssemblyInfo.vb,SetupInitialize\AssemblyInfo.vb

Works like a charm for me.




回答2:


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 to hg add and hg 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:

syntax: glob
*.txt
*.o


来源:https://stackoverflow.com/questions/4259326/has-anyone-had-success-with-tortoisehgs-auto-exclude-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!