Recent

Author Topic: trying to apply a patch from the bug site, shows blank in SVN  (Read 1713 times)

jamie

  • Hero Member
  • *****
  • Posts: 6130
trying to apply a patch from the bug site, shows blank in SVN
« on: December 07, 2020, 01:42:36 pm »
I tried to apply a patch purposed here
https://bugs.freepascal.org/view.php?id=37982

I downloaded it and then tried applying the patch and all that showed was two blank window panes

what I am doing wrong ?
The only true wisdom is knowing you know nothing

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #1 on: December 07, 2020, 02:00:05 pm »
what I am doing wrong ?

That quite depends on what you're doing, meaning: how are you exactly doing what you're doing?

There are quite a lot of ways of applying a patch ... :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #2 on: December 07, 2020, 02:04:14 pm »
I download the suggested patch from the link into a folder on my side..

I then use the TortoiseSVN:ApplyPatch, go over to the folder where I have it stored, select it and the dual pane window comes up to show the patch and the current file on your system..

 Both panes are empty when I do this.

 how else do you apply someone's patch without manually writing it in yourself ?

 Do I need to follow this process on my local copy of the file instead ?

 I did this from the root of the Trunk install ?

The only true wisdom is knowing you know nothing

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #3 on: December 07, 2020, 02:05:38 pm »
That patch, even the last -corrected - one in the discussion simply looks incorrect, especially the finalization parts.
Also look at the remarks from ASerge in the discussion in the bug report.
As it stands I would not even try to test it. The patch is still geared towards a very specific problem for the submitter, but breaks general use. It also does not contain sufficient tests.

Your patch procedure looks correct, but you have to apply it to the correct version.
« Last Edit: December 07, 2020, 02:08:37 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #4 on: December 07, 2020, 02:10:54 pm »
If the patch is created correctly (from the root of the lazarus source directory)
put the patch there and simply do svn patch <patchname> and rebuild Lazarus. The way the patch is created looks correct. see path on top.
« Last Edit: December 07, 2020, 02:13:44 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #5 on: December 07, 2020, 02:11:15 pm »
Thaddy, I was unlucky to see your post. I guess the ignore is not always working here..

If you can't offer a suggestion to make my quest work then please stay out of it or at least if you think you know how to fix the super classing issues without changing the names then please step up to the plate, I would love to hear how my 45 years, many of which with windows is failing me.

The only true wisdom is knowing you know nothing

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #6 on: December 07, 2020, 02:15:20 pm »
Matter of cross-post abd cache. Look at my last reply if you still want to test it. Icreate patches all the time, so I know what I am doing. They get also applied.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #7 on: December 07, 2020, 02:18:21 pm »
In a terminal window of course I love the commandline.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #8 on: December 07, 2020, 02:46:47 pm »
doing some more reading here at the site for Tors.. .

it appears I can't directly apply a patch like this unless it is able to reference the repository of the revision in use..

The revision number he has in the patch is 64142 and currently we are at 64179.

is it possible the repository is not supplying a reference back to that point?
The only true wisdom is knowing you know nothing

PascalDragon

  • Hero Member
  • *****
  • Posts: 5469
  • Compiler Developer
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #9 on: December 07, 2020, 02:54:42 pm »
I downloaded it and then tried applying the patch and all that showed was two blank window panes

From your further posts I assume that you use TortoiseSVN. The way I do it is to do a right-click drag of the patch to the subversion checkout and use “Apply patch” in the resulting context menu. That will open a window with - yes - two empty panes, but also a small tool window with a list of files and two buttons “Patch Selected Item” and “Patch All”. I use “Patch All”, hope that everything goes well (if not the files with problems will be marked in red and by clicking them you can view them in the two panes) and close the main window.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6685
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #10 on: December 07, 2020, 03:03:13 pm »
Thaddy, I was unlucky to see your post. I guess the ignore is not always working here..

If you can't offer a suggestion to make my quest work then please stay out of it or at least if you think you know how to fix the super classing issues without changing the names then please step up to the plate, I would love to hear how my 45 years, many of which with windows is failing me.

If you have Thaddy on a kill list then I suggest adding me to it as well. For somebody with "The only true wisdom is knowing you know nothing" as a signature, who is asking for help, and who has a history of making half-arsed and inaccurate suggestions you're being gratuitously unpleasant.

Apologies to the moderators and list owner for saying what I'm sure a lot of other people are thinking.

MarkMLl

p.s. If in doubt use the  patch  utility. Generally speaking it tells you why something is being rejected, which is often because the line numbers have moved grossly out of sync.
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #11 on: December 07, 2020, 03:29:08 pm »
p.s. If in doubt use the  patch  utility. Generally speaking it tells you why something is being rejected, which is often because the line numbers have moved grossly out of sync.

The patch utility (patch.exe, comes with fpc install) for Windows is a nightmare to work with.
First of all, if EOL style in patch differs from your source files, it chokes.
Yoiu almost always have to set the -p parameter.
Even with that correctly set, it will reject patches that a simple "svn patch patchfile" has no trouble with at all.

The late bigchimp wrote a patchwrangler utility around patch.exe some years ago IIRC.

Bart

MarkMLl

  • Hero Member
  • *****
  • Posts: 6685
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #12 on: December 07, 2020, 03:57:05 pm »
I admit that I was thinking about the unix variant. I've used it quite a lot for e.g. installing kernel patches, rather less for adding functionality that hadn't made its way into the trunk of a project... and the problems were almost always caused by the same thing (line numbers out of sync).

Which is a pity, since back in the 80s there was an interesting algorithm published on synchronising text files. However it was studiously ignored by the mainstream because the author was an outspoken proponent of applying patents to software... the technique is IIRC used in Meld but I've not seen it acknowledged elsewhere.

The late bigchimp wrote a patchwrangler utility around patch.exe some years ago IIRC.

He is sorely missed. Not only did he know his stuff but he was courteous and good-humoured even when he disagreed with somebody.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #13 on: December 07, 2020, 05:30:39 pm »
I downloaded it and then tried applying the patch and all that showed was two blank window panes

From your further posts I assume that you use TortoiseSVN. The way I do it is to do a right-click drag of the patch to the subversion checkout and use “Apply patch” in the resulting context menu. That will open a window with - yes - two empty panes, but also a small tool window with a list of files and two buttons “Patch Selected Item” and “Patch All”. I use “Patch All”, hope that everything goes well (if not the files with problems will be marked in red and by clicking them you can view them in the two panes) and close the main window.

Thank you very much for an comprehensive response.

 I do see the option on the left but didn't go any further. I just assumed at that point it was a wash out since I've used that utility before which came with content..

I'll give it try.
Thanks


EDIT:

 Thanks again..
 
 patch went in and it's working fine.

I just test run a host and dll app together and the problem seems to be correct. Also recompiled the trunk IDE with the changes and that works
I 'll will report this on the bug site for reference.

 For any one concerned with this, this only changes the class names if the controls are created in a DLL otherwise they still remain as they were in the host app. So nothing will change here for normal apps.
« Last Edit: December 07, 2020, 05:39:25 pm by jamie »
The only true wisdom is knowing you know nothing

PascalDragon

  • Hero Member
  • *****
  • Posts: 5469
  • Compiler Developer
Re: trying to apply a patch from the bug site, shows blank in SVN
« Reply #14 on: December 08, 2020, 09:40:35 am »
Thanks again..
 
 patch went in and it's working fine.

You're welcome. :)

 

TinyPortal © 2005-2018