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

*爱你&永不变心* 提交于 2019-12-05 00:11:29

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.

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