Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 123734 - Annotations in views are not shown.
Annotations in views are not shown.
Product: versioncontrol
Classification: Unclassified
Component: Mercurial
All Windows XP
: P3 (vote)
: 6.x
Assigned To: issues@versioncontrol
Depends on:
  Show dependency treegraph
Reported: 2007-12-10 09:57 UTC by Peter Pis
Modified: 2008-01-18 09:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT

proposed patch (1.01 KB, patch)
2007-12-31 12:42 UTC, Padraig Obriain
Details | Diff
updated patch (1.63 KB, patch)
2008-01-08 15:30 UTC, Padraig Obriain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Pis 2007-12-10 09:57:30 UTC
Product Version: NetBeans IDE 6.0 (Build 200711261600)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
Userdir: D:\ide\60daily\user3

1. Open project under hg control.
2. Go to "Tools | Options | Miscellaneous | Versioning | Mercurial". Add "Revision" variable to Mercurial Status Labels.
3. Switch "View | Show Versioning Labels" option on.

Labels are shown only if there is modification for a file, but in case of CVS or SVN the statuses are shown always -
revision should be shown at least.
Comment 1 John Rice 2007-12-10 12:31:22 UTC
Its expensive for us to show the revision, we need to make a hg call when we are annotating the node. There is no local
cache of revision info as you have with SVN and CVS. Will look into it.
Comment 2 John Rice 2007-12-13 14:28:24 UTC
Looking at the code I'm reluctant to change this behavior because if the user has chosen to show revision information
every file would result in a hg call to fetch the revision data and this would be an unacceptable performance hit.

So closing bug.
Comment 3 Peter Pis 2007-12-13 15:27:16 UTC
John, I don't find it correct to close this issue. IMHO, many users will request this. So I am reopening the issue.
Can't you cache this kind of information? According to demand and survey made for CVS and Subversion, displaying
Revision is very important.
Comment 4 John Rice 2007-12-13 16:47:38 UTC
OK - if this is an important feature then we need to handle it. 

The problem is how to get the revision information efficiently without having to do the hg call everytime  for each file
that can cost 0.5 sec or more.

If we need to build in our own revision cache then we will have to go back and look at things again. I suspect the best
way will be to pick it up at the time status is being computed and cache it with the status file information. We'll need
to look into it and see what we can do.
Comment 5 Padraig Obriain 2007-12-31 12:42:47 UTC
Created attachment 54578 [details]
proposed patch
Comment 6 Padraig Obriain 2007-12-31 13:00:29 UTC
This behavior looks like an unintended consequence of the change for issue 121354.

The attached patch causes the version number to be displayed.

It does not address the performance issue. Each version number requires a call to hg log -l 1.
Comment 7 Padraig Obriain 2008-01-02 11:46:03 UTC
Currently we get the revision number for a file by calling HgCommand.getLastRevision. This is done in the AWT thread but
should probably be done in a background thread. This would mean that we would need to call annotateName again to get the
revision number displayed.

Subversion does not cache the revision information but seems to be able to obtain it relatively inexpensively.

One of the problems with caching is that we do not cache information for up-=to-date files.

Comment 8 John Rice 2008-01-02 13:32:06 UTC
We probably need to cache the revision info in the FileStatus object added to the FileInformation object when we are
doing a Status query against a file or directory, if the user wants to get revision labels. If the Status changes we
should pick up the change, if the cache information is not available from the File Status object in the Format call in
annotate then we can just fetch it.

Comment 9 Padraig Obriain 2008-01-08 15:30:49 UTC
Created attachment 54820 [details]
updated patch
Comment 10 Padraig Obriain 2008-01-08 15:41:58 UTC
IDE: [1/8/08 3:32 PM] Committing "" started
Checking in;
/shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/,v  <--
new revision: 1.18; previous revision: 1.17
IDE: [1/8/08 3:32 PM] Committing "" finished
IDE: [1/8/08 3:32 PM] Diffing finished
Comment 11 Peter Pis 2008-01-18 09:05:17 UTC
Verified. Anyway, if {revision} variable is removed from annotations, does it still cause performance issue?
Comment 12 John Rice 2008-01-18 09:19:46 UTC
If you do not have the version label selected in the Mercurial Options then there is no performance penalty (by default
it's not shown).

I've looked into this and there maybe a way for us to cache the revision information and reduce the performance hit.
We'll try it out next week. If we do resolve it then we'll remove the warning dialog.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo