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 245322 - Enable copy detection in the diff view when diffing against a specific revision
Summary: Enable copy detection in the diff view when diffing against a specific revision
Status: REOPENED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on: 61949
Blocks: 246289
  Show dependency tree
 
Reported: 2014-06-30 12:49 UTC by ulfzibis
Modified: 2014-08-11 00:32 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2014-06-30 12:49:28 UTC
[ JDK VERSION : 1.7.0_45 ]

STEPS:
   * Compare discussion from bug 245270.
   * Have 2 branches A and B.
   * Update working copy to B.
   * Merge Changes with A
   * Check status with command line:
     hg status -C
     {...}
     M test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
       src/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
     {...}
   * Diff the file from working copy against A

ACTUAL:
   At column A: "Content not available"
   Additionally the rename is not listed with "Show Changes"

EXPECTED:
   With command line hg I get from:
> hg diff -r A test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java 
diff --git a/src/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
b/test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
copy from src/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
copy to test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
--- a/src/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
+++ b/test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
@@ -4,15 +4,13 @@
  * Created on 16. Dezember 2000, 20:10
  */
 
-
+package de.DMS.KVB.KomPruefStand;
 
 /**
  *
  * @author  ich
  * @version
  */
-package de.DMS.KVB.KomPruefStand;
-
 public class DreiKompressorenPanel extends javax.swing.JPanel {
 
   /** Creates new form DreiKompressorenPanel */
{...}
Comment 1 Ondrej Vrabec 2014-07-07 11:45:38 UTC
not that i approve your use case of merging into a dirty working copy, but the same might happen when resolving conflicts and copying a file during a merge... so attempting to fix it.

fix: http://hg.netbeans.org/core-main/rev/b63aa70df05b
Comment 2 ulfzibis 2014-07-07 12:09:42 UTC
(In reply to Ondrej Vrabec from comment #1)
> not that i approve your use case of merging into a dirty working copy,

This bug is not about such case, please see steps above.

> but the same might happen when resolving conflicts and copying a file
> during a merge... so attempting to fix it.

Great, thanks!
Comment 3 ulfzibis 2014-07-07 12:13:02 UTC
(In reply to Ondrej Vrabec from comment #1)
> fix: http://hg.netbeans.org/core-main/rev/b63aa70df05b

Interesting, that the code after the bug fix is much more simple.
Comment 4 ulfzibis 2014-07-07 12:39:25 UTC
(In reply to Ondrej Vrabec from comment #1)
> not that i approve your use case of merging into a dirty working copy,

... and additionally your personal opinion seems not in line with NB IDEs actual implementation. It seems to set the --force option per default (which is fine for my use case :-) , but maybe a bug too) :
http://bz.selenic.com/show_bug.cgi?id=4293#c9
Comment 5 Quality Engineering 2014-07-08 02:27:51 UTC
Integrated into 'main-silver', will be available in build *201407080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b63aa70df05b
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #245322 - Ignored renamings after merge
Comment 6 ulfzibis 2014-08-03 11:56:42 UTC
Still not working in 8.0.1_RC :-(

STEPS:
Use repo from bug 245337.
Update to rev 27(Compileable).
Merge with rev 29(New_forms).
Resolve conflicts on test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java in always accepting the left pane (WC).
On this file: Mercurial->Diff to Revision->29(New_forms).

ACTUAL:
At column 29: "Content not available", but compare:
    hg diff -r 29|New_forms test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
In "Show Changes" list there is "Locally modified" even there is no change with:
    hg diff test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
Comment 7 Ondrej Vrabec 2014-08-04 08:14:21 UTC
> On this file: Mercurial->Diff to Revision->29(New_forms).
ondra@ondra-vrabec:~/Temp/245322> hg diff -r 29 test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
diff -r c3f90cde9ba0 test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java  Mon Aug 04 10:10:49 2014 +0200
@@ -0,0 +1,62 @@
===> file is added between 29 and current (27). The same is shown in the diff view: Locally Added

> In "Show Changes" list there is "Locally modified" even there is no change with:
ondra@ondra-vrabec:~/Temp/245322> hg status test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
M test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
the same is shown in the status window.

So what's the problem here? Closing again.
Comment 8 ulfzibis 2014-08-04 21:21:55 UTC
Hm, I still see:

================================================================
ich@Ulfuntu:~/Projects/KVB/MergeBranches_2$ cd ../MergeBranches
ich@Ulfuntu:~/Projects/KVB/MergeBranches$ hg diff -r 29 test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
diff --git a/src/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java b/test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
copy from src/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
copy to test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
--- a/src/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
+++ b/test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
@@ -4,15 +4,13 @@
  * Created on 16. Dezember 2000, 20:10
  */
 
-
+package de.DMS.KVB.KomPruefStand;
 
 /**
  *
  * @author  ich
  * @version
  */
-package de.DMS.KVB.KomPruefStand;
-
 public class DreiKompressorenPanel extends javax.swing.JPanel {
 
   /** Creates new form DreiKompressorenPanel */
{.....}
ich@Ulfuntu:~/Projects/KVB/MergeBranches$ hg status test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
M test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
ich@Ulfuntu:~/Projects/KVB/MergeBranches$ hg diff test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
================================================================

So I still see differences with hg diff -r 29
I want to see those differences with NetBeans instead "Content not available"

And yes, hg status says: M
But hg diff reports nothing, as there are actually no differences against base (rev 27), but there are differences against the merged rev 29, which should not count.
Comment 9 Ondrej Vrabec 2014-08-05 07:18:14 UTC
then you must actually run hg diff -r 29 --git test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java
Comment 10 Ondrej Vrabec 2014-08-05 08:07:12 UTC
i may finally understand what you really want. You are in the middle of a merge and you want to see diff not against the first but against the second parent. And you're disappointed that although hg diff --git --rev SECOND FILE shows the diff as copied NetBeans merely displays the file as ADDED (not COPIED). This is a performance limitation, getting copied states (with status -C) is extremely costly and i cannot make it the default value. So instead only "hg status" without -C switch is invoked.
I guess there could be a button (default off) enabling copies detection.
Comment 11 ulfzibis 2014-08-06 00:18:38 UTC
(In reply to Ondrej Vrabec from comment #10)
> You are in the middle of a merge and you want to see diff not against
> the first but against the second parent.

Yep! Or in contrast NetBeans should not indicate the file as "Locally modified" if copy detection is not enabled. It's irritating if a file is indicated modified, but the diff view (against base) doesn't show any modifications because there is no difference against the first parent, same for the editors history indication bar at the left. An additional button/option could serve to choose between the two. Additionally the diff pane could provide a button to switch between 1st and 2nd parent, see bug 246289.
Comment 12 ulfzibis 2014-08-06 00:45:18 UTC
Additionally it would be useful if the option would serve for the Export Diff function to choose between GIT format.
Comment 13 ulfzibis 2014-08-06 16:27:16 UTC
(In reply to Ondrej Vrabec from comment #9)
> then you must actually run hg diff -r 29 --git test/de/DMS/KVB/KomPruefStand/DreiKompressorenPanel.java

Oops, overseen. Thanks for persisting.

I did not use the --git option explicitly, but I have installed TortioiseHG, where I set the GIT style option, so the graphical interface seems to influence the command line behaviour.
Comment 14 ulfzibis 2014-08-11 00:32:26 UTC
Interesing:
When I move some Java files from Source Packages to Test Packages (no merge involved here), then I can see the Diff to Base on those files, but after commit, I see "Content not available" with Diff to the before version.