Comment 2 for bug 383245

Revision history for this message
Gioele Barabucci (gioele) wrote :

I doubt other VCS systems have a similar feature.

Syntax-wide, I'd exploit the fact that filenames with spaces have to be enclosed in quotes. This allow additional stuff to be added at the end of the line.

For example this line in .bzrignore

  "RE:(.*)\.png" if "RE:(\1)\.svg"

could mean ignore all the filenames matching "RE:(.*)\.png" if there is a versioned file matching "RE:\1\.svg" where \1 is a back-reference to the first group in the previous regexp.

This allow even more complex patterns. The following

  "RE:(.*)/old-(.*).[0-9]+" if "RE:(\1)/(\2).txt"

could ignore ~/Documents/old-review.1 and ~/Documents/old-review.2 if ~/Documents/review.txt exists and is versioned.

The inverse (and maybe more logical) syntax could also be used, moving the back-references to the path to be ignored.

  "RE:(\1)\.png" if "RE:(.*)\.svg"