[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: Daniel Berlin <dan_at_dberlin.org>
Date: 2002-02-07 21:31:59 CET

On 7 Feb 2002, Ben Collins-Sussman wrote:

> Daniel Berlin <dan@dberlin.org> writes:
> > > > Given the requirement that it only support the default diff format svn
> > > > generates,
> > >
> > > ...whoa there. SVN sends its own binary diff format over the *wire*
> > > only. During an update, this binary diff is used to recreate a new
> > > pristine fulltext in .svn/tmp/. Then we use diff/patch to perform a
> > > *context* merge into the user's existing local mods.
> >
> > Yes, and i meant that given it only support the patch command executed to
> > do the context merge, ....
> Sorry, I'm not understanding. We use 'patch' to apply a context diff
> to a file. How has the problem gotten any smaller? Why is this not
> thes same as implementing 'patch' from scratch?

Because patch does a lot more than you think it does.

It has all kinds of code to intuit the patch type, grab revision
controlled files, etc.
, etc.
For instance, of the main files, pch.c, and patch.c, we have the
1913 lines of code in pch.c, we have
357 lines of code to intuit the diff types
100 lines to apply ed scripts

In fact, most of the code is handling input, munging around
indentation, etc.

Given only needing to support a known set of options, with known input
format (IE not much munging), it's actually pretty easy to rewrite from

> 'patch' require reimplementing 95% of Larry Wall's code?
It would be maybe 30-40%, at most.

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.