[PATCH][Bug 86451]Normalise path separators in ignore patterns

Kent Gibson warthog618 at gmail.com
Thu Mar 1 11:39:41 GMT 2007


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



Aaron Bentley wrote:
> It would be much better to fix the glob-to-regex conversion, and
> normalize those slashes.
>
>
OK, here is a patch that normalises the path separator in ignore
patterns, rather than just chopping trailing backslashes.

I had a go at making the normalisation part of the glob-to-regex
conversion proper, but that turned out to be impossible since the
Replacer only does a single match/replace pass over each pattern, and
you need to match backslashes twice - once for normalisation and once
for canonicalisation.  Rather than change the Replacer, I added
normalisation as a separate first pass.

There are also another couple of trivial fixed in there.
Firstly, cmd_ignore now checks for DOS style absolute paths as well as
Unix style, just to be consistent across platforms.

Secondly, globbing now checks for and removes trailing backslashes in
REs that can escape the bracket added when aggregating patterns.  That
is another corner case that can crash the pattern matcher, so I
thought it was worth fixing it while I was there.


Cheers,
Kent.

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

iD8DBQFF5rt8goxTFTi1P8QRAkiiAKDejeaSqhcfAZkUejZ3YDy6WspyMQCg9ZYd
pxm9pwpokYmZQk01tYN5fGI=
=oQmC
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lp86451.patch
Type: text/x-patch
Size: 6075 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070301/7ef5a3cb/attachment-0001.bin 


More information about the bazaar mailing list