Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
13.8k views
in Technique[技术] by (71.8m points)

mercurial - Has anyone had success with TortoiseHg's "Auto Exclude List"?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 .hghgrc 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,ServiceAssemblyInfo.vb,SetupInitializeAssemblyInfo.vb

Works like a charm for me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...