This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 134924 - Determining command result is wrong
Summary: Determining command result is wrong
Status: VERIFIED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 6.x
Hardware: All Windows Vista
: P3 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-13 09:33 UTC by novakm
Modified: 2008-07-10 15:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
main_work_76928_a635212bff43-commit-aborterror2.patch (1.09 KB, text/plain)
2008-05-14 14:56 UTC, John Rice
Details
proposed patch (971 bytes, patch)
2008-05-22 12:04 UTC, Padraig Obriain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description novakm 2008-05-13 09:33:04 UTC
Determining result of executed command is wrong or at least is not properly described in output tab. For example trying
to commit something from IDE results in :

Mercurial Commit
----------------
Added 4 stable functional tests
Committing 7 files to repository for Mercurial:
        D:\srcNB\6.1\main\mercurial\test\qa-functional\src\org\netbeans\test\mercurial\main\commit\CloneTest.java
        D:\srcNB\6.1\main\mercurial\test\qa-functional\src\org\netbeans\test\mercurial\main\commit\IgnoreTest.java
        D:\srcNB\6.1\main\mercurial\test\qa-functional\src\org\netbeans\test\mercurial\main\delete\DeleteTest.java
        D:\srcNB\6.1\main\mercurial\test\qa-functional\src\org\netbeans\test\mercurial\main\commit\InitializeTest.java
        D:\srcNB\6.1\main\mercurial\test\qa-functional\src\org\netbeans\test\mercurial\main\delete\DeleteUpdateTest.java
        D:\srcNB\6.1\main\mercurial\test\cfg-qa-functional.xml
        D:\srcNB\6.1\main\mercurial\test\qa-functional\src\org\netbeans\test\mercurial\utils\TestKit.java
INFO: End of Commit

BUT the status isn't changed. Checking it from console it is right in the IDE
D:\srcNB\6.1\main\mercurial>hg status .
M test\cfg-qa-functional.xml
M test\qa-functional\src\org\netbeans\test\mercurial\main\commit\IgnoreTest.java
M test\qa-functional\src\org\netbeans\test\mercurial\utils\TestKit.java
A test\qa-functional\src\org\netbeans\test\mercurial\main\commit\CloneTest.java
A test\qa-functional\src\org\netbeans\test\mercurial\main\commit\InitializeTest.java
A test\qa-functional\src\org\netbeans\test\mercurial\main\delete\DeleteUpdateTest.java
R test\qa-functional\src\org\netbeans\test\mercurial\main\delete\DeleteTest.java

Trying to commit from commandline results in:
D:\srcNB\6.1\main\mercurial>hg commit .
abort: precommit.username hook is invalid (import of "hgconf.uname" failed)

I would expect to detect it and notify the user via the output tab. Now it seems commit proceeded, but it did not.

Using Mercurial 1.0

Product Version: NetBeans IDE Dev (Build 080428)
Java: 1.5.0_15; Java HotSpot(TM) Client VM 1.5.0_15-b04
System: Windows Vista version 6.0 running on x86; Cp1252; en_GB (nb)
Comment 1 John Rice 2008-05-14 14:55:15 UTC
Now surface all abort errors for commit. We can't know what precommit messages to handle so we will just catch the abort
and report this to the user in a dialog and in the output window.

changeset:   80036:b8ae6684f269
tag:         tip
user:        jrice@netbeans.org
date:        Wed May 14 14:50:03 2008 +0100
summary:     #134924: commit failures not being reported in output, are now caught and surfaced to the user.

Comment 2 John Rice 2008-05-14 14:56:04 UTC
Created attachment 61384 [details]
main_work_76928_a635212bff43-commit-aborterror2.patch
Comment 3 John Rice 2008-05-14 15:12:26 UTC
Fixed in main
Comment 4 Quality Engineering 2008-05-15 04:43:41 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #196 build
Changeset: http://hg.netbeans.org/main/rev/b8ae6684f269
User: jrice@netbeans.org
Log: #134924: commit failures not being reported in output, are now caught and surfaced to the user.
Comment 5 novakm 2008-05-22 11:05:43 UTC
Reopening as I can 100% reproduce the issue on Windows Vista with mercurial 1.0

Output in IDE:
Mercurial Commit
----------------
4
Committing 1 file to repository for Mercurial:
       
D:\srcNB\6.1\2\main\mercurial\test\qa-functional\src\org\netbeans\test\mercurial\main\archeology\AnnotationsTest.java
INFO: End of Commit
(but nothing is comitted)

Output from console:
D:\srcNB\6.1\2\main\mercurial\src>hg commit -m d
No username found, using 'novakm@vista-ws' instead
Attempt to commit or push text file(s) using CRLF line endings
in 27ccd45c7d77: mercurial/test/qa-functional/src/org/netbeans/test/mercurial/main/archeology/AnnotationsTest.java
transaction abort!
rollback completed
abort: pretxncommit.crlf hook failed
Comment 6 Padraig Obriain 2008-05-22 11:57:44 UTC
John's change was expecting the first line to be abort message. In your case it is the last line.
Comment 7 Padraig Obriain 2008-05-22 12:04:40 UTC
Created attachment 61749 [details]
proposed patch
Comment 8 Padraig Obriain 2008-05-22 12:07:12 UTC
changeset:   81034:a4f561df673a
tag:         tip
user:        padraigob@netbeans.org
date:        Thu May 22 11:58:18 2008 +0100
summary:     134924: Check for abort message on last line of output from hg commit
Comment 9 novakm 2008-05-23 08:22:13 UTC
Err, it is little embarrassing, but I am unable to reproduce the abort on the first line. I don't know what I had in my
hgrc. Do you know by any chance what should be there to reproduce? :) 

For now I verified the second part with ABORT on the last line...
Comment 10 Padraig Obriain 2008-05-23 08:37:30 UTC
I am not sure that I have ever seen abort on the first line unless there is only one line in which case it is also the
last line.
Comment 11 novakm 2008-05-23 08:57:46 UTC
Well I had to do it somehow as it can be seen in the desc1. Probably I have wrong the name of the hook. To be honest I
don't even know where to look for available hooks for our repository... I tried to use
precommit.username = hgconf.uname and hgconf.uname.hook which were the only things I was able to google out, but then
the output is 

'hgconf.uname' is not recognized as an internal or external command,
operable program or batch file.
abort: precommit.username hook exited with status 1

(which is now reported correctly in IDE)
Comment 12 Peter Pis 2008-06-03 08:35:26 UTC
Verified. Couldn't find error message that wouldn't be handled correctly.
Comment 13 rbalada 2008-06-03 13:42:53 UTC
I've transplanted those two changesets into release61_fixes repository.

changeset:   77723:15c0b3855b62
user:        jrice@netbeans.org
date:        Wed May 14 14:50:03 2008 +0100
summary:     #134924: commit failures not being reported in output, are now caught and surfaced to the user.
http://hg.netbeans.org/release61_fixes/rev/15c0b3855b62

changeset:   77724:cf607695890d
user:        padraigob@netbeans.org
date:        Thu May 22 11:58:18 2008 +0100
summary:     134924: Check for abort message on last line of output from hg commit
http://hg.netbeans.org/release61_fixes/rev/cf607695890d
Comment 14 Peter Pis 2008-06-19 10:53:38 UTC
Verified with patch2.
Comment 15 Peter Pis 2008-06-19 10:56:31 UTC
Haven't encountered any error that wouldn't be caught. Verified with patch2.