Page 38 of 40

Re: Howto apply a patch/diff file

Posted: 29 Jan 2012 15:53
by Creat
planetmaker wrote:TortoiseSVN doesn't understand all kind of diff files, though.
I know that it is recommended by the Wiki for compiling on Windows to install TortoiseSVN to get the source. I was wondering if it wasn't time to change that. After all afaik it still can't handle git/hg patches, and most 'freelance' developers seem to use either one nowadays (and for good reason). To me the most obvious reason for compiling your own binaries is to incorporate patches (otherwise you could just use binaries, right?), which isn't going to work if a significant percentage of patches can't be applied with the suggested program. Even if someone uses the opportunity to implement something himself (and get into programming) a solid/modern version management surely would have to be favored...

I haven't personally used it, but wouldn't TortoiseGit be a better suggestion, if keeping the easy-to-use GUI is a requirement, which I would assume it is? After all the source is also available as a git repo and bigger patches themselves are published in git repos as well (CargoDist, YACD). Also I'm sure it is much more tolerant towards various patch formats (as git itself is more tolerant in that regard).

Re: Howto apply a patch/diff file

Posted: 29 Jan 2012 17:37
by Alberth
The master repository is still in subversion. Also, git has such nice, completely unreadable revision numbers. Hg is a bit better (incrementing decimal numbers, except the numbering is not the same as in subversion).

In my view, replacement is a step too far, but mentioning as alternative is certainly viable.
Please also explain how to get a given subversion revision number then. Most patches have a subversion revision number to patch against, so you must be able to update the git working copy to a given subversion revision number.

Re: Howto apply a patch/diff file

Posted: 13 Feb 2012 15:31
by Flowdy87
Hi.
I'm new and having some trouble applying a patch, im following the guide posted in this thread for using tortoiseSVN, The first part of the guide worked but when it came to applying the actual patch i right clicked on it and hit apply patch then i get a browse for folder screen which im assuming is the folder for OPENtt or am i wrong. if not when i link the open tt directory and click on i get a message saying

"This is not a working copy of open tt"

Now i don't know what else to do, im just to apply the patch to get the huge airports working.. Any help would be great. :)

Re: Howto apply a patch/diff file

Posted: 13 Feb 2012 15:42
by planetmaker
Flowdy87 wrote:Hi.
I'm new and having some trouble applying a patch, im following the guide posted in this thread for using tortoiseSVN, The first part of the guide worked but when it came to applying the actual patch i right clicked on it and hit apply patch then i get a browse for folder screen which im assuming is the folder for OPENtt or am i wrong. if not when i link the open tt directory and click on i get a message saying

"This is not a working copy of open tt"

Now i don't know what else to do, im just to apply the patch to get the huge airports working.. Any help would be great. :)
A "working copy" is in this context the source code of OpenTTD which you need / want to apply the patch to. It is NOT the binary you may have downloaded somewhere nor even from the official page.

Re: Howto apply a patch/diff file

Posted: 13 Feb 2012 18:37
by Flowdy87
Sorry i was doing it wrong :roll:

Although i do have another question as the first time round didnt work, im following MeusH tutorial on using tortoise svn, on attachment one when it says, x - location to your directory, which directory does this mean, the new folder your ment to make or the open ttd directory.

if so the open ttd directory didnt work and if its ment to be to the new folder where do i transfer the download and patches files to.

thanks

Re: Howto apply a patch/diff file

Posted: 13 Feb 2012 21:44
by Alberth
You patch against a directory with OpenTTD source code.

http://wiki.openttd.org/FAQ_development#Source_code explains what source code is, how to compile source code to an executable program, and then (and only then imho) you can start thinking about patching.

(Getting the source, and compiling the unmodified sources first is a good way to test your compiler setup. If you also apply patches before the first compile and it does not work, it becomes very hard to find the cause by remote help through a forum like this.)

Re: Howto apply a patch/diff file

Posted: 23 Apr 2012 19:50
by Eisenbaehr
Bjarni wrote:...

on most systems:

Code: Select all

patch -p0 -i file.diff
the -p option means how many leading dirs that you skip when patching. ... this would be 1, because you need to skip the trunk part of it to get to the root dir of your local source folder

...
Many thanks, for this help!

Re: Howto apply a patch/diff file

Posted: 22 Jan 2013 09:54
by JacobD88
Hi all,

Having a few problems installing the unzip package under MSYS
Error
Error
MinGWUnzipError1.png (14.85 KiB) Viewed 9453 times
Any help would be appreciated

Regards

Jacob

Re: Howto apply a patch/diff file

