pypy: fix setdiscovery test
This test relies on the exact details of random.sample given the
seed. Things work a bit differently under pypy, make the test less
specific.
chg: wrap line at 80 chars
This is a style fix. I was using tabstop=4 for some early patches, although
I realized we use tabstop=8 later but these early style issues remains. Let's
fix them.
chg: replace abortmsg showing errno with abortmsgerrno
Since we have abortmsgerrno now, use it to show human friendly error messages
across platforms.
chg: add util function abortmsgerrno to print error with errno
It's common to abortmsg with the errno information. Let's make a utility
function for it.
chg: use color in debug/error messages conditionally
Before this patch, chg always uses color in its debugmsg and abortmsg and
there is no way to turn it off.
This patch adds a global flag to control whether chg should use color or
not and only enables it when stderr is a tty and HGPLAIN is not set.
revset: force ascending order for baseset initialized from a set
It is possible to initialize a baseset directly from a set object. However, in
this case the iteration order was inherited from the set. Set have undefined
iteration order (especially cpython and pypy will have different one) so we
should not rely on it anywhere.
Therefor we declare the baseset "ascending" to enforce a consistent iteration
order. The sorting is done lazily by the baseset class and should have no
performance impact when it does not matter.
This makes test-revset.t pass with pypy.
revset: stabilize repr of baseset initialized with a set
Cpython and pypy have different way to build and order set, so the result of
list(myset) is different. We work around this by using the sorted version of the
data when displaying a list.
This get pypy closer to pass test-revset.t.
dispatch: factor out command failure handling into a function
Moving the warning generation to a function allows for wrapping and
alternative error handling.
pypy: fix overeager pattern matching on mpatchError
Pypy have difference in error reporting.
mpatch: unify mpatchError (
issue5182)
The pure version was mpatch was throwing struct.error or ValueError
for errors, whereas the C version was throwing an "mpatch.mpatchError".
Introducing an mpatch.mpatchError into pure and using it consistently
is fairly easy, but the actual form for it is mercurial.mpatch.mpatchError,
so with this commit, we change the C implementation to match the naming
convention too.