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 231516 - Incorrect display of ignored files (.hgignore)
Summary: Incorrect display of ignored files (.hgignore)
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.3.1
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-19 11:47 UTC by _ wadechandler
Modified: 2014-03-26 17:06 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log, .hgignore file, screenshot of the projects view and a test case project (125.42 KB, application/x-gzip)
2013-09-26 17:26 UTC, AE56
Details
screenshot (33.81 KB, image/png)
2013-09-27 08:20 UTC, Ondrej Vrabec
Details
Messages log netbeans-dev-201310070001 (35.96 KB, text/x-log)
2013-10-09 19:15 UTC, AE56
Details
Messages.log netbeans-dev-201310110001 (39.78 KB, text/x-log)
2013-10-16 15:17 UTC, AE56
Details
Messages.log netbeans-dev-201310110001 (39.93 KB, text/x-log)
2013-10-16 15:50 UTC, AE56
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ wadechandler 2013-06-19 11:47:57 UTC
Much of a projects files can be incorrectly shown as ignored in the IDE. The same files are operated on correctly by hg. Will put together an example project for replication purposes and study further, but have a few projects with the same issue occurring in them, and they have different .hgignore files.
Comment 1 Ondrej Vrabec 2013-06-20 08:59:50 UTC
missing: messages.log, .hgignore file, screenshot of the projects view and a test case project
Comment 2 AE56 2013-09-26 17:26:16 UTC
Created attachment 140516 [details]
messages.log, .hgignore file, screenshot of the projects view and a test case project
Comment 3 Ondrej Vrabec 2013-09-27 08:20:23 UTC
Cannot reproduce, see the attached screenshot.
What version of mercurial are you using?
Is it always reproducible?
Comment 4 Ondrej Vrabec 2013-09-27 08:20:29 UTC
Created attachment 140535 [details]
screenshot
Comment 5 Ondrej Vrabec 2013-09-27 08:43:54 UTC
at least adding logging that could reveal why the files are marked as ignored. Download a dev build [1] when the commit gets integrated (you'll be notified in this issue), install and run with -J-Dorg.netbeans.moles.mercurial.util.HgUtils.level=FINE. Then when the files are marked as ignored, shutdown and attach the messages.log again... thanks
http://hg.netbeans.org/core-main/rev/ad2c6251c48d
Comment 6 Quality Engineering 2013-09-28 04:36:51 UTC
Integrated into 'main-silver', will be available in build *201309280002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ad2c6251c48d
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: Task #231516 - Incorrect display of ignored files (.hgignore)
logging added
Comment 7 AE56 2013-10-08 22:07:22 UTC
I wasn't able to reproduce in the 7.4 nightly.
Comment 8 AE56 2013-10-09 19:15:23 UTC
Created attachment 140962 [details]
Messages log netbeans-dev-201310070001

Nope, still there.  No FINE messages appear in the messages.log.  What else causes the 'ignored' behavior?
Comment 9 AE56 2013-10-11 15:21:41 UTC
If I delete and re-create the project files using 'new project from existing sources', with the dev version, the files do not get marked as 'ignored' in the new project.
Comment 10 AE56 2013-10-11 16:09:12 UTC
Sorry, but I closed and re-opened netbeans dev, and the files showed ignored again, so re-building the project didn't actually change the behavior.

So, yes this is reproducible.  Mercurial is version 2.7.2. Python is 2.6.6.
Comment 11 Ondrej Vrabec 2013-10-15 10:57:51 UTC
sorry, i misspelled the switch, it should be -J-Dorg.netbeans.modules.mercurial.util.HgUtils.level=FINE, not -J-Dorg.netbeans.moles.mercurial.util.HgUtils.level=FINE. Please try again with the correct switch
Comment 12 AE56 2013-10-16 15:17:35 UTC
Created attachment 141162 [details]
Messages.log netbeans-dev-201310110001

FINE messages do appear in this log.
Comment 13 Ondrej Vrabec 2013-10-16 15:30:54 UTC
this looks really suspicious:
> FINE [org.netbeans.modules.mercurial.util.HgUtils]: File /home/aevers/testing:::testing ignored because of pattern ^.*$|.*/.*$
as if you had .hg folder in /home/aevers and its .hgignore contained an ignore pattern ignoring all your files. Is there such a folder? WHY? And if there is can you attach the .hgignore file?
Comment 14 AE56 2013-10-16 15:50:50 UTC
Created attachment 141169 [details]
Messages.log netbeans-dev-201310110001

Closed netbeans
Deleted ~/.hg
Deleted ~/.cache/netbeans
Deleted the nbproject/private directories
Re-open netbeans, log still shows lib project is ignored due to shareablity(2).
Comment 15 AE56 2013-10-16 16:16:43 UTC
Yes I have a ~/.hg.  Why is netbeans is looking at ~/.hgignore? That's likely another bug.  It should only ever use $(hg root)/.hgignore.  Is there some other cache I need to clear to make sure that isn't still interfering?

What causes a project to be marked shareable?  I suspect this bug has to do with shareability, not .hgignore at all. 

Why are unshareable files marked as ignored?

I suspect the project is unshareable because I didn't use netbeans' mercurial-fetch command, which I expect to fail for the sample project, since there is no hg-parent. If that's true, shareablity has exactly ZERO to do with whether the file is ignored.
Comment 16 AE56 2013-10-16 16:30:08 UTC
Also noted this behavior:

Close all projects, then close netbeans.
Open netbeans, open Hello and HelloLib.

Hello.h and Hello.cpp do not get marked ignored.

Leave projects open, then close and re-open netbeans.

Hello.h and Hello.cpp DO get marked ignored because of cached NOT_SHARABLE.
Comment 17 AE56 2013-10-16 16:40:50 UTC
(In reply to AE56 from comment #16)

> Hello.h and Hello.cpp DO get marked ignored because of cached NOT_SHARABLE.

Actually, the log shows that Hello.cpp is ignored because parent is ignored.  Mercurial only tracks files, not folders, so it doesn't even make sense that an entire project would be marked ignored:

> FINE [org.netbeans.modules.mercurial.util.HgUtils]: File /home/aevers/testing/Hello/libraries/HelloLib/Hello.cpp:::libraries/HelloLib/Hello.cpp ignored because of ignored parent /home/aevers/testing/Hello/libraries/HelloLib

What happens if Mercurial is tracking a file that would be ignored by .hgignore?  This is entirely possible.
Comment 18 Ondrej Vrabec 2013-10-16 20:23:51 UTC
(In reply to AE56 from comment #17)
> Actually, the log shows that Hello.cpp is ignored because parent is ignored.
> Mercurial only tracks files, not folders, so it doesn't even make sense that
> an entire project would be marked ignored:
Sure, why not, that's allowed. You can ignore a whole folder with an entry in .hgignore and then all files under the folder will be ignored.

> What happens if Mercurial is tracking a file that would be ignored by
> .hgignore?  This is entirely possible.
Then they would be marked ignored in the IDE until you try committing them. Otherwise the IDE would be too slow when working with large repositories (such as NetBeans sources for example)
Comment 19 Ondrej Vrabec 2013-10-16 20:31:00 UTC
> FINE [org.netbeans.modules.mercurial.util.HgUtils]: File /home/aevers/testing/Hello/libraries/HelloLib:::libraries/HelloLib ignored by sharability 2
> FINE [org.netbeans.modules.mercurial.util.HgUtils]: File /home/aevers/testing/Hello/libraries/HelloLib:::libraries/HelloLib ignored because of cached NOT_SHARABLE

SharabilityQuery returns NOT-SHARABLE for /home/aevers/testing/Hello/libraries/HelloLib. I have no idea why, probably because of some c++ projects dependencies. AFAIK sharability query is implemented in projects, so passing to cnd projects for evaluation. Why do you ignore the project's folder?
Comment 20 AE56 2013-10-16 20:55:37 UTC
(In reply to Ondrej Vrabec from comment #18)
> (In reply to AE56 from comment #17)
> > Actually, the log shows that Hello.cpp is ignored because parent is ignored.
> > Mercurial only tracks files, not folders, so it doesn't even make sense that
> > an entire project would be marked ignored:
> Sure, why not, that's allowed. You can ignore a whole folder with an entry
> in .hgignore and then all files under the folder will be ignored.

Yes, you can ignore all files in a path with an entry in .hgignore, but Mercurial only considers this as a filter applied to individual files. It is a semantic distinction, and perhaps not relevant here, but make the logging look odd.

> > What happens if Mercurial is tracking a file that would be ignored by
> > .hgignore?  This is entirely possible.
> Then they would be marked ignored in the IDE until you try committing them.
> Otherwise the IDE would be too slow when working with large repositories
> (such as NetBeans sources for example)

Once the file is committed, how does the IDE know that .hgignore rules no longer apply to this file?  Is it because you committed with the IDE's tools?  I didn't.  Does it know because subsequent `hg st` calls will reveal this file as being tracked?

(In reply to Ondrej Vrabec from comment #19)
> > FINE [org.netbeans.modules.mercurial.util.HgUtils]: File /home/aevers/testing/Hello/libraries/HelloLib:::libraries/HelloLib ignored by sharability 2
> > FINE [org.netbeans.modules.mercurial.util.HgUtils]: File /home/aevers/testing/Hello/libraries/HelloLib:::libraries/HelloLib ignored because of cached NOT_SHARABLE
> 
> SharabilityQuery returns NOT-SHARABLE for
> /home/aevers/testing/Hello/libraries/HelloLib. I have no idea why, probably
> because of some c++ projects dependencies. AFAIK sharability query is
> implemented in projects, so passing to cnd projects for evaluation. Why do
> you ignore the project's folder?

I am not.
Comment 21 Alexander Simon 2013-12-24 09:14:20 UTC
Work around:
- set Project Properties->Build->Make->Build Result.
Comment 22 Alexander Simon 2013-12-24 09:23:37 UTC
Ondrej, thank you for investigation.

Fixed, change set:
http://hg.netbeans.org/cnd-main/rev/8e8440d3629b
Comment 23 soldatov 2014-03-22 08:22:40 UTC
I don't see any regressions in latest test report [NetBeans IDE 7.4 (Build 20140320-3f80b6998498)]
Comment 24 Quality Engineering 2014-03-26 17:06:08 UTC
Integrated into 'releases/release74', will be available in build *201403261440* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/47968ec65ee4
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #231516 Incorrect display of ignored files (.hgignore)
(transplanted from 8e8440d3629b6c0e1a7a1425f118e295f0d8f862)