Product Version: NetBeans IDE Dev (Build 200805130003)
Java: 1.5.0_14; Java HotSpot(TM) Client VM 1.5.0_14-b03
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)
I don't know if this isn't an issue of "diff" or of "editor", please reassign if appropriate. In any case, this is a
minor issue (p4 or maybe even p5, as it is not common to develop project and its clone on 1 PC in the same time).
1. Create a new project (suppose there is a "main.java" file), initialize a mercurial repository, do the first commit,
open main.java in the editor if it is not already opened
2. Clone the project, edit the main.java file from the clone by adding some line (i.e. add a line bellow the TODO
comment in the "int main"), save file and do a commit (on the clone)
3. Update the clone, invoke "Push to default"
4. Open the main.java from the original file (it is already opened, just switch to the tab)
-> there is a green mark in the beginning of the line in the place where a line was added, indicating the added line. If
you close and reopen the same file (main.java from the original), the green mark is not there anymore. It seems that if
you push to some opened file, the diff in the editor accepts the event as if someone typed the changes manually.
I can reproduce this problem.
Transferring to editor for help in understanding that causes the green mark to be displayed.
No idea why this was reassigned to the editor - the green mark is provided by the versioning system and generally means
that the file is modified when compared with the repository version. Please note that the displayed status is
inconsistent - the file is marked as up-to-date (black) in projects tab, but yet the line is marked as added.
This has to be fixed in mercurial ... it seems that getOriginalFile() method returns a wrong version of the file thus
causing inline diff to show differences. The method is called every time a file is opened in editor.
I see no evidence that getOriginalFile is being called when step 4 (switch to tab of original file) is done
I am seeing DiffSideBar$RefreshDiffTask.fetchOriginalContent being called and originalContentBufferSerial =
originalContentSerial so getText is not called. My understaning is that getText is what causes getOriginalFile to be called.
if I add a call to initialize() to insertUpdate in DiffSidebar.java the problem does not occur.
After the call to hg push, hg update is called on the target repository and this causes Main.java to be changed in the
working directory. It looks like DiffSidebar.java is not aware that getOriginalFile need to be called on Main.java.
originalContentBufferSerial == originalContentSerial is an indication that the diff sidebar did not detect any change in
the file status. In this case, it is still mercurial to blame ;-) You need to fire status change event for that file
from MercurialVCS so that diff sidebar refreshes its cache.
Created attachment 61907 [details]
I have added -v option to HgCommand.doUpdateAll to get the list of file which are changed by hg update command.
Then fire sttaus change for each file.
This seems to fix the problem.
date: Mon May 26 11:59:55 2008 +0100
summary: 134937: Fire status change event for files updated after push
Same problem exists for local Pull.
Logged issue 136066 for pull issue so marking this bug as fixed..