previously, back(@, 1) == @. That feels very weird, so instead now back(@, 0) == @. Since as back(@, n) was used in the rangediff script, I also had to update that script to cope with this (it had the correct behavior already...)
We've had to do some interesting finagling to get this to happen, since as AFAICT there is no way to do maths in the revset language (so no way to add 1). Instead, we've done revision- to go back 1 already, so our argument operates on a revision already 1 in the past.
Of course, 0 isn't going to bring us forward again so we instead have to coalesce and return the current revision if we have no changes. Again the revset language gets in our way since as there isn't a way to tell if we have 0 as a quantity directly. Fortunately, for 0 we can make a set that is always guarenteed to have the whole repo as members if and only if our number was 0, and logically-and that with our current revision to conditionally return it.
We also replaced our heads call with ancestors(foo-) & ~ancestors(foo)
- normally equivalent, but better if we've reached the end of our
commits, for example if we do
fwd(5)when in reality we only have 2 more commits ontop of us. Previously that would return the last commit, now it returns nothing
Finally, we've added some aliases to fwd(n) which default to using @
since as that seems to be a very common case.