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 215899 - renaming files under SVN control confuses the editor's "diff" function
Summary: renaming files under SVN control confuses the editor's "diff" function
Status: VERIFIED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Subversion (show other bugs)
Version: 7.2
Hardware: Macintosh (x86) Mac OS X
: P2 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-24 19:50 UTC by athompson
Modified: 2012-09-10 13:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
file is committed to SVN and not modified, but all lines are marked as inserted (green stripe) (272.93 KB, image/png)
2012-07-24 19:50 UTC, athompson
Details
a couple of interesting ISEs (132.56 KB, application/octet-stream)
2012-07-27 15:48 UTC, athompson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2012-07-24 19:50:51 UTC
Created attachment 122316 [details]
file is committed to SVN and not modified, but all lines are marked as inserted (green stripe)

Product Version: NetBeans IDE Dev (Build 201207201342)
Java: 1.6.0_33; Java HotSpot(TM) 64-Bit Server VM 20.8-b03-424
System: Mac OS X version 10.8 running on x86_64; MacRoman; en_US (nb)
User directory: /Users/alvin/Library/Application Support/NetBeans/dev
Cache directory: /Users/alvin/Library/Caches/NetBeans/dev

SVN version: 1.6.18 / NB is configured to use SVNkit


1. Add a file to a folder controlled by SVN and commit it.
2! Rename the added file in NB and commit the folder.  The "diff" stripe in the editor will show all lines in the file as added (green stripe).  AFAICT there's no way to fix it.
Comment 1 Ondrej Vrabec 2012-07-26 17:35:10 UTC
It doesn't fix itself if you close and reopen the file? Could you attach the messages log right after you open the file and the sidebar is painted green?
Comment 2 Ondrej Vrabec 2012-07-27 07:03:09 UTC
cannot reproduce:
1) switch to svnkit
2) checkout a project in svn 1.6 format
3) rename a NewClass.java to NewClass2.java
4) the diff sidebar for a while turns green but immediately goes back to normal
5) commit the file
=> everythink works fine. Even if it didn't, reopening the file should help

Is it reproducible? Attach the log anyway.
Comment 3 athompson 2012-07-27 15:30:51 UTC
I can't reproduce it every time, but over the last few months it's happened three or four times.  Perhaps it's a race condition of some type?  I should also add that the file was open in the editor every time it happened.  The last one was an SQL file, but I can't remember what the previous ones were.  Unfortunately, my fix was to delete my user directory and start from scratch, so I don't have the logs.  If it happens again I'll add them.

It may be a coincidence, but it's always happened on OSX.  It's also happened with two computers (both MacBook Pros running Mountain Lion).  One has an SSD and one has a spinny platter if that helps.
Comment 4 athompson 2012-07-27 15:46:53 UTC
Actually, I can recreate it here.  The stripe comes back only after you actually commit the folder.  I'll attach the log file.
Comment 5 athompson 2012-07-27 15:48:36 UTC
Created attachment 122471 [details]
a couple of interesting ISEs
Comment 6 athompson 2012-07-27 15:49:27 UTC
I guess it does happen every time here...
Comment 7 athompson 2012-07-27 15:53:55 UTC
In reply to comment #1, the file is still green even after closing/reopening the file and restarting the IDE.
Comment 8 Ondrej Vrabec 2012-07-29 19:35:00 UTC
> Actually, I can recreate it here.  The stripe comes back only after you
> actually commit the folder.  I'll attach the log file.
What do you mean by this? That the diff sidebar corrects itself after you commit the folder? Then it's no big deal, is it?
BTW, are you referring to "/Users/alvin/Projects/RainKing/2.1/rainking-reports/src/main/webapp/WEB-INF/reports/juice-contacts-old.sql" (or juice-contacts.sql)? By any chance, is one of the folders a symlink to an original folder? My assumption is that files comming from symlink path result in an incomplete subversion information and the ISE is then logged.
Comment 9 athompson 2012-07-30 02:34:59 UTC
(In reply to comment #8)
> What do you mean by this? That the diff sidebar corrects itself after you
> commit the folder? Then it's no big deal, is it?

The sidebar corrects itself *before* you commit, but when you do commit it reverts back to all green.

> BTW, are you referring to
> "/Users/alvin/Projects/RainKing/2.1/rainking-reports/src/main/webapp/WEB-INF/reports/juice-contacts-old.sql"
> (or juice-contacts.sql)? By any chance, is one of the folders a symlink to an
> original folder? My assumption is that files comming from symlink path result
> in an incomplete subversion information and the ISE is then logged.

No symlinks.  I renamed the file from "juice-contacts.sql" to "juice-contacts-old.sql" from within the IDE, which caused the problem.
Comment 10 Ondrej Vrabec 2012-07-30 08:48:52 UTC
1) close all files in the IDE
2) restart the IDE with the following switch: -J-Dorg.netbeans.modules.versioning.ui.diff.DiffSidebarManager.level=-1
3) open juice-contacts-old.sql and attach the messages.log, it should contain additional logging
thanks
Comment 11 Ondrej Vrabec 2012-07-30 09:52:36 UTC
i was able to reproduce, it happens only with sql files.
Comment 12 Ondrej Vrabec 2012-07-30 09:54:35 UTC
fix: http://hg.netbeans.org/core-main/rev/9180d5b5bdc6
Comment 13 athompson 2012-07-30 14:31:18 UTC
Cool. I should mention that it affects the 7.2 release as well.
Comment 14 Quality Engineering 2012-07-31 02:33:41 UTC
Integrated into 'main-golden', will be available in build *201207310001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/9180d5b5bdc6
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #215899 - renaming files under SVN control confuses the editor's "diff" function
Comment 15 athompson 2012-08-01 17:31:52 UTC
Yup!
Comment 16 Stepan Zebra 2012-08-28 10:04:45 UTC
verified in trunk, please integrate
Comment 17 Ondrej Vrabec 2012-08-28 10:13:05 UTC
7.2: http://hg.netbeans.org/releases/rev/ce16c07367e7
Comment 18 Quality Engineering 2012-09-01 11:09:35 UTC
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/ce16c07367e7
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #215899 - renaming files under SVN control confuses the editor's "diff" function
(transplanted from 9180d5b5bdc6bf198a1807857652181d7c0f3d02)
Comment 19 Stepan Zebra 2012-09-10 13:07:48 UTC
verified in 7.2.1