Best way to check if a file matches an ignore pattern

Nicholas Allen nick.allen at onlinehome.de
Sun Sep 7 13:34:45 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I want to add a feature to my Eclipse plugin so that when you add create
a new file in Eclipse that is inside a Bazaar branch and that file does
not match an ignore pattern then it will automatically be added to
Bazaar (this will be a preference option).

How can I check if a file matches an ignore pattern? I could parse the
.bzrignore files myself and reimplement Bazaar's logic in Java but would
rather not do that (also if bzr implements this differently I will have
to change my code).

I could also use bzr ls --ignored and see if the file is listed in the
output but I'm wondering if there is a better way?

What I would like is a "should-be-ignored" command that returns an exit
code that indicates this....

Nick
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIw8pl1+i51gqqEGkRAm8vAJ4lQBVIg1Yat//Y9VgGTtV51y1R4wCff8bM
oP/FcQ8uyJdZz99WIV/E9K0=
=P/Fi
-----END PGP SIGNATURE-----



More information about the bazaar mailing list