how to ignore subdirectory

Alexis S. L. Carvalho alexis at cecm.usp.br
Thu Jul 19 07:14:42 CDT 2007


Thus spake Hiroshi SAKURAI:
> Hi,
> 
> I'm using mercurial 0.9.3 on NetBSD-4.
> 
> I have two directories,
>    ~/pkgsrc/
>    ~/pkgsrc-local-patch/
> and I want to ignore only files in pkgsrc/ directory.
> 
> I added those lines to .hgignore.
>    syntax: regexp
>    ^pkgsrc/
> 
> I expect hg to ignore only pkgsrc/ but hg ignores
> pkgsrc-local-patch/ too.
> It seems that trailing slash is removed and
> "^pkgsrc/" is treated as "^pkgsrc"
> 
> Trailing slash is removed in canonpath() in util.py:
> 
>    # name is "/home/sakurai/relre:^pkgsrc/" here
>    os.path.normpath(name)
>    # name is changed to "/home/sakurai/relre:^pkgsrc"
> 
> Is this behavior intentional or a bug?

Bug, fixed in 0.9.4 (canonpath is not called for "syntax: regexp"
patterns).

Alexis


More information about the Mercurial mailing list