Inconsistency with directories in "bzr status" vs .bzrignore

Erik Bågfors zindar at gmail.com
Wed Apr 27 02:20:12 BST 2005


On 4/26/05, Martin Pool <mbp at sourcefrog.net> wrote:
> On Tue, 2005-04-26 at 16:00 +1000, Rusty Russell wrote:
> > In status, bzr gives a / on the end of directories, but you must not use
> > that in the .bzrignore file.  Is this a feature?
> 
> It's a feature that it is shown in the status list, and a bug that it
> does not match in the ignore file.
>

The following patch makes "tmp/" match a directory only and "tmp"
match either a directory or a file. Don't know if that's the way you
want it, but it is the way I expect it to work.

*** modified file 'bzrlib/tree.py'
--- bzrlib/tree.py
+++ bzrlib/tree.py
@@ -333,6 +333,8 @@
                     newpat = pat[2:]
                 else:
                     newpat = pat
+               if (pat[-1:] == "/") and isdir(filename) and
fnmatch.fnmatchcase(filename, newpat[:-1]):
+                   return pat
                 if fnmatch.fnmatchcase(filename, newpat):
                     return pat
             else:

/Erik




More information about the bazaar mailing list