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 247043 - Cannot apply patch
Summary: Cannot apply patch
Status: NEW
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 8.0
Hardware: PC Linux
: P4 normal with 1 vote (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-11 17:27 UTC by ulfzibis
Modified: 2014-09-19 18:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Affected project (1.95 MB, application/x-7z-compressed)
2014-09-11 21:05 UTC, ulfzibis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2014-09-11 17:27:02 UTC
[ BUILD # : 8.0.1 FCS ]
[ JDK VERSION : 1.7.0_67 ]

STEPS:
   * Mercurial->Patches->Apply Diff Patch from bug 247042
     (after removing the changes from the repo with hg histedit, because I
wanted to remove and replace a before committed erroneous tag)

ACTUAL:
   Message: The patch was partially applied. ...

EXPECTED:
   It should be possible to reapply a patch.
Comment 1 ulfzibis 2014-09-11 17:30:08 UTC
applying patch: /home/ich/Projects/KVB/KomPrüfStand/KomPrüfStand_111_b49d09f9920d.patch
--- Successfully Patched ---
/home/ich/Projects/KVB/KomPrüfStand (Kopie)/src/de/DMS/KVB/KomPruefStand/KompBetriebPanel.java
/home/ich/Projects/KVB/KomPrüfStand (Kopie)/src/de/DMS/KVB/KomPruefStand/Kompressor.java
/home/ich/Projects/KVB/KomPrüfStand (Kopie)/src/de/DMS/KVB/KomPruefStand/KompressorControl.java
/home/ich/Projects/KVB/KomPrüfStand (Kopie)/src/de/DMS/KVB/KomPruefStand/KompressorPanel.java
/home/ich/Projects/KVB/KomPrüfStand (Kopie)/src/de/DMS/KVB/KomPruefStand/Protokoll.java
--- Failed ---
/home/ich/Projects/KVB/KomPrüfStand (Kopie)/src/de/DMS/KVB/KomPruefStand/PrüfProgramm.java (Index: 301, Size: 0 )
/home/ich/Projects/KVB/KomPrüfStand (Kopie)/src/de/DMS/KVB/KomPruefStand/PrüfRaum.java (Index: 39, Size: 0 )
Comment 2 Ondrej Vrabec 2014-09-11 19:53:32 UTC
Then it must be something with your file-naming. Having non-ASCII chars in your file names is simply suicidal. Just do not do it... PrüfProgramm.java. I guess NB cannot pair the names in the patch with the real files.
BTW, you should import, not apply the patch (because you exported a commit).
Comment 3 ulfzibis 2014-09-11 21:05:50 UTC
Created attachment 149155 [details]
Affected project

Here is the affected project with the patch.
Note content of .hg/strip-backup/ to see what I have stripped with histedit.
Comment 4 ulfzibis 2014-09-11 21:09:58 UTC
(In reply to Ondrej Vrabec from comment #2)
> Then it must be something with your file-naming. Having non-ASCII chars in
> your file names is simply suicidal. Just do not do it... PrüfProgramm.java.
> I guess NB cannot pair the names in the patch with the real files.

Yes, this is what the problem is. Using Linux TortoiseHG, there is no problem to re-apply the patch.

> BTW, you should import, not apply the patch (because you exported a commit).

Hm, there is only Import ChangeSet, but I have exported a Diff, not a ChangeSet.
Comment 5 Ondrej Vrabec 2014-09-16 12:40:35 UTC
let's try converting the paths to UTF before applying the patch.
Comment 6 Ondrej Vrabec 2014-09-19 12:37:17 UTC
It's not that easy, on my windows czech machine mercurial exports patches with windows-1250 encoding, not UTF8. So when applying patch i cannot anticipate all paths are utf-encoded.
what can i say? just an advice, do not mix different encodings as you are right now: utf-8 vs. iso-8859-1 in NB and projects and most importantly, do not name your files with non-english characters.
Comment 7 ulfzibis 2014-09-19 18:10:25 UTC
(In reply to Ondrej Vrabec from comment #6)
> It's not that easy, on my windows czech machine mercurial exports patches
> with windows-1250 encoding, not UTF8. So when applying patch i cannot
> anticipate all paths are utf-encoded.

So my assumption, file paths are always encoded in UTF-8 is wrong. What about anticipating, they are always encoded with the OS default encoding from HG?

Diff patches, created from via NetBeans or directly from Linux TortioseHG (should be same for command line) are identical, but NetBeans is not able to display them, bug 247042. Applying both diff patches succeed with Linux TortioseHG (should be same for command line), but not via NB.
IMHO, NB should be able to correctly process diff patches, which are correct for official HG tools, so I would re-score the bug with P3.

> what can i say? just an advice, do not mix different encodings as you are
> right now: utf-8 vs. iso-8859-1 in NB and projects
... but then one can ask, why there is a property in NB to serve this. These Java sources were originally created 14 years ago on a Windows platform, so IMO they should stay compatible today.

> and most importantly, do not name your files with non-english characters.
Well yes, this is always easier, but now it's to late for my project and Mercurial, OSs and even Java are designed to allow this, so I still insist this is a real bug in NetBeans.