chrono028 / mercurialeclipse

Automatically exported from code.google.com/p/mercurialeclipse
Other
0 stars 0 forks source link

Hook ui.warn text not displayed anymore, big issue for us #33

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
>>What steps will reproduce the problem?

1. Write a mercurial pretxncommit hook
2. Give feedback using ui.warn()
3. Return 0 (false) to abort the commit

>>What is the expected output? What do you see instead?

I expect to see the ui.warn message. It's important...
Now the output is only "pretxncommit.procurial_codequality hook failed", and 
that's it.

>>What version of the product are you using? On what operating system?

OS=Win7, eclipse-3.6.0-cpp-helios-win32 

>>Please provide any additional information below.

In MercurialEclipse 1.8.1, it still worked correctly.
1.8.1 is causing very long (10 minutes+) "Checking version information" tasks. 
This is a lot better in 1.9.4. But we can't upgrade because of the before 
mentioned missing information.
We use plenty of hooks. It's hard to switch to command line or TortoiseHG all 
the time to see what's beneath the "pretxncommit.procurial_codequality hook 
failed" message.

Thanks for a great plugin, I hope this issue can be fixed.

Cheers, ff

Original issue reported on code.google.com by freakf...@gmail.com on 4 May 2012 at 3:43

GoogleCodeExporter commented 8 years ago
This is the regex that's used to get the concise error message: 
^(?:remote:\\s*)?(?:error|abort):\\s*(.+)

Would it be possible to craft the error so it matches this?

What output does ui.warn produce?

Original comment by johnpeb@gmail.com on 4 May 2012 at 3:56

GoogleCodeExporter commented 8 years ago
Hi John,

It can literally be any text.

Here's an example:

E:\work\eclipse\11.0A\amdir_gui>hg ci -I otashelve\tw\tw_testje.p -m -otashelve
[codeQok#fail] "for each" or "repeat" without throw ( codeQok#7105 ): 
'otashelve/tw/tw_testje.p' Line 3: for each ttTest:
"transaction" without throw ( codeQok#7108 ): 'otashelve/tw/tw_testje.p' Line 
6: do transaction:
transaction abort!
rollback completed
abort: pretxncommit.procurial_codequality hook failed

So, as you see, multiline as well.

We could ofcourse hack mercurial to put "error" in front of each line, but that 
seems a bit ugly.
Like I said, in MercurialEclipse 1.8.1 the ui.warn messages are displayed.

Thx, ff

Original comment by freakf...@gmail.com on 4 May 2012 at 5:00

GoogleCodeExporter commented 8 years ago
There are big usability problems putting the whole multiline message in there 
which is why it attempts to be smart with the regex. In most cases the only 
thing the user cares about is what's after the "abort".

Obviously in this case it's insufficient. Another workaround is to show the 
console view so you can see the message. Probably the long term solution is to 
add a button to show the full message. 

Original comment by johnpeb@gmail.com on 4 May 2012 at 9:11

GoogleCodeExporter commented 8 years ago
Hi John,

I don't see the big usability problems, but you know your product better than I 
do.

I'd prefer a setting in the preferences instead of an extra button ("Show all") 
that we'd have to click each time an error occurs. And/or maybe you could make 
the regexp itself customizable (we'd set it to '.*').

However, I wanted to upgrade MercurialEclipse because of "Calculating resource 
status" and "Checking version information" hangs. Especially on a few new 
developer workstations, these messages appear in the "Progress" view, and don't 
go away. 
I thought this behaviour would be better in 1.9.4, but sadly it is not.
That means we have no reason to upgrade right now (it would make things worse, 
as explained), and we'll stick at version 1.8.1.
The problem is that bad on one new pc, that I'm afraid I have to uninstall 
MercurialEclipse completely. He'd have to manage with TortoiseHG. Which I like 
far less; *if* MercurialEclipse works, it works good. Nicely integrated with 
Eclipse and Mylyn.

I've noticed you are moving hg rpc calls to JavaHG instead of directly through 
the command line. Does JavaHG also use the command line? Or does it use a more 
direct way, with an embedded mercurial and python/jython? 
I ask this because I think our "hangs" are related to the raw command-line 
rpc's that MercurialEclipse uses to talk with hg. It could even be related with 
our Kaspersy virus scanner (although I excluded all hg executables, 
eclipse.exe's, and hg repositories from being scanned already).

Thank you for your help, cheers ff

Original comment by freakf...@gmail.com on 5 May 2012 at 12:10

GoogleCodeExporter commented 8 years ago
I mean "Checking for required version" by the way. It's probably just a "hg -y 
version" command, so it's very weird that MercurialEclipse hangs on this 
statement.

One other thing:  ui.prompt() is not supported in MercurialEclipse. See: 
http://mercurial.selenic.com/wiki/WritingExtensions#communicating_with_the_user 
. We decided not to use ui.prompt for that reason. TortoiseHG does support it 
however.

Kind regards, ff

Original comment by freakf...@gmail.com on 5 May 2012 at 12:25

GoogleCodeExporter commented 8 years ago
JavaHg creates a single hg process per repository and communicates with it over 
the command server interface. Using JavaHg it would be conceivable to add 
generic ui.prompt support. Initially will only be supported for merge/rebase. I 
haven't checked but most likely ui.warn will be available directly.

Can you create a separate bug for the deadlock you are seeing? A thread stack 
dump would be useful.

Original comment by johnpeb@gmail.com on 5 May 2012 at 3:12

GoogleCodeExporter commented 8 years ago
Hi John, thanks for all your info. I'll log a seperate issue for the deadlock.

Original comment by freakf...@gmail.com on 5 May 2012 at 8:15