merging & hgignore

Matt Mackall mpm at
Thu Jun 30 11:33:00 CDT 2011

On Thu, 2011-06-30 at 11:17 -0400, Scott Palmer wrote:
> 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.

In 1.9, to be released tomorrow:

hg locate 'set:hgignore()'
hg rm 'set:hgignore()'

Mathematics is the supreme nostalgia of our time.

More information about the Mercurial mailing list