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

Re: [RFC] svn patch --patch-cmd

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 27 Apr 2009 13:55:09 +0100

On Mon, Apr 27, 2009 at 10:37:44AM +0200, Greg Stein wrote:
> On Mon, Apr 27, 2009 at 02:28, Arfrever Frehtes Taifersar Arahesis
> <Arfrever.FTA_at_gmail.com> wrote:
> > `svn patch` command accepts '--patch-cmd' option, but currently this option
> > doesn't do anything.
> >
> > Some other commands accept similar options:
> > svn cleanup --diff3-cmd
> > svn diff --diff-cmd
> > svn merge --diff3-cmd
> > svn switch --diff3-cmd
> > svn update --diff3-cmd
> > svn update --editor-cmd
> >
> > Do you think that `svn patch --patch-cmd` should be fixed to actually work
> > or that it should be removed?
>
> --patch-cmd should be removed. Unless/until we see a clear and
> convincing reason, we'll stick to the internal patch application
> process.

+1

That said, it still needs to be improved before it can go into a
release. The internal unidiff patch application stuff is not done yet.

Remaining issues:

1. Make hunks svn_stream_t instead of svn_string_t.
   Hunks can be very large (e.g. when adding or deleting an entire file).
   and we should not read them into memory entirely. Instead, we should
   use a stream that can either point to a buffer in memory (for small
   hunks) or to tempfiles (for large hunks).

2. We need to fix up any EOL-style mismatches between patch file and patch
   target file. Could be done after 1), because a translating stream
   wrapping a hunk stream would probably do the job.

3. Be smarter about applications of hunks. Right now, we just go and
   apply a hunk at the exact line it was at in the original file.
   A bit of forward/backward offset searching to eliminate conflicts
   if possible would be nice.

4. See remaining TODO markers in the code, if any.

I won't have time to continue to work on this during May.
If someone else wants to pick up the ball, please do so!
I will gladly review commits made to that code.
I expect to be working on it again from June/July on onwards.

> --editor-cmd should be removed. I have no idea what that is, and it is
> not used anyways.

It's probably the editor to be used when picking the (e)dit option
during interactive conflict resolution?

Stefan
Received on 2009-04-27 14:55:35 CEST

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.