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 123735 - .hgignore disappears from status view after refresh
Summary: .hgignore disappears from status view after refresh
Status: VERIFIED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 6.x
Hardware: All Windows 3.1/NT
: P3 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-10 09:58 UTC by novakm
Modified: 2008-02-14 08:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch - always display .hgignore in status if it's new or modified (2.68 KB, text/plain)
2007-12-11 22:58 UTC, John Rice
Details
proposed patch (1.24 KB, patch)
2008-02-07 11:49 UTC, Padraig Obriain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description novakm 2007-12-10 09:58:34 UTC
If you have some file with status Locally New and ignore it, then in Status Window .hgignore appears instead of that
file with status Locally New. But if you invoke Refresh Status, the .hgignore disappears from Status Window although it
is still present on the disk (with right content). Same situation repeats if you unignore that file - .hgignore appears
in Status Window, but disappears again after Refresh Status.

Mercurial client 0.9.5
Product Version: NetBeans IDE 6.0 (Build 200711261600)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-b05
System: Windows Vista version 6.0 running on x86; Cp1252; en_GB (nb)
Comment 1 John Rice 2007-12-10 20:43:58 UTC
Can see in:

HgUtils.isIgnored(File file)
   :
if (FILENAME_HGIGNORE.equals(name)) return false;  <-- true if we want .hgignore not displayed in Status Window

We should be returning true if we want .hgignore to be ignored and so not displayed in the Status Window. The problem is
what if we clone a project that has already got a .hgignore

Comment 2 novakm 2007-12-11 10:40:22 UTC
Well I am not sure how should it behave, but definitely not the way it is now. Either the .hgignore shouldn't be
displayed in status at all, or all the time. 
  I've checked how it behaves in CVS and it is displayed all the time, so it should be probably that way too. Another
thing is that it can cause some problems if you commit the .cvsignore and someone updates his project while having new
file with the same name as that one ignored. I guess it would be the same in mercurial... I'll try to test it.
Comment 3 John Rice 2007-12-11 22:58:14 UTC
Created attachment 54172 [details]
Proposed patch - always display .hgignore in status if it's new or modified
Comment 4 John Rice 2007-12-11 23:02:32 UTC
IDE:-------------------------------------------------
IDE: [11/12/07 23:01] Committing started
Checking in FileStatusCache.java;
/cvs/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/FileStatusCache.java,v  <--  FileStatusCache.java
new revision: 1.20; previous revision: 1.19
done
Checking in util/HgCommand.java;
/cvs/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java,v  <--  HgCommand.java
new revision: 1.63; previous revision: 1.62
done
IDE: [11/12/07 23:02] Committing finished
Comment 5 novakm 2008-01-03 14:40:19 UTC
Reopening as .hgignore does not appear after ignoring Locally New file. Not ever after invoking Refresh Status manually.
1) Create new project
2) Initialize hg repo
3) Commit
4) Create new file
5) Ignore it
result: No .hgignore after invoking Mercurial | Status even it is on the harddrive and has right content. 

hg plugin version 1.4.3.42.1 (at least that is number from plugin manager), probably from 3.1.2008

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 Vista version 6.0 running on x86; Cp1252; en_GB (nb)
Comment 6 Padraig Obriain 2008-02-07 11:34:44 UTC
It looks like http://hg.netbeans.org/main/rev/27ce658ce8ea caused the regression.
Comment 7 Padraig Obriain 2008-02-07 11:49:36 UTC
Created attachment 56227 [details]
proposed patch
Comment 8 Padraig Obriain 2008-02-07 11:51:21 UTC
changeset:   66277:e66c0a6995fc
tag:         tip
user:        padraigob@netbeans.org
date:        Thu Feb 07 11:46:32 2008 +0000
files:       mercurial/src/org/netbeans/modules/mercurial/util/HgUtils.java
description:
123735: Correct isIgnored for .hgignore
Comment 9 novakm 2008-02-14 08:54:13 UTC
Verified.
The only minor issue I see now is that lines in .hgignore are swapped. After ignoring and unignoring the file, the
.hgignore is modified although the meaning of the content is the same.

Before ignore:
\.orig$
\.orig\..*$
\.chg\..*$
\.rej$
after ignore and unignore:
\.chg\..*$
\.rej$
\.orig$
\.orig\..*$