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 125939 - Versioning > Diff blocks EQ
Summary: Versioning > Diff blocks EQ
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords: PERFORMANCE, THREAD
: 126143 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-24 17:22 UTC by Jesse Glick
Modified: 2008-01-30 18:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Dump of EQ thread (4.02 KB, text/plain)
2008-01-24 17:23 UTC, Jesse Glick
Details
Log file lines mentioning mercurial (32.51 KB, text/plain)
2008-01-29 01:44 UTC, Jesse Glick
Details
proposed patch (3.69 KB, patch)
2008-01-30 09:12 UTC, Padraig Obriain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2008-01-24 17:22:54 UTC
080121. Running Diff on the NB repo blocks EQ, and for quite a long time at that.

Any Hg operation should be run asynchronously. I suggest that HgCommand.exec be fixed to throw an assertion error if
invoked on EQ, since it is never permissible to do so.
Comment 1 Jesse Glick 2008-01-24 17:23:21 UTC
Created attachment 55517 [details]
Dump of EQ thread
Comment 2 John Rice 2008-01-24 17:32:50 UTC
Is there a helper method we can use to detect if we are being called from within the main EQ?
Comment 3 Jesse Glick 2008-01-24 17:36:48 UTC
EventQueue.isEventDispatchThread()

Well I found one reason it is so excruciatingly slow compared to 'hg diff':

$ ps www `pgrep hg`
  PID TTY      STAT   TIME COMMAND
10311 ?        R      0:02 /usr/bin/python /home/jglick/bin/hg log -l 1 --repository /space/hgsrc/main
--template={rev}:{node|short}\n /space/hgsrc/main/nbbuild/netbeans/nb.cluster.ide.built

I have no idea what the purpose of this call is, but if you just run 'hg diff' it will tell you what modifications were
made, including file additions and deletions, using one command.
Comment 4 John Rice 2008-01-24 18:32:07 UTC
In MercurialAnnotator.formatAnnotation() if you have turned on VersionControl labels and are including {revision} you
will be making a call to get the last revision for each displayed file in the Project view. The call to getLatRevision()
results in the:

hg log -l 1  --repository <repo> --template="{rev}:{node|short}\n" <filename>

This is a serious performance hit. Its logged as bug #124895 "Revision number in Status labels and performance" and we
are looking into caching the information when the file is placed in the cache initially.

Comment 5 Jesse Glick 2008-01-24 23:48:18 UTC
I don't think I've "turned on VersionControl labels" (at least "Mercurial Status Labels" in Options is blank), and I do
not see any extra information in the Projects tab except (1) color on individual files, (2) a somewhat cryptic label "
[main]" following the project name. Anyway I'm not sure what display of file nodes in the Projects tab has to do with
the performance of a Diff operation.
Comment 6 John Rice 2008-01-25 08:45:31 UTC
Jessie - can you add to your etc/netbeans.conf:
netbeans_default_options="... -J-Dorg.netbeans.modules.mercurial.level=100 ..." to your 

run your diff command again and send us the var/log/messages.log file

Thanks.
Comment 7 Jesse Glick 2008-01-29 01:41:42 UTC
Using the XXX version of the mercurial module, I can again reproduce the problem. I just opened nbbuild, made an edit to
one file in it, then selected the project and invoked Diff. IDE froze with 100% CPU. (Well, actually 50% - I have dual
core.) Same EQ activity as before. Amusingly, when I ran ps www `pgrep hg`, I found

/usr/bin/python /home/jglick/bin/hg log -l 1 --repository /space/src/nb/main --template={rev}:{node|short}\n
/space/src/nb/main/nbbuild/netbeans/nb.cluster.ruby.built

which is amusing since this file does not actually exist:

$ ls nbbuild/netbeans/
extra  ide8  moduleCluster.properties  nb.cluster.platform.built  platform7

I'm tempted to make P1 since if you are unlucky enough to try to run Diff from the IDE you will probably need to killall
java.
Comment 8 Jesse Glick 2008-01-29 01:44:24 UTC
Created attachment 55686 [details]
Log file lines mentioning mercurial
Comment 9 Jesse Glick 2008-01-29 01:45:18 UTC
I meant to say: "Using the 030d8a2ae77b version of the mercurial module..."
Comment 10 Padraig Obriain 2008-01-30 08:22:00 UTC
We are attempting to display the changesetID in the Diff window.
I note that in the Subversion Diff window there is no reference to the version of the file.
I propose to not display the changesetID in the mercurial Diff window.
Comment 11 Padraig Obriain 2008-01-30 09:12:23 UTC
Created attachment 55736 [details]
proposed patch
Comment 12 Padraig Obriain 2008-01-30 09:13:30 UTC
bash-3.2$ hg out -v
comparing with http://hg.netbeans.org/main
searching for changes
changeset:   65116:a6fb30bb7ab5
tag:         tip
user:        padraigob@netbeans.org
date:        Wed Jan 30 08:59:11 2008 +0000
files:       mercurial/src/org/netbeans/modules/mercurial/ui/diff/Setup.java
description:
Issue 125939: Do not get  changeset ID for Diff.


Comment 13 Padraig Obriain 2008-01-30 11:03:05 UTC
*** Issue 126143 has been marked as a duplicate of this issue. ***
Comment 14 Jesse Glick 2008-01-30 18:15:07 UTC
You must set a target milestone when closing any issue as FIXED. Changeset ID should suffice for comment.