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

Re: Patch command execution

From: Sean Russell <ser_at_germane-software.com>
Date: 2002-02-09 02:16:32 CET

Hash: SHA1

I don't know what's up with me. This last message somehow lost the "g" on
"tigris.org". <sigh>

On Friday 08 February 2002 02:37 pm, Karl Fogel wrote:
> Nice! I'll paint the bikeshed by offering this
> >>>>>>>>>> ORIGINAL (revision X) >>>>>>>>>

Maybe I'll just make the format configurable; that's easy enough. Imagine
Joe P. Obfuscator's config file:

   original_tag = "if (x < %X) {"
   local_tag = "} else while (__var > %Y) {"
   repos_tag = "}"
   end_tag = "free( *q )"

> Are you doing this by scripting diff3, or writing it from scratch? (I
> haven't thought carefully about it, but it seems like this could be
> essentially a wrapper around diff3?)

I wish. Can we base this on diff3? I thought we specifically couldn't use
the diff tools because of licensing issues. If we can't embed the code into
SVN, I'd rather not base utility scripts on them either.

In any case, I don't know much about diff3, but the superficial problem is
that, by the time we're doing the merges, we've lost the original file; all
we have are the diffs in the .rej file. So, I'd have to reconstruct the
original file from the repository file and then do a three-way diff using
diff3, if that's possible.

No, I was cheating. The lines in .rej are essentially the lines from the
original file (the first sub-block) and the lines from the repository file
(the second sub-block) -- if you strip the initial two characters. I parse
that, then do an 'svn diff' on the file and parse that for the areas in the
local file to change. Then I create a new file with the changes, copy the
local file to a backup (<file>_$$.local), and move the new file to the old
local file. At the end of all of this, you get (or will get, as soon as I
get a couple of bugs fixed):


where the first is the file with the conflict markers, the second is from
SVN, and the third is your local file before the conflict markers. IE, to
throw everything out the window and force your changes on the repository:

   rm -f original_file original_file.nnnnn.nnnnn.rej
   mv original_file.xxxxx.local original_file
   svn ci

- --
 |.. "Real programmers don't document. If it was hard to write, it should
<|> be hard to understand."
/|\ -- anon
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:05 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.