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 251409 - Apply patch leaves out some files
Summary: Apply patch leaves out some files
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on: 253547
Blocks:
  Show dependency tree
 
Reported: 2015-03-24 20:00 UTC by markiewb
Modified: 2015-09-10 01:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch to apply (213.33 KB, patch)
2015-03-24 20:00 UTC, markiewb
Details | Diff
Shows content of patch file and the patch report (94.96 KB, image/png)
2015-03-24 20:01 UTC, markiewb
Details
shorten version of the patch containing just problematic parts (2.82 KB, patch)
2015-03-27 20:51 UTC, Ondrej Vrabec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2015-03-24 20:00:51 UTC
Created attachment 152829 [details]
Patch to apply

* Clone the NB sources from main
* Checkout the following commit 
changeset:   286455:3030ab28d2a4
tag:         tip
parent:      286454:2d4d89ed11f3
parent:      286436:59b25963a8db
user:        ffjre@netbeans.org
date:        Mon Mar 23 17:08:43 2015 +0000
summary:     Automated merge with main-silver
* Apply given patch via Mercurial/Patches/Apply Diff Patch...

ACTUAL: not all files get patched (f.e. in the patch file there are changes of files in "refactoring.api", but they weren't patched
EXPECTED: patch can be applied, all files referenced in the patch file get patched
Comment 1 markiewb 2015-03-24 20:01:31 UTC
Created attachment 152830 [details]
Shows content of patch file and the patch report

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1
Java: 1.8.0_40; Java HotSpot(TM) 64-Bit Server VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 2 markiewb 2015-03-24 20:05:34 UTC
FYI: Applying the patch at cmdline works without any hassle

D:\ws\main>hg import FindUsages.diff
applying FindUsages.diff
Comment 3 Ondrej Vrabec 2015-03-24 20:34:49 UTC
Is it the CodeGeneratorTest.java that is not patched?
> D:\ws\main>hg import FindUsages.diff
> applying FindUsages.diff
Well, hg import is different than Patches/Apply Diff Patch...
Comment 4 Ondrej Vrabec 2015-03-25 08:45:51 UTC
if i understand correctly, the apply patch action fails at this point:
diff --git a/java.source.base/test/unit/src/org/netbeans/modules/java/classfile/CodeGeneratorTest.java b/java.source/test/unit/src/org/netbeans/modules/java/classfile/CodeGeneratorTest.java
rename from java.source.base/test/unit/src/org/netbeans/modules/java/classfile/CodeGeneratorTest.java
rename to java.source/test/unit/src/org/netbeans/modules/java/classfile/CodeGeneratorTest.java
and does not continue further. Probably it does not understand "rename" pattern. Not sure however why it does not at least continue and leave just CodeGeneratorTest.java unpatched.
Comment 5 Ondrej Vrabec 2015-03-27 20:49:29 UTC
the patch file contains several directives not supported by NetBeans internal patch action.
- rename + diff
- copy
- binary patch

Unfortunately your patch contains pretty much everything NetBeans does not know.

BTW, the correct way to apply a patch exported with Mercurial is Merc -> Patches -> Import Changesets.
Comment 6 Ondrej Vrabec 2015-03-27 20:51:35 UTC
Created attachment 152892 [details]
shorten version of the patch containing just problematic parts
Comment 7 Ondrej Vrabec 2015-04-02 09:02:17 UTC
Sadly the only way to import git patches is using our internal apply. So i guess at least binary and renamed files should be supported.
Comment 8 Ondrej Vrabec 2015-07-17 15:19:42 UTC
filed this for binary patches: bug 253546
filed this for mercurial import in the first place: 253547
Comment 9 Ondrej Vrabec 2015-07-17 18:38:07 UTC
#253547 fixed -> the original problem with applying hg patch file should be gone. But still, copied and renamed files should be properly handled by the patch action because it blocks git-exported patches completely.
Comment 10 Ondrej Vrabec 2015-09-08 13:29:52 UTC
Fix: http://hg.netbeans.org/core-main/rev/5d1b4a2b2f38
Comment 11 Quality Engineering 2015-09-10 01:28:56 UTC
Integrated into 'main-silver', will be available in build *201509100002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5d1b4a2b2f38
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #251409 - Apply patch leaves out some files
Properly handle copy/renames in textual patches