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

patchify (a Patch command solution)

From: Sean Russell <ser_at_germane-software.com>
Date: 2002-02-11 10:32:08 CET

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm sorry if anybody sees this multiple times. Karl says he didn't see it,
so I'm reposting it.

=== ORIGINAL MESSAGE
Whew. That was /tons/ easier, but not nearly as gratifying.

Here's the script. It is a Ruby script, but lord knows that one of you could
convert it to [insert your favorite scripting language here] in about as long
as it took me to write it.

You run it thusly:

   patchify.rb <reject_file>

It takes advantage of the fact that the reject file is named
<file>.xxxxx.xxxxx.rej to figure out what the base file name is.

When it is done, you will have <file> and <file>.xxxxx.local, where your file
contains the CVS-like three-way diffs, and <file>.xxxxx.local is your file
before the diffs. If you ever get to trust this script, you can add the
argument "local_fname" to the "File.rm_f" line, third up from the bottom of
the script, and <file>.xxxxx.local will be removed automatically.

The diff markers look like this:

   a
   <<<<<<< ORIGINAL
   d
   ||||||| REPOS
   c
   =======
   b
>>>>>>> LOCAL
   c
   d

It /should/ handle paths properly; IE,

   patchify.rb some/relative/path/file.xxxxx.xxxxx.rej

should work, but I haven't tested it yet. Also, the .rej must be in the same
directory as the file, but I don't see that as being a problem. It
requires 'patch' and 'diff3'; patch to recreate the original source, and
diff3 to do everything else.

Attached, rather than quoted, to avoid formatting errors. Renaming it won't
hurt it.

- - --

 |.. I started out with nothing! I have most of it left.
<|>
/|\
/|
 |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8Z4+ZP0KxygnleI8RAgnZAJ92jgw6kHsSUzpabYa7IumwFvXUnQCgkges
G4O26qLj7PdeZZANehhRLMs=
=bpxq
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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:06 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.