Author Topic: How to patch with SVN difference  (Read 4889 times)

|MoT|Erfe555

  • Posts: 75
  • Turrets: +2/-4
How to patch with SVN difference
« on: June 30, 2009, 12:29:55 am »
Hi all.
Thx to the other topic i can make my own qvm.
But i have another problem, well no...a simple question.
I patch the SVN (revision 966) with all the Invasion patches so i have the SVN of invasion, but there are some patch that there aren't made for that specific revison of SVN, an example:

I have my SVN revision 966, i want to apply the ESD.patch but this patch is made for SVN revision 35...how can i patch this SVN 966 with that patch?

A friend of mine tell me that i have to open the patch like a .cfg file and simply to copy the C source code of the patch in the specific file of the SVN.
Is really? And if it is really...is there a method to convert the patch to the new revision of the SVN (966 in specific)?

Thx! ;)

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: How to patch with SVN difference
« Reply #1 on: June 30, 2009, 12:46:22 pm »
Revision 35 of what?
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

|MoT|Erfe555

  • Posts: 75
  • Turrets: +2/-4
Re: How to patch with SVN difference
« Reply #2 on: June 30, 2009, 12:52:38 pm »
of the SVN... ::)

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: How to patch with SVN difference
« Reply #3 on: June 30, 2009, 04:24:53 pm »
r35 of tremulous is 8 years old.  There are no current patches for that.
The patch you have is against a different SVN, you need to find out which one, and which revision of tremulous that's based off.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

|MoT|Erfe555

  • Posts: 75
  • Turrets: +2/-4
Re: How to patch with SVN difference
« Reply #4 on: June 30, 2009, 04:54:02 pm »
How can i do this?
And i can use that procedure explain up? (First post, to copy the C source code of the patch...) ???

|MoT|Erfe555

  • Posts: 75
  • Turrets: +2/-4
Re: How to patch with SVN difference
« Reply #5 on: June 30, 2009, 07:03:29 pm »
News.

I try to copy the souce code in C of the patch into the SVN 966 but without results...only errors of compiling...I'm depressed.
Plzzzzz help  :'( :'( :'(

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: How to patch with SVN difference
« Reply #6 on: June 30, 2009, 08:55:01 pm »
If you have a patch that is based on a different SVN revision than you have, then you should first try to apply the patch as usual. 95% of the code is unchanged between different SVN versions, so the chances are pretty good that most of the patch can be applied.
For any file that cannot be automatically patched you will get a .rej file containing only the part of the patch that cannot be applied automatically.
(On Unix you can run "find . -name '*.rej' -print" to find these files.)

Then you have to apply the contents of the .rej files manually. In the file you will usually have something like this:
Code: [Select]
--- src/game/g_buildable.c (Revision 1132)
+++ src/game/g_buildable.c (Arbeitskopie)
@@ -532,7 +557,7 @@
   if( ( self->timestamp + 10000 ) > level.time )
     self->nextthink = level.time + 500;
   else //creep has died
-    G_FreeEntity( self );
+    delayedFree( self );
 }
 

The top two lines tell you the patched file name, the third row the position of the changed block in both files.
The following lines start either with a + or a - or a space. The lines marked with + are added lines, the lines marked with - are deleted lines and the lines marked with spaces are unchanged.

Usually the positions don't match exactly, but they give you a hint where you have to look. You should search for a piece of code that looks like the original code (only lines marked with - or space) and then add/remove the lines marked with + resp. - from the patch. (Of course you must not add the + character to the .c file.)

Having a basic understanding of C is strongly recommended to do this, or you may screw up the code.

|MoT|Erfe555

  • Posts: 75
  • Turrets: +2/-4
Re: How to patch with SVN difference
« Reply #7 on: June 30, 2009, 11:16:25 pm »
Thx i don't know this method!
You're great gimhael! :D
Thx thx thx! ;D