cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 134937 - Editor displays difference on line after "Push to default"
: Editor displays difference on line after "Push to default"
Status: VERIFIED FIXED
: versioncontrol
Mercurial
: 6.1
: All All
: P3 (vote)
: 6.5
Assigned To:
:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-05-13 10:55 by
Modified: 2008-06-25 12:40 (History)
Issue Type: DEFECT
:


Attachments
proposed patch (3.95 KB, patch)
2008-05-26 12:04, Padraig Obriain
Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-05-13 10:55:29
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.
------- Comment #1 From 2008-05-15 08:41:10 -------
I can reproduce this problem.
------- Comment #2 From 2008-05-15 08:42:50 -------
Transferring to editor for help in understanding that causes the green mark to
be displayed.
------- Comment #3 From 2008-05-19 08:34:42 -------
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.
------- Comment #4 From 2008-05-22 13:46:39 -------
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.
------- Comment #5 From 2008-05-22 15:08:16 -------
I see no evidence that getOriginalFile is being called when step 4 (switch to
tab of original file) is done
------- Comment #6 From 2008-05-22 15:14:37 -------
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.
------- Comment #7 From 2008-05-23 14:00:18 -------
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.
------- Comment #8 From 2008-05-26 10:25:25 -------
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.
------- Comment #9 From 2008-05-26 12:04:28 -------
Created an attachment (id=61907) [details]
proposed patch
------- Comment #10 From 2008-05-26 12:11:08 -------
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. 
------- Comment #11 From 2008-05-26 12:15:57 -------
changeset:   81563:69ec3771b81c
tag:         tip
user:        padraigob@netbeans.org
date:        Mon May 26 11:59:55 2008 +0100
summary:     134937: Fire status change event for files updated after push
------- Comment #12 From 2008-05-27 14:57:56 -------
Same problem exists for local Pull.
------- Comment #13 From 2008-05-29 11:37:36 -------
Logged issue 136066 for pull issue so marking this bug as fixed..
------- Comment #14 From 2008-06-25 12:40:51 -------
Verified (200806240008)