[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-10 01:39:58 CET

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

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 <file> <reject_file>

It creates:

   <file>.orig # the file before you or your nemesis changed it
   <file>.repos # the file as it appears in the repository
   <file>.local # your local file; only your changes

and it changes your <file> to include diff3 markers, that look like this:

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

It /should/ handle paths properly; IE,

   patchify.rb some/relative/path/file 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 refuses
to apply the patch and complains if any of the <file>.xxxx files exist. 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

iD8DBQE8ZcFeP0KxygnleI8RAhbOAKCR4TbIPX0awmDIn5Hy/hMcwBUbJwCfdkXE
hTEeLXX/EPmzbqw0tm8lSX8=
=yuAc
-----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.