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 216011 - Remote synchronization
Summary: Remote synchronization
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: FTP Support (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-26 15:24 UTC by alleknalle
Modified: 2015-07-14 07:23 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alleknalle 2012-07-26 15:24:10 UTC
Tried the new remote synchronisation feature for netbeans 7.2

First of all, thanks for intergrating this feature. Was looking for such thing for a long time.

Problem is that, in my opinion, some things don't work the way they should work

At the start of my each of my points I made sure everything was synchronised!

1) Edited a file on the remote server (added a line). When I click on synchronise on source files it states I have to download the file. So far, so good. When click the diff button I can see my change in red. When I click the OK button the action now says upload the file. I think this shouldn't be happening. Now I'm going to overwrite my edited file.

2) Edited a file locally (added a line). Then I edited the same file on the remote server (added a line). Synchronise source files. Now no warning/error is given. When I click diff I can see my changes on both files. But in my opinion there should be given an error or warning.

3) Edited a file locally (deleted a line). Then I edited the same file on the remote server (added a line). Synchronise source files. Again no warning/error is given. When I click diff I can see everthing in red in the remote version. Again, in my opinion, there should be given an error or warning.

Hope you guys can take a look. Please notice that I made my changed in a very short time period. Maybe that makes a difference. Possible fix would be to compare timestamps and file sizes or something. Don't know.

Very happy to see this functionality, because we are working with just 2 people on a lot of (small)projects with remote connection or via another FTP cllient. Sometimes one of us changes a file and the other overwrites it without noticing the file has been changed.

As read in other posts, a usefull addition is to make a synchronise on save option for projects. Just let it work the same as the upload on save, but check the file first. When there is an error/warning, open the dialog box. If not, just upload the file. Saves a lot of time, because now you don't have to click the synchronise button every time you change something.

Other usefull thing I read was to synchronise folders.

Sorry for going a little bit of topic now ;)
Comment 1 Tomas Mysik 2012-07-30 07:11:55 UTC
@vriha: Láďo, please evaluate this issue (file separate issue if needed). Thanks a lot for your help.

(In reply to comment #0)
> Hope you guys can take a look.

Sure ;)

> Please notice that I made my changed in a very
> short time period. Maybe that makes a difference. Possible fix would be to
> compare timestamps and file sizes or something. Don't know.

We already do this, of course. The problem is - as written in the synchronization dialog itself - that timestamps are not always correct (especially for FTP). We will try to improve it, it is still experimental feature.

Thanks for reporting.
Comment 2 Vladimir Riha 2012-07-30 07:32:31 UTC
I'll try it today although it seems that it is all caused by the file's timestamp, but I'll check it.

Perhaps there could be option to do "slow/detailed" synchronization (at least for a single file) where the remote file is downloaded to some temp location and user can at least review diff before uploading/downloading. But without accurate timestamp I'm not sure if it's useful.
Comment 3 Vladimir Riha 2012-07-30 14:28:35 UTC
I really think this is all related to the timestamps. I tried ftp(vsftpd) and sftp(using OpenSSH). With vsftpd, it sometimes took minutes to get the expected result and in the mean time Synchronization shows either conflicts or upload as suggested action. OpenSSH was a bit better, but also sometimes not accurate.

(In reply to comment #0)
> 1) When click the diff button I can see my change in red. When I click the
> OK button the action now says upload the file. I think this shouldn't be
> happening

Assuming both timestamps are correct, this is sort of OK. You reviewed the diff and had a chance to apply remote changes to the local file. Whether you did so or not doesn't matter, your local file is now considered to be "main" ("newer") and the remote file will be replaced with it. Maybe when it should be preserving the original action (upload/download) if nothing was changed in the diff view. 

Tomasi, please, what's the intended behavior when nothing is changed in diff view?

 
> 2) Edited a file locally (added a line). Then I edited the same file on the
> 3) Edited a file locally (deleted a line). Then I edited the same file on the...I can see everthing in red

Again imho related to the timestamps. But I'm not sure what do you mean by "I can see everthing in red".  Did the diff view show incorrect information?




