merging & hgignore

Scott Palmer swpalmer at
Thu Jun 30 10:17:07 CDT 2011

On 2011-06-30, at 9:47 AM, Mads Kiilerich wrote:

> On 06/30/2011 03:34 PM, watlab wrote:
>> Quite simple use case:
>> Branch A contains file1 and a .hgignore file, which contains "file2".
>> Branch B contains file1 and file2 (and no .hgignore).
>> Now I want to merge changes in file1 from B into A. But of course, I don't
>> want to get file2 added to Branch A.
>> How can this be achieved?
> You can "hg rm file2" before you commit the merge.
> (As you might know: .hgignore doesn't control which files are tracked by Mercurial. It only controls which untracked files will be reported by "hg status" and which files "hg add" without any file specifications will add.)
> /Mads

It might be nice to have an option to "hg rm" to get it to re-evaluate the existing tracked files with the rules in .hgignores

Or even something as simple as a command to print a list of the tracked files that would or wouldn't be matched by the .hgignore rules.  then you could generate a list of "hg rm" commands from it.


More information about the Mercurial mailing list