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 178944 - Mercurial asks for status of Java index files while Java projects are being scanned
Summary: Mercurial asks for status of Java index files while Java projects are being s...
Status: RESOLVED WONTFIX
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-12-21 12:48 UTC by Marian Petras
Modified: 2010-01-12 01:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Petras 2009-12-21 12:48:08 UTC
When NetBeans is started with an empty or non-existing user-directory and the user start working with anything Java-related, the Java module starts scanning the Java classpath soon. The scanning job comprises of creation of may files as the results of scanning/parsing are stored to cache (index) files in the user directory. Mercurial's interceptor intercepts each such a request for creation of an index file and asks the Mercurial cache about the cached Mercurial status of the file. Because the file's status is not known (as it has not been obtained before), a series of other routines is executed. This may be time-consuming but unneccessary.

One possible cause of the above behaviour is that MercurialInterceptor calls

    FileStatusCache.getCachedStatus(file),

which subsequently calls

    FileStatusCache.getCachedStatus(file, true),

i.e. the second parameter ("seenInUI") is always true. This effectively disables the advantage of enhancement #176031 ("initial hg status scan only for visible folders"). Is it correct?
Comment 1 Ondrej Vrabec 2009-12-22 02:37:03 UTC
The situation you're describing would only happen when those index files were under mercurial control (inside a mercurial repository) which i think the are not (scanning stores it's cache inside ~/.netbeans/...). Are you saying that the mercurial interceptor handles these files?

> the second parameter ("seenInUI") is always true
i'll try to explain the meaning of the parameter to you when i come back to work. In short: true means that Netbeans is aware of such file (either is displayed as a node in UI or an event is caught by the interceptor - which is probably the situation where you expect it to be "false"). I think mercurial interceptor and cache behave correctly. 
IMO the problem is that unversioned files (index cache) are handled in the interceptor. Are you sure they are not inside a hg repository?
Comment 2 Marian Petras 2009-12-22 06:40:23 UTC
If you make your own build and run "ant tryme" from directory <srcroot>/nbbuild, the user-dir is <srcroot>/testuserdir. Because <srcroot> is versioned, the user-dir is versioned, too.
Comment 3 Ondrej Vrabec 2010-01-12 01:25:44 UTC
Sorry, closing as wontfix, we can't exclude the userdir from mercurial control ourselves, it's user's responsibility.
You can either set the userdir manually (--userdir), or tell mercurial that you don't want to have the netbeans clone under version control - set property versioning.unversionedFolders: e.g. versioning.unversionedFolders=~/cdev