1

Hi,

Our repository contains some sample C# projects in folders with names like:

Samples/TiffWithColorMap/C#/

When we build these sample projects a lot of additional files are created in folders like:

Samples/TiffWithColorMap/C#/bin/
Samples/TiffWithColorMap/C#/obj/

Obviously, we do not want these additional files in our repository and want to ignore them.

But it seems like Mercurial contains a bug: although we can add paths with # char into ignore list, the commit window still shows files that should be already ignored.

Any hint what can we do in such situation except renaming of folders?

UPDATE: Contents of our .hgignore file

glob:AssemblyVersion.cs
glob:Build
glob:*.suo
glob:LibTiff.Silverlight/Bin/*
glob:*.user
glob:LibTiff.Silverlight/obj/*
glob:LibTiff/bin/*
glob:LibTiff/obj/*
glob:SilverlightTest/SilverlightTestApplication.Web/ClientBin/TestTiffs/*.TIF
glob:SilverlightTest/SilverlightTestApplication.Web/ClientBin/TestTiffs/*.tif
glob:SilverlightTest/SilverlightTestApplication.Web/ClientBin/*.xap
glob:SilverlightTest/SilverlightTestApplication/Bin/*
glob:SilverlightTest/SilverlightTestApplication/obj/*
glob:TestCase/Output.Pdf/*.pdf
glob:TestCase/Output.Tiff/*.tif
glob:Tiff2Pdf/bin/*
glob:Tiff2Pdf/obj/*
glob:Tiff2Rgba/bin/*
glob:Tiff2Rgba/obj/*
glob:TiffCP/bin/*
glob:TiffCP/obj/*
glob:UnitTests/bin/*
glob:UnitTests/obj/*
glob:Build/*.zip
glob:SampleBrowser/BitMiracle.LibTiff.NET.dll
glob:SampleBrowser/BitMiracle.LibTiff.NET.xml
glob:SampleBrowser/TiffCP.exe
glob:SampleBrowser/bin/*
glob:SampleBrowser/obj/*
glob:SampleBrowser/samples.zip
glob:Samples/*/VB.NET/bin/*
glob:Samples/*/VB.NET/obj/*
glob:Samples/*/C#/bin/*
glob:Samples/*/C#/obj/*
glob:Samples/BitMiracle.LibTiff.NET.dll
glob:Samples/BitMiracle.LibTiff.NET.xml
glob:Samples/TiffCP.exe
glob:Samples/*/bin/*
flag
1 
See my updated answer -- I found a fix. – Kevin Gessner Jan 5 2011 at 16:21

1 Answer

1

Hello Sergius,

I just reproduced your problem. When using the glob: syntax in hgignore, you'll need to escape the # characters as \#. For instance, instead of glob:Samples/*/C#/bin/*, use

glob:Samples/*/C\#/bin/*
                ^--- escape with a \

Then Mercurial will correctly ignore the files.

Also, a tip: Rather than starting every line with glob:, you can set the default syntax of the whole file by typing syntax:glob on the first line. This special sequence tell Mercurial to use glob syntax unless you specify another one. There are more details in the Mercurial docs.

link|flag
Kevin, all files are untracked (they show up as ?) – Bobrovsky Jan 5 2011 at 16:11
I've updated questions with contents of our .hgignore file. – Bobrovsky Jan 5 2011 at 16:12
Kevin, thank you! Your solution for our problem worked as a charm. And also thanks for syntax:glob tip. – Bobrovsky Jan 5 2011 at 16:32
You're welcome. Glad to help. – Kevin Gessner Jan 5 2011 at 16:53

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.