revset: make `hg log -r 'wdir()^'` work (
issue4905)
This patch catches the WdirUnsupported exception to support wdir()^.
revlog: raise WdirUnsupported when wdirrev is passed
revlog.parentrevs() is called while evaluating ^ operator in revsets. When wdir
is passed, it raises IndexError. This patch raises WdirUnsupported if wdir is
passed in the function. The error will be caugth in future patches.
error: add a new exception named WdirUnsupported
This series intents to support wdir() predicate with different operators
like ~, ^.
Currently the storage class don't support wdir(). This exception is introduced
so that it can be raised from places where wdir() is passed and is not
supported and we can catch this where we want to support the predicate.
Also throwing an error at low level and catching at some higher level is better
than using if-else especially for perf.
match: replace icasefsmatch() function by flag to regular match()
match() will soon gain more logic and we don't want to duplicate that
in icasefsmatch(), so merge the two functions instead and use a flag
to get case-insensitive behavior.
match: pass in normalize() function to matchers
This will let us delete icasefsmatcher.
match: don't print explicitly listed files with wrong case (BC)
On case-insensitive file systems, if file A exists and you try to
remove it (or add, etc.) by specifying a different case, you will see
something like this:
$ hg rm a
removing file A
I honestly found this surprising because it seems to me like it was
explicitly listed by the user. Still, there is a comment in the code
describing it, so it is very clearly intentional. The code was added
in
baa11dde8c0e (match: add a subclass for dirstate normalizing of the
matched patterns, 2015-04-12).
I'm going to do a lot of refactoring to matchers and the feature
mentioned above is going to get in my way. I'm therefore removing it
for the time being and we can hopefully add it back when I'm done.
match: move body of _normalize() to a static function
matcher._normalize() no longer depends on any of the matcher's state,
and making it static will enable further refactoring. Note that the
subdirmatcher subclass calls _normalize(), so we can't remove it
completely.