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

Melfice
Transport Coordinator
Transport Coordinator
Posts: 305
Joined: 20 Apr 2006 19:11
Location: Oldenzaal, the Netherlands, gateway to Germany

Re: Howto apply a patch/diff file

Post by Melfice »

Hehehe, well...
I got it to work. Well, the eye-candy to work on trunk, at least.
Now I just got to work on getting some other patches in there, so I can try and continue my old game.*

Thank you for the nudging and prodding, I suppose. ;)

EDIT: *That was a failure though.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2857
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Howto apply a patch/diff file

Post by ChillCore »

*That was a failure though.
That happens sometimes if you change savegameformat.
Your long lasting games may or may not work with your new patches.
Too bad.
Thank you for the nudging and prodding, I suppose.
Nudging is my middle name, no prob.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Melfice
Transport Coordinator
Transport Coordinator
Posts: 305
Joined: 20 Apr 2006 19:11
Location: Oldenzaal, the Netherlands, gateway to Germany

Re: Howto apply a patch/diff file

Post by Melfice »

ChillCore wrote: That happens sometimes if you change savegameformat.
Your long lasting games may or may not work with your new patches.
Too bad.
What I mean is, I got the eyecandy patch to work, with the old savegame as well.
However, when I tried to add the Improved Timetables patch everything in the list in TortoiseSVN is red. It just won't add, whatsoever.

I guess I'm doing something wrong here, or that Improved Timetables patch is just way over my head.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2857
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Howto apply a patch/diff file

Post by ChillCore »

Right click a red file.
Use red arrows to find conflicts bottom file is result.
Save,
Next file.
All grey?
Compile and hope.

For the how to solve conlicts ...
Wrong thread.
And i am not experienced enough to help you there much.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Melfice
Transport Coordinator
Transport Coordinator
Posts: 305
Joined: 20 Apr 2006 19:11
Location: Oldenzaal, the Netherlands, gateway to Germany

Re: Howto apply a patch/diff file

Post by Melfice »

Okay, thank you for your help.
If it doesn't work after all, well... eyecandy's just eyecandy. :)

Again, thank you!
User avatar
technosnorunt58
Engineer
Engineer
Posts: 79
Joined: 09 Nov 2008 00:59

Re: Howto apply a patch/diff file

Post by technosnorunt58 »

