ignore trailing slash in ignore patterns
Bug #4559 reported by
Martin Pool
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Unassigned |
Bug Description
From: Marius Kruger <email address hidden>
hi,
On linux when I do the following with tab completion
bzr ignore dist/
it adds a backslash on the end.
Is it possible to ignore trailing slashes?
it could be done something like
p='dist/'
p=p[
OR
when checking files to ignore
the matching should match dist/ to dist
regards
Marius Kruger
To post a comment you must log in.
The above snippet will always delete the last character, so it should at least be:
if name_pattern. endswith( os.sep) : rstrip( os.sep)
name_pattern = name_pattern.
But I'm not convinced this is the right approach, one may want to add os.sep for another platform where it isn't (perhaps far fetched). Would it have value to normalize patterns ending on os.sep to end on '/' and check in matching against such a pattern if we are dealing with a directory or not, or would that be too confusing?