Posted: 22 Jan 2013 10:03
by cirdan
Could the package be called msys-unzip instead?

Re: Howto apply a patch/diff file

Posted: 22 Jan 2013 11:40
by JacobD88
Yep, that's the one :rolleyes:

Dunno where i got MySYS from :lol:

Thanks Cirdan, been a while since i compiled anything; only doing for your patch in fact :mrgreen:

Re: Howto apply a patch/diff file

Posted: 07 Feb 2013 18:04
by iconstil
Hi, I applied a simple diff file (town rating colors), but after that I cant play multiplayer games anymore. It says 'version mismatch' (red circle). Sorry for this noob question but is there any solution for this?
Or, if the patch only modifies the interface a bit (locally), it still says version mismatch so i cant play multiplayer games anymore. Do I need to reinstall, or is there any workaround for this issue?

Re: Howto apply a patch/diff file

Posted: 07 Feb 2013 18:40
by Eddi
you can only play multiplayer with people who have the exact same patch applied. there is no way around this, since we cannot know whether the patch is really "display only" or not.

Re: Howto apply a patch/diff file

Posted: 07 Feb 2013 19:02
by iconstil
But this is an open source program, so you can theoretically fake the version number, or anything is possible. I saw peaple who are playing with these patches in multiplayer.. (for example this colored town rating patch)

How the server knows for sure that I'm using the proper version, and not faking it..?

Re: Howto apply a patch/diff file

Posted: 07 Feb 2013 20:02
by Eddi
Even if that is possible, it is not supported, so we will not give any advice how to do it.

Re: Howto apply a patch/diff file

Posted: 17 Feb 2013 12:01
by jakob
Can anyone please tell me how i install patch files or diff files easy, and step by step, so i don't get confused :)

Re: Howto apply a patch/diff file

Posted: 17 Feb 2013 12:41
by planetmaker
The very first posting of this thread explains it quite thoroughly...

Yes, it needs understanding of how to compile the complete game from source code. But there is no other way. Source code patches don't work like "click, apply and play".

Re: Howto apply a patch/diff file

Posted: 17 Feb 2013 20:19
by Supercheese
jakob wrote:Can anyone please tell me how i install patch files or diff files easy, and step by step, so i don't get confused :)
1a) Follow these instructions: http://wiki.openttd.org/Microsoft_Visua ... s_Editions (They are very good instructions!)

Even if you have a 64-bit system, it's easier just to compile 32-bit binaries, so don't bother with the 64-bit stuff unless you really, really want to.

1b) Make sure you can successfully compile trunk OTTD

2) Download a patch file

3) Update the OTTD source to the revision specified by the patch (in Windows, right click > TortoiseSVN > Update to revision)

4) Right click patch, select TortoiseSVN > Apply Patch

5) Patch all the files and compile OTTD.

Bing boom, you've applied a patch. It might seem hard, but believe me, it is not excessively difficult. At least if you're running Windows 7 I can speak from experience. I used to think it was too hard, and now I can compile patched win32 binaries no prob. :)

Re: Howto apply a patch/diff file

Posted: 13 Apr 2013 13:59
by MisterX
Is there an easy way to patch the game? The first post of this thread means nothing to me. patch -p0 -i file.diff? Where is that about? etc. I clicked on the link and then on the two option for windows. Before you start to patch the game, you need to download a program of 5-10? Non of them mean anything to mean. Isn't there an easier way for them who are not study something in the ict? There must be an easier way then use first 5-10 programs before patching is finished...

Re: Howto apply a patch/diff file

Posted: 13 Apr 2013 14:13
by planetmaker
MisterX wrote:Is there an easy way to patch the game?
Patching the game yourself means you must be willing to get aquainted with the basics of compilation and programming. No easier way. There is not and will not be a one-click patch and play way ever.

Some (proprietary) games sometimes refer to download updates as patches which then simply can be applied. But that's actually wrong semantics.

Re: Howto apply a patch/diff file

Posted: 13 Apr 2013 14:38
by MisterX
1 click is also over the top. But now you need 6-7 tools?! For me, that's the other end... There must exist one program, so you can patch a game with one program? That's a lot easier. Now you have to learn 6-7 programs before you can patch a game. That must be a joke?!

Just looked at the programs:
Microsoft Visual C++ 2008/2010 -> Link to Microsoft Visual C++ 2012 for windows 8?! Sorry, but i'm running at windows 7...
The link to the source doesn't works and for me is it not clear if you have to download openttd-useful.zip or openttd-useful.zip and the source.
Subversion command line version -> Broken link.