Build: 7.2 FCS and today's trunk
Ubuntu 11.04 & 11.10
Comment 4 alleknalle 2012-07-31 07:18:45 UTC
(In reply to comment #3)
> > 2) Edited a file locally (added a line). Then I edited the same file on the
> > 3) Edited a file locally (deleted a line). Then I edited the same file on the...I can see everthing in red
> 
> Again imho related to the timestamps. But I'm not sure what do you mean by "I
> can see everthing in red".  Did the diff view show incorrect information?

The diff shows the difference between both files, but it wants to delete the line I've added on the remote version, which I added after I deleted something in the local file. Just like you guys stated before it's probably a timestamp problem too.
Comment 5 Tomas Mysik 2012-07-31 07:43:39 UTC
(In reply to comment #4)
> The diff shows the difference between both files, but it wants to delete the
> line I've added on the remote version, which I added after I deleted something
> in the local file.

The diff works as follows: it shows the remote version (on the left side, non-editable) and the local version (on the right side, editable); if one clicks Cancel, no action will happen. But if one clicks OK, it means "accept the local version". This is, as we see now, a bit confusing and the button labels must be changed - I will do that.

Thanks for discovering that.
Comment 6 Tomas Mysik 2012-07-31 08:27:06 UTC
Adding Petr to CC; please, could you read my last comment and try to suggest how we could improve the UI of the diff window?

Thanks a lot.
Comment 7 Petr Somol 2012-08-02 15:51:32 UTC
So it seems we need to rename OK button. Here are some suggestions, ordered IMHO very roughly from better to worse:

Take Over Local Changes
Unite on Local
Synchronize on Local Changes
Synchronize on Local
Keep Local Changes
Keep Local Edits
Take Over Local State
Synchronize on Local State
Store Local Changes
Store Local Edits
Store Local to Remote
Propagate Local Changes
Keep Local File State
Take Over Local File Changes
Store Local File State
Take Over Local File State

Comments from native speakers would be welcome.
Comment 8 Tomas Mysik 2012-09-12 13:52:10 UTC
Fixed, using "Take Over Local Changes". Láďo, consider backporting to the next patch.

Thanks.

http://hg.netbeans.org/web-main/rev/6e4ddec5ee5d
Comment 9 Quality Engineering 2012-09-13 02:10:57 UTC
Integrated into 'main-golden', will be available in build *201209130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6e4ddec5ee5d
User: Tomas Mysik <tmysik@netbeans.org>
Log: #216011 - Remote synchronization
Comment 10 Vladimir Riha 2012-09-17 10:40:17 UTC
verified in trunk. It's harmless change and could make it more clear for users so I would agree with transplanting to 7.2patch


  Product Version         = NetBeans IDE Dev (Build 201209170001)
(#1d9cebae5bf2)
  Operating System        = Linux version 3.2.0-30-generic-pae running on i386
  Java; VM; Vendor        = 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01;
Oracle Corporation
Comment 11 Tomas Mysik 2012-10-09 10:04:02 UTC
Transplanted.

http://hg.netbeans.org/releases/rev/3d488aa84985
Comment 12 Quality Engineering 2012-10-10 14:16:18 UTC
Integrated into 'releases', will be available in build *201210100934* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/3d488aa84985
User: Tomas Mysik <tmysik@netbeans.org>
Log: #216011 - Remote synchronization
(transplanted from 6e4ddec5ee5d984d2125ebdcce2f22a1d6c9bd64)
Comment 13 Vladimir Riha 2012-10-11 09:05:02 UTC
verified in patch

Product Version: NetBeans IDE 7.2.1 (Build 201210100934)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-31-generic-pae running on i386; UTF-8; en_US (nb)
Comment 14 DeveloperChris 2015-07-14 06:46:24 UTC
Hi Guys

I was always confused by what "Take Over Local Changes" button meant. I decided I should find out because I have never used this button.

If the button is meant to mean. "Keep the changes made locally in Netbeans and and upload the file to the remote location". Then the wording is quite confusing to a native English speaker.

To "take over" means to "take control of" it does not imply keeping your local edits. It could even be taken to mean the opposite.

Far better wording would be "Keep Local Changes"

That means don't change the local file, instead apply the local changes to the remote file.


PHP and Netbeans are amazingly good, and I thank you for the work you do!
Comment 15 Tomas Mysik 2015-07-14 07:23:54 UTC
@DeveloperChris: Please, do not change verified issues. Feel free to submit a new one.

Thanks.