[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: AW: Applying a patch multiple times

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Fri, 03 Apr 2009 18:11:54 +0200

Yannick Berker wrote:
> Von: Stefan Küng [mailto:tortoisesvn_at_gmail.com]
>> It comes because the patch file only contains one line of context
>> to check the patch against. The second time the patch still can be
>> applied cleanly. That's just how it is: a patch file doesn't
>> contain the whole file but only the diff part with *some* context.
>> That reduced information of a patch file can lead to such
>> situations.
> Hello Stefan,
> Thank you for your answer. I can follow the second part of your
> answer, but not the first one. I have to add that I also encountered
> this problem with a patch file containing 3 lines of context before
> and after the line to add, so it's not the fact that my simple
> example has a reduced context size that causes this behavior. Please
> let me know if you need an example and I will create one for you.
> Though, staying with a slight changed version of my example: I now
> apply my patch to the file 1-5-3-4 - in a clear conflict with the
> 1-2-3-4 I want to obtain by patching. What I would now expect is the
> following: The context says to search for 1-3-4 and add 2 after 1.
> 1-3-4 is not in the file, so TortoiseSVN gets revision 1 which in
> every case contains the correct sequence and applies the patch to it
> (1-2-3-4) and tries to merge it with the WC. Obviously, there is a
> collision which is what I would expect to happen. Instead, it applies
> the patch directly to the WC (1-2-5-3-4). This cannot be intended -
> am I the only one thinking this way? I my opinion, TortoiseSVN should
> always load revision 1 from the repository because this is the file
> version the patch file was created with. This leaves the intelligent
> part of the patching process to the merge instead of the patch and
> would avoid the above error.

The function which applies a patch does also some guessing whether the
patch can be applied and how. If it finds that even though the context
lines don't match exactly (but still match with some 'tweaking') it
still applies the patch.
If you would use the patch.exe tool from the GNU tools, you would
discover that this one does even more 'guessing'.


  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].

Received on 2009-04-03 18:12:17 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.