Howto apply a patch/diff file
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 4
- Joined: 04 Jul 2008 11:30
Re: Howto apply a patch/diff file
Hi,
I'm learning how to use TortoiseSVN using MeusH's instructions on page 1. I have followed the steps to 'Checkout SVN' and I am trying to apply PhilSophious' realistic timetables patch using right-click->TortoiseSVN->Apply patch. I select 'patch all' as in attachment 2 at which point TortoiseMerge loads up and displays two columns, 'source.list: original' and source.list: patched.' What do I do now in order to play OpenTTD with the patch applied?
I have previously used BuildOTTD and after pressing 'Update and Compile' a build of the patched game would appear in 'My OTTD Builds.' Does TortoiseSVN have an equivalent feature?
I hope that this is clear and would appreciate any advice you can offer.
Thanks
I'm learning how to use TortoiseSVN using MeusH's instructions on page 1. I have followed the steps to 'Checkout SVN' and I am trying to apply PhilSophious' realistic timetables patch using right-click->TortoiseSVN->Apply patch. I select 'patch all' as in attachment 2 at which point TortoiseMerge loads up and displays two columns, 'source.list: original' and source.list: patched.' What do I do now in order to play OpenTTD with the patch applied?
I have previously used BuildOTTD and after pressing 'Update and Compile' a build of the patched game would appear in 'My OTTD Builds.' Does TortoiseSVN have an equivalent feature?
I hope that this is clear and would appreciate any advice you can offer.
Thanks
Re: Howto apply a patch/diff file
What are you using to compile? TortoiseSVN won't do that.
Formerly thanet-bomber.
-
- Engineer
- Posts: 4
- Joined: 04 Jul 2008 11:30
Re: Howto apply a patch/diff file
Ah, a compiler would help!
Anyway, installed Cygwin and successfully followed the wiki to the end of step 12, with no problems (as far as I can tell). I decided to start with a clean, unpatched version of the source code.
However, when I type 'run openttd.exe' into Cygwin (or indeed just double-click the icon in the binaries folder) the program loads up with the normal title in the window bar (OpenTTD rxxxxx) but it then freezes and I am left with just a black screen (sometimes with the OpenTTD mouse pointer) before the dreaded 'not responding' Windows dialogue box appears. The original TTD data files and Cygwin files are in place.
To check it wasn't some sort of bug in the latest nightly, I changed the revision using TortoiseSVN to the last revision I compiled using BuildOTTD - still no functioning binary. Also, my BuildOTTD binaries still work.
Any suggestions on what might be the problem?
Thanks for your help
Anyway, installed Cygwin and successfully followed the wiki to the end of step 12, with no problems (as far as I can tell). I decided to start with a clean, unpatched version of the source code.
However, when I type 'run openttd.exe' into Cygwin (or indeed just double-click the icon in the binaries folder) the program loads up with the normal title in the window bar (OpenTTD rxxxxx) but it then freezes and I am left with just a black screen (sometimes with the OpenTTD mouse pointer) before the dreaded 'not responding' Windows dialogue box appears. The original TTD data files and Cygwin files are in place.
To check it wasn't some sort of bug in the latest nightly, I changed the revision using TortoiseSVN to the last revision I compiled using BuildOTTD - still no functioning binary. Also, my BuildOTTD binaries still work.
Any suggestions on what might be the problem?
Thanks for your help
Re: Howto apply a patch/diff file
Code: Select all
make
what i was trying to do is to implement new_oil.patch
there was no errors after previous commands
no openttd.exe created
any ideas?
- Attachments
-
- make error.PNG (23.07 KiB) Viewed 2455 times
Regards,
Wojtek
Wojtek
Re: Howto apply a patch/diff file
You've got a C++ compiler error, according to the report, _reachable_tracks is used, but does not exist.
Do the revision numbers of 'trunk' and the 'new_oil.patch' match?
Do the revision numbers of 'trunk' and the 'new_oil.patch' match?
Re: Howto apply a patch/diff file
Unlike what you may think, there is not one set of source files to build OpenTTD, there are over 14000 of them. Each time on of the devs makes a change in trunk (where you copied your source files from with SVN or TortoiseSVN), we get a new set of files. In order not to get confused, each set of source files is given a number, the so called revision number.
You can ask the number from your trunk directory by typing 'svnversion' in your /home/Administrator/trunk directory.
A patch is a description of what lines must be changed (and how) in a set of files in order to make the patch work. Since with each revision, the source files are different, a patch is always made against against a specific revision, and this number is known as the patch revision number.
The only guaranteed working way to apply a patch is to use the same set of sources as were used to create the patch. In other words, you need to get the patch revision number of new_oil.patch, and get that exact same set of sources (with eg 'svn update -r', see the end of the BuildOTTD thread) before you can apply the patch.
Alternatively, you can try to update the patch to a newer revision, but you need C++ knowledge to do that.
You can ask the number from your trunk directory by typing 'svnversion' in your /home/Administrator/trunk directory.
A patch is a description of what lines must be changed (and how) in a set of files in order to make the patch work. Since with each revision, the source files are different, a patch is always made against against a specific revision, and this number is known as the patch revision number.
The only guaranteed working way to apply a patch is to use the same set of sources as were used to create the patch. In other words, you need to get the patch revision number of new_oil.patch, and get that exact same set of sources (with eg 'svn update -r', see the end of the BuildOTTD thread) before you can apply the patch.
Alternatively, you can try to update the patch to a newer revision, but you need C++ knowledge to do that.
Re: Howto apply a patch/diff file
Inasmuch as anything released under the GPL is either warranted or guaranteed to anything at all.Alberth wrote:the only guaranteed working way
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Howto apply a patch/diff file
I dont really understand it (not the language but instructions)
I think I will give up for now
and enjoy stable 0.6.3 
I think I will give up for now


