Howto apply a patch/diff file

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Howto apply a patch/diff file

Post by Yexo »

XxInNOutxX wrote:Doesnt work for me still getting the same error. Wait, do i have to get the source FIRST before doing this?
Of course you have to. That line assumes the source code is in /usr/src/openttd/trunk (Most likely that is C:\cygwin\usr\openttd\trunk). What instructions are you following?
XxInNOutxX
Engineer
Engineer
Posts: 61
Joined: 20 Oct 2008 12:50

Re: Howto apply a patch/diff file

Post by XxInNOutxX »

Downloading the source at step 9 atm going smoothly... :)
borinot
Engineer
Engineer
Posts: 1
Joined: 30 Oct 2008 12:43

Re: Howto apply a patch/diff file

Post by borinot »

Hi!

First of all, my english is very bad, and for me read and talk english is very difficult.
I have a problem with yapp patch, and I don't know if the problem it's my or it's external for me, I explain:

1) I download the last SVN version
2) I moved the yapp patch to new openttd directory.
3) 'apply patch' with comand: patch -p1 < yapp...patch and bash it shows me this:



# ~/Desktop/openttd$ patch -p1 < yapp_r13840_v9.patch
patching file docs/landscape.html
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
7 out of 7 hunks ignored -- saving rejects to file docs/landscape.html.rej
patching file docs/landscape_grid.html
Hunk #8 FAILED at 321.
1 out of 8 hunks FAILED -- saving rejects to file docs/landscape_grid.html.rej
patching file projects/openttd_vs80.vcproj
Hunk #1 FAILED at 664.
Hunk #2 FAILED at 1268.
2 out of 2 hunks FAILED -- saving rejects to file projects/openttd_vs80.vcproj.rej
patching file projects/openttd_vs90.vcproj
Hunk #1 FAILED at 661.
Hunk #2 FAILED at 1265.
2 out of 2 hunks FAILED -- saving rejects to file projects/openttd_vs90.vcproj.rej
patching file source.list
Hunk #1 FAILED at 57.
Hunk #2 FAILED at 242.
2 out of 2 hunks FAILED -- saving rejects to file source.list.rej
patching file src/debug.cpp
patching file src/debug.h
Reversed (or previously applied) patch detected! Assume -R? [n]

and a large etc..

I don't know how continue. Can you help me?

Thanks!
rbn2903
Engineer
Engineer
Posts: 122
Joined: 08 Dec 2007 18:04
Location: Aachen (Aken), Germany

Re: Howto apply a patch/diff file

Post by rbn2903 »

The latest SVN already has YAPP included. You don't need (actually you're not able) to include it again. ;) You could download the latest compiled nightly from openttd.org and play with YAPP :)
Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: Howto apply a patch/diff file

Post by Wold »

I have some problems - all the things that should be added are in red, and when I try to patch them I receive the error on the right. Ideas?
Attachments
123.PNG
123.PNG (19.49 KiB) Viewed 3382 times
Image
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Howto apply a patch/diff file

Post by Yexo »

Wold wrote:I have some problems - all the things that should be added are in red, and when I try to patch them I receive the error on the right. Ideas?
Download the svn revision the patch was made for and not the latest revision.
Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: Howto apply a patch/diff file

Post by Wold »

Yexo wrote:
Wold wrote:I have some problems - all the things that should be added are in red, and when I try to patch them I receive the error on the right. Ideas?
Download the svn revision the patch was made for and not the latest revision.
the idea is that I want to have 2 patches - the copy/paste and distant join station and I want to play 0.6.3 :) and I have no idea how to do that...
Image
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Howto apply a patch/diff file

Post by Yexo »

Wold wrote:
Yexo wrote:
Wold wrote:I have some problems - all the things that should be added are in red, and when I try to patch them I receive the error on the right. Ideas?
Download the svn revision the patch was made for and not the latest revision.
the idea is that I want to have 2 patches - the copy/paste and distant join station and I want to play 0.6.3 :) and I have no idea how to do that...
Simple: You can't. Both the copy/paste patch and the distant join station patch are written for newer versions then 0.6.3. Why do you want to use 0.6.3? The nightlies are very stable and have more features. Copy/paste may be compatible in a normal network game but it's impossible to play with distant join stations against a plain 0.6.3 build, so it's pointless to apply that patch to 0.6.3
All Bran
Engineer
Engineer
Posts: 11
Joined: 03 Nov 2008 08:20

Re: Howto apply a patch/diff file