I don't know how to patch.
I run Vista,
I have TortouiseSVN,
And every time I try to patch
in TortouiseSVN it says
Patching Not Possible. ?(
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Howto apply a patch/diff file

Post by Alberth »

Saying 'it does not work' does not give any information.
Tell us what steps you have done so far, what step is failing, why you expect to happen, and what is actually happening.

(the forum (in particular this thread) and the wiki explains patching and working with tortoise in quite a lot of detail, you should be able to do a few steps)
User avatar
technosnorunt58
Engineer
Engineer
Posts: 79
Joined: 09 Nov 2008 00:59

Re: Howto apply a patch/diff file

Post by technosnorunt58 »

Way 1.1. Put the patch in the OpenTTD 7.0.0 Stable folder.
1.2. Right click on the patch.
1.3. Click apply patch.
1.4. Brouse for OpenTTD 7.0.0 Stable folder.
1.5. Look at the red files in TortouseSVN
1.6. Ignore that they're red.
1.7. Right click on the bottom white aria.
1.8. Click patch all.
1.9. It says cannot patch file
2.0. Try (unsucessfully) to close out of TortouseSVN.
2.1. Try to ignore it.
2.2. Open task manager.
2.3. Manually close out.

Way 2.1. Keep patch werever it was.
2.2. Create new folder.
2.3. Right click on the new folder.
2.4. Click TortouseSVN Checkout.
2.5. Download from trunk.openttd.org er somthing like that.
2.6. Wait
2.7. Look at the red files in TortouseSVN
2.8. Ignore that they're red.
2.9. Right click on the bottom white aria.
3.0. Click patch all.
3.1. It says unresolved conflict.
3.2. I click ok.
3.3. Try (unsucessfully) to close out of TortouseSVN.
3.4. Try to ignore it.
3.5. Open task manager.
3.6. Manually close out.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

technosnorunt58 wrote:Download from trunk.openttd.org er somthing like that.
"Or something like that" is not a valid phrase in a bug report.
technosnorunt58 wrote:Ignore that they're red.
What documentation suggests that this step is correct?
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
Andreander
Engineer
Engineer
Posts: 24
Joined: 27 Jun 2007 16:23
Location: Evil Lair, Norway

Re: Howto apply a patch/diff file

Post by Andreander »

Odd you didn't pick up on the version number, DaleStan
OpenTTD 7.0.0
Hope you're not losing your touch
We're all scared. You hid in that ditch because you think there's still hope. The only hope you have is to accept the fact that you're already dead. And the sooner you accept that, the sooner you'll be able to function as a soldier is supposed to function. Without mercy. Without compassion. Without remorse. All war depends on it

- Captain Ronald Speirs E CO 2nd BATL 506th REG 101st airborne div 8th core 1st ARMY
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

If we're being picky, I also didn't pick up on "Brouse", "TortouseSVN", "aria", "unsucessfully", "werever", "er", or "somthing".
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
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Howto apply a patch/diff file

Post by Alberth »

technosnorunt58 wrote:1.6. Ignore that they're red.
technosnorunt58 wrote:2.8. Ignore that they're red.
If something is red, it usually means that you need to do something about it.

Unfortunately for you, just clicking at buttons in an application will not solve the problem. You 'll need to open the red files with an editor, figure out what is wrong, and fix the problem. Usually you will need to understand the program code to do this.
User avatar
technosnorunt58
Engineer
Engineer
Posts: 79
Joined: 09 Nov 2008 00:59

Re: Howto apply a patch/diff file

Post by technosnorunt58 »

1. That happens every time.
2. I cant' code yet.
3. Why are people about Xbox 360's in this fourm?
Melfice
Transport Coordinator
Transport Coordinator
Posts: 305
Joined: 20 Apr 2006 19:11
Location: Oldenzaal, the Netherlands, gateway to Germany

Re: Howto apply a patch/diff file

Post by Melfice »

technosnorunt58 wrote:1. That happens every time.
2. I cant' code yet.
3. Why are people about Xbox 360's in this fourm?
1) Then every time you try to apply a patch, something is conflicting with either the original code or a different patch.
2) You're sadly out of luck until somebody creates a binary with all the patches you want and publishes it here on the forums; you convince somebody to invest their time to make a binary with the patches you want , or you learn coding yourself.
Honestly, I can't code either, and I've accepted that. Simple patches I can apply, but it goes WAY over my head after that.
3) Somebody got confused about where to post, I'm guessing.
User avatar
technosnorunt58
Engineer
Engineer
Posts: 79
Joined: 09 Nov 2008 00:59

Re: Howto apply a patch/diff file

Post by technosnorunt58 »

:cry: Ok.
Well time to lern C++.
What are simple patches?

Thanks.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

$ cat file.patch | wc -l

If the number is small, the patch is simple.
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
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Howto apply a patch/diff file

Post by Alberth »

First try writing a few example programs with the C++ book, compile them, and run them.
After you did that a few times, try getting the source code of OpenTTD and compile that (and run it of course !)

If you got that working, you can try applying a small (in size/number of lines, as DaleStan suggested) patch and see whether you can get that working. Along the way read about subversion (our version control system), and most of our wiki about development.
User avatar
technosnorunt58
Engineer
Engineer
Posts: 79
Joined: 09 Nov 2008 00:59

Re: Howto apply a patch/diff file

Post by technosnorunt58 »

Applying a patch it says somthing about virsion controle.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

DaleStan wrote:"Or something like that" is not a valid phrase in a bug report.
Let me rephrase that:
The word "something", and any misspellings thereof, has no business in any bug or problem report unless it is part of the quoted output of the program in which the bug exists or with which you are having a problem.
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
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Howto apply a patch/diff file

Post by Alberth »

Didn't I mention something with 'reading' and 'version control system'?

You know, turn your computer OFF, get a book (you know the concept eh? see also http://en.wikipedia.org/wiki/Book) about C++ and about subversion, and read both from cover to cover (probably 2 or 3 times before you understand all of it).
If you are so hooked on your computer that turning it off seems like murder to you, find 4-5 PDF files on each subject, and read all of them completely 2-3 times.
While you are at it, the web-page about 'smart questions' in the signature of DaleStan is also a good read. It explains the do's and dont's of asking a question.

Do LOTS of experimenting at your own machine. Write a program, compile it, modify it, make a repository, commit changes in it, make a patch, apply a patch to your program.


We don't mind answering questions, but only if you show that you are actually making an effort to solve the problem.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Bing [Bot] and 9 guests