Regards,
Wojtek
Wojtek
-
- Engineer
- Posts: 61
- Joined: 20 Oct 2008 12:50
Re: Howto apply a patch/diff file
Just a quick qn, once i patch the source files... how do i play it?
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Howto apply a patch/diff file
you compile itXxInNOutxX wrote:Just a quick qn, once i patch the source files... how do i play it?
After having successfully compiled you can start your binary the usual way.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
-
- Engineer
- Posts: 61
- Joined: 20 Oct 2008 12:50
Re: Howto apply a patch/diff file
How do u compile then? BuildOTTD doesnt work 

Re: Howto apply a patch/diff file
by using a compiler?
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction. - Albert Einstein
-
- Engineer
- Posts: 61
- Joined: 20 Oct 2008 12:50
Re: Howto apply a patch/diff file
I have tried cygwin and all sorts of compilers, but they give all sorts of errors and are too complicated. Pls help 

- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Howto apply a patch/diff file
You may notice that we can help, if you have a specific error.XxInNOutxX wrote:I have tried cygwin and all sorts of compilers, but they give all sorts of errors and are too complicated. Pls help
But going here and stating "doesn't work" simply won't get you anywhere and is likely to give no helpful response as simply it cannot be given. Especially if you come with an attitude of "I think it's compilicated" showing no effort of your part to solve your problem with your computer. Why should we do your work?
General guidelines on how to install and setup compilers are sufficiently around in the net and in this very sticky topic. Yes, it may require you to do some reading. Yes, it may not be everything quite straight forward. Yes, may not even be a piece of cake. But also yes, our crystal balls are broken.
Enough of this rant now.
So, please, if you tell us what you tried on which system and where exactly what error exactly happend. That's fine and we might be able to give a hint.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
-
- Engineer
- Posts: 61
- Joined: 20 Oct 2008 12:50
Re: Howto apply a patch/diff file
Quote from cygwin article from openttd wiki "Now you need to launch Cygwin, so use the start menu icon or run cygwin.bat in C:\cygwin. You then need to move to the folder where the source is, so type cd /usr/src/openttd/trunk."
This is the step that confused me.
What error does it indicate?
This is the step that confused me.
What error does it indicate?
- Attachments
-
- cgywin.JPG (126.09 KiB) Viewed 1133 times
Last edited by XxInNOutxX on 27 Oct 2008 09:52, edited 1 time in total.
Re: Howto apply a patch/diff file
That either your space bar is broken or that you haven't exactly (character-by-character) copied what was written you should type.XxInNOutxX wrote:What error does it indicate?
-
- Engineer
- Posts: 61
- Joined: 20 Oct 2008 12:50
Re: Howto apply a patch/diff file
hmm there are spaces to be put in?
Edit: uploaded a new picture with correct words typed in.
Edit: uploaded a new picture with correct words typed in.
Re: Howto apply a patch/diff file
XxInNOutxX wrote:Quote from cygwin article from openttd wiki "Now you need to launch Cygwin, so use the start menu icon or run cygwin.bat in C:\cygwin. You then need to move to the folder where the source is, so type cd_space_/usr/src/openttd/trunk."?
-
- Engineer
- Posts: 61
- Joined: 20 Oct 2008 12:50
Re: Howto apply a patch/diff file
Doesnt work for me still getting the same error. Wait, do i have to get the source FIRST before doing this?
Who is online
Users browsing this forum: No registered users and 26 guests