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.
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 Steps: 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.
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.
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.
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.
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.
Created attachment 54578 [details] proposed patch
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.
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.
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.
Created attachment 54820 [details] updated patch
IDE:------------------------------------------------- IDE: [1/8/08 3:32 PM] Committing "MercurialAnnotator.java" started Checking in MercurialAnnotator.java; /shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/MercurialAnnotator.java,v <-- MercurialAnnotator.java new revision: 1.18; previous revision: 1.17 done IDE: [1/8/08 3:32 PM] Committing "MercurialAnnotator.java" finished IDE: [1/8/08 3:32 PM] Diffing finished
Verified. Anyway, if {revision} variable is removed from annotations, does it still cause performance issue?
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.