Versioning of external extensions?

Jason Harris jason at jasonfharris.com
Sun May 16 08:52:03 UTC 2010


Ahhh!!! Thanks!!!

Thats what I was looking for!

If I can push my luck, can I ask for the cases when it returns 1, is there a pattern I can use to where the results / warnings are sent to? Ie are the "unresolved files" warnings sent to stderr (instead of stdout)? Is the "nothing to do" message sent to stderr or stdout? Is there something that we GUI writers should do here...

I had switched to the following within MacHg (This is in objective-C so the bits [obj method:arg] syntax might seem strange if you have never seen it before...)

- (BOOL) hasErrors
{
    return ( result_ == 1 && IsNotEmpty(errStr_)) || result_ > 1 ||
             result_ < 0 || [errStr_ isMatchedByRegex:@"^(?i)abort" options:RKLMultiline];
}
- (BOOL) hasWarnings
{
    return IsNotEmpty(errStr_) && ![self hasErrors];
}
- (BOOL) hasNoErrors
{
    return ![self hasErrors];
}
- (BOOL) isClean
{
    return result_ == 0 && IsEmpty(errStr_);
}

Cheers,
  Jason

On May 16, 2010, at 3:57 AM, Matt Mackall wrote:

> On Thu, 2010-05-13 at 20:56 -0500, Matt Mackall wrote:
>> As I've said for years now, what's needed is for someone to audit the
>> return codes, document them, and fix the ones that don't make sense.
> 
> An initial pass at cleaning things up and documenting them is here:
> 
> http://www.selenic.com/hg/rev/6a64813276ed
> 
> For the most part, things work like this:
> 
> 0: success
> 1: nothing to do, unresolved files, no matches, non-fatal errors
> 255: abort or other exception
> 
> -- 
> Mathematics is the supreme nostalgia of our time.
> 
> 




More information about the Mercurial mailing list