Post by All Bran »

copy/paste does support 0.6.3, its on the first page of the thread as a download.
Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: Howto apply a patch/diff file

Post by Wold »

All Bran wrote:copy/paste does support 0.6.3, its on the first page of the thread as a download.
I know. But the idea is that I want to know how it is done.

Next question is: How to get the latest stable version's files with the Tortoise? ( If 0.7.0 is out soon how to get it's source and apply a patch? )

Thank you both!
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

The only way to get 0.7.0's source is to go forward in time until a /tags/0.7.0 appears in svn.
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
supermatt
Engineer
Engineer
Posts: 15
Joined: 26 Oct 2008 18:26

Re: Howto apply a patch/diff file

Post by supermatt »

I'm having a compiling issue. I'm using Microsoft Visual 2005 to compile, and I followed this wiki to the letter. I downloaded the most recent source using TortoiseSVN without problem and did not change it in any way. It compiles ok, no compiling errors, and I can start the game from inside Visual, using Run without Debugging. But when I try to start the game using the .exe it generates, I get the following error: "No available language packs (invalid versions?)" and it quits. What am I doing wrong?
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Howto apply a patch/diff file

Post by Roujin »

Try copying the generated .exe file from [projectdir]\objs\Win32\[Debug|Release]\ to [projectdir]\bin, then execute it there. There's probably also a way to set it up so you don't have to do this every time you want to run it, but I haven't found this out yet either...
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
supermatt
Engineer
Engineer
Posts: 15
Joined: 26 Oct 2008 18:26

Re: Howto apply a patch/diff file

Post by supermatt »

Aha! It works! Thank you Roujin! :mrgreen:
Look, up in the sky! It's a bird! It's a plane! It's Supermatt!
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 173
Joined: 17 Nov 2007 17:23
Skype: ben313371

Re:How to apply a patch/diff file

Post by Ben1338 »

MeusH wrote:If you're using windows, you can download TortoiseSVN, install and do the following:

Download the source files:
Make a new folder
Right click on it
Choose "SVN Checout..." from the menu
Set data fields like on attachement 1
Hit OK, wait 5-20 minutes for all files to download

Choose the diff file:
Right click on folder you've downloaded files to
Choose "TortoiseSVN > Apply Patch..." from the menu
Browse for .patch or .diff file

Apply the changes:
Usually, right clicking on filelist window (attachement 2) and clicking "Patch all" should work, but sometimes there is something wrong (attachement 2 - files marked red):

Don't worry, often application will download other revision and everything will work.
However, if you're experiencing problems (marked red) ask patch developer and tell him what's wrong. Tell him what diff file have you downloaded and what revision have you downloaded using "SVN Checkout"


Happy patching :)
Ok. I'm trying to apply my patch. I've downloaded the patch, updated it I've choosen the patch file, I've choosen the TortoiseSVN > Apply Patch on the menu when you right click the .diff file.

I just wonder what those icons on the folders on the OTTD directorys mean.

Does the tick mean that you can put the patch in there, The blue "?" mean that It's not recommended to put it in there and the red "!" mean that you can't put in there.

I had seen the "!" on the directory of OTTD, the "?" on the awe, data, fm, gm, lang, save and senareo and the tick on the rest of the folders in OTTD which are bin, docs, media, os, projects and src.

P.S.I'm trying to install the patch on this post http://www.tt-forums.net/viewtopic.php?p=678005#p678005
User avatar
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

Re: Howto apply a patch/diff file

Post by Thief^ »

! is changed from base, tick is unchanged, ? is a file that isn't in the base, + is an explicitly added file.
Melt with the Shadows,
Embrace your destiny...
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 173
Joined: 17 Nov 2007 17:23
Skype: ben313371

Re: Howto apply a patch/diff file

Post by Ben1338 »

So where can I apply the file to?
User avatar
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

Re: Howto apply a patch/diff file

Post by Thief^ »

Read the instructions again, it doesn't say to right-click on the patch file, it says to right-click on the folder you checked out into.
Personally I right-drag the patch file onto the folder and choose "apply patch" from there.
Melt with the Shadows,
Embrace your destiny...
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 173
Joined: 17 Nov 2007 17:23
Skype: ben313371

Re: Howto apply a patch/diff file

Post by Ben1338 »

Ok. I've done it all.

Thanks for clearing that up for me.

Does it matter where I put this new folder?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

On your HD is usually a good choice, though a flash drive would probably work too.
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
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 21 guests