On Fri, Aug 28, 2009 at 5:38 PM, Bastian Doetsch<[email protected]> wrote:
> Yeah, one could specifically do it, but I guess what
> kicks in is the generic error code handling - probably mercurial doesn't
> return 0 as error code, so we react to it.

Could be true in some circumstances, but not this time.  I believe the
exit status is up to the command, and in this case the command --
'log' -- finishes just fine, so hg exits with status 0.

It happens to have printed

  *** failed to import extension crecord from
/home/gward/.hgext/crecord: unsupported locale setting

to stderr before calling log, but that should IMHO be treated as a warning.

Another example: if you bounce back and forth between different
Mercurial versions, your .hgrc file can reference extensions that
appear and disappear.  Say you have configured

  [extensions]
  rebase =
  alias =

If you use that with hg 1.2, all is well.  With 1.3, you get an error
because 'alias' is no longer an extension.  With 1.0, you get an error
because 'rebase' did not exist back then. None of those errors affect
core functionality of MercurialEclipse, but I think they would render
it non-functional.

> Error codes is a problem in Mercurial
> because it's not documented and there are no real standards apart from 0
> = success.

Very true, unfortunately.

>> I notice that you have some interfaces to mq, rebase, transplant, and
>> a few others.  So you might have to apply a little extra intelligence
>> when reading that "failed to import" line.  That means you'd need a
>> list of extensions that have to work: e.g. mq, rebase, transplant.
>> But if any other extension fails to load... ignore it.
>
> See above, unfortunately it's not that easy...

It shouldn't be *that* hard:

  if (line matches /^\*\* failed to import extension (\w+): .*/) {
    if ($1 in ('mq', 'rebase', 'transplant')) {
      throw HgException(...)
    }
  }

If you tell me where in the code that logic needs to go, I'll try to add it.

Oh hey: that's not necessary.  If we fail to load mq when running
(say) qpush, then hg will fail anyways: no such command.  So I really
think all that's necessary is

  for line in child stdout {
    if (line matches /^\*\* failed to import extension (\w+): .*/) {
      continue;
    }
    // carry on...
  }

>> Great!  How do I open the MercurialEclipse console?  I looked in
>> Window->Open Perspective, Window->Show View->Other->{Mercurial,Team}
>> and found nothing.  I didn't see anything under the project "Team"
>> Menu either.
>
> Show View->Console. In Console view you can add consoles from all
> plugins that provide consoles.

Not quite.  First, in my version of Eclipse (3.4.2 on Linux), I had to
use Window->Show View->Other->General->Console.  That opened a Console
tab saying "No consoles to display at this time."  Then I had to dig
into Window->Preferences->Team->Mercurial->Console and turn on "Show
console on message".

But now it works -- thanks!  It would be even more useful if it showed
environment variables set for each command.  Hmmmm.

Thanks --

Greg

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MercurialEclipse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/mercurialeclipse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to