cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 123787 - Annotate fails
: Annotate fails
Status: RESOLVED FIXED
: versioncontrol
Mercurial
: 6.1
: All All
: P3 (vote)
: 6.1
Assigned To:
:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2007-12-11 00:08 by
Modified: 2008-01-03 09:40 (History)
Issue Type: DEFECT
:


Attachments
Log file (84.46 KB, text/plain)
2007-12-11 00:08, Jesse Glick
Details
Proposed patch (1.26 KB, text/plain)
2007-12-11 21:25, John Rice
Details
Improved patch - clearer if we want to go multiline at some stage (4.72 KB, text/plain)
2007-12-11 21:46, John Rice
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-12-11 00:08:24
After creating a small Hg repo using hg convert, I opened a file in the NB
editor and tried to get annotations. Numerous
exceptions were thrown. 'hg ann' on the command line works fine.
------- Comment #1 From 2007-12-11 00:08:51 -------
Created an attachment (id=54122) [details]
Log file
------- Comment #2 From 2007-12-11 00:10:47 -------
Trying to get history also throws an NPE:

SEVERE [org.openide.util.RequestProcessor]
java.lang.NullPointerException
    at
org.netbeans.modules.mercurial.ui.log.LogAction$1.perform(LogAction.java:152)
    at
org.netbeans.modules.mercurial.HgProgressSupport.performIntern(HgProgressSupport.java:96)
    at
org.netbeans.modules.mercurial.HgProgressSupport.run(HgProgressSupport.java:89)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
------- Comment #3 From 2007-12-11 14:01:13 -------
J - can you give me details of version of Hg you are running, version of
Mercurial plugin (are you running from Head)
and version of Linux. I see 2.6.22 kernel, but what are the details, Ubuntu ??
------- Comment #4 From 2007-12-11 14:17:41 -------
J - what is hg convert??
Could you post the converted project you are opening, so I can try and repo it
here. Is this a NetBeans porject or
something else? I am running on Ubuntu Feisty, hg 0.9.3, latest plugin from
Head and the plugin is working, though I do
see an exception raised on initialization that can be ignored, but needs to be
fixed.
------- Comment #5 From 2007-12-11 14:41:53 -------
Sussed out the Exception on hg init. It's an extension problem with the version
of hg I'm using. See same output from
command line. Just needed to comment out the in /etc/mercurial/hgrc.d/hgrc the
refs to hgext/hgk and hgext/hbisect to
stop hg init outputing errors.

Still don't know what's going on with your project though.
------- Comment #6 From 2007-12-11 17:12:55 -------
J - another data point from NB QE:
Mercurial plugin 1.4.2 tested on Fedora Core 3, hg 0.9.3 and haven't
encountered issue:
Initialize, Show Annotations, Commit, Rollback, Push ... everything works
------- Comment #7 From 2007-12-11 19:37:59 -------
Hg 0.9.5, the current release (please always test with this!); and the latest
available Hg plugin from dev AU, which you
can also see in my log file. Ubuntu, though it probably doesn't matter.

'hg convert' is the bundled extension which converts some other SCM's data to
Hg format; in this case, a small CVS test
repo. I'm not about to attach the test repo since it's some 9+ megs; was just
created by translating ant.netbeans.org
CVS content to Hg, and I opened BridgeImpl.java from that. Easily reproduced
today as well.

From looking at the code in question (toHgLogMessages), it is clear that it is
wrong; multiline commit messages break
it. {desc} should be {desc|firstline} in HgCommand.HG_LOG_TEMPLATE_CMD, at
least if you want to reliably parse the
result. (Or you could use |tabindent if you really wanted to get multiline
commit messages, at the expense of a slightly
more complicated parser.)
------- Comment #8 From 2007-12-11 21:20:39 -------
Thanks - I test with 0.9.5 on Windows and OpenSolaris. On linux I just grabbed
a box that had Ubuntu Feisty on it so
grabbed the 0.9.3 rpm for that from Mercurial.

Checked out the error as you pointed out and see the failure in the
toHgLogMessages() on the multiline commit. Simplest
fix is as you say just add in the (date|firstline), if Padraig is keen to
support multiline annotation I'll let him
change it when he's back in, but think for annotation, single line commit
message is not just simpler, it makes more sense.
------- Comment #9 From 2007-12-11 21:25:35 -------
Created an attachment (id=54166) [details]
Proposed patch
------- Comment #10 From 2007-12-11 21:46:40 -------
Created an attachment (id=54169) [details]
Improved patch - clearer if we want to go multiline at some stage
------- Comment #11 From 2007-12-11 21:50:51 -------
Committed to Head:

IDE:-------------------------------------------------
IDE: [11/12/07 21:48] Committing started
Checking in ui/annotate/AnnotateAction.java;
/cvs/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/annotate/AnnotateAction.java,v
 <--  AnnotateAction.java
new revision: 1.7; previous revision: 1.6
done
Checking in util/HgCommand.java;
/cvs/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java,v
 <--  HgCommand.java
new revision: 1.60; previous revision: 1.59
done
IDE: [11/12/07 21:49] Committing finished
------- Comment #12 From 2007-12-11 22:45:57 -------
Thanks, patch looks right to me.