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

Re: svn rollback (Was: Re: svn commit: rev 2162 - ...)

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-06-12 21:59:17 CEST

Garrett Rooney <rooneg@electricjellyfish.net> writes:

> there is an 'svn_client_revision_working' which means (according to
> the header file) 'current, plus local mods'. i haven't pounded on
> this much, but if you pass it to merge it should generate a diff
> between what you have currently and whatever other revision you give
> it.
>
> /me crosses his finger since he hasn't delved too deeply into the code...

No, it doesn't do what you think. svn_client_revision_working is used
in the diff code, but the diff code has three separate paths, one for
diff with no revision, one for diff with one revision and one for diff
with two revisions. These paths are effectively three separate
implementations. The merge code is related to the diff code but only
implements the two revision path.

If your code works at all, I think you will find that it will take the
current base revision for whatever target path is given, and remove
the differences between that revision and the given revision from
everything under the target path. So going back to my mixed working
copy

% svn st -v wc
_ 7 7 pm ./wc
_ 8 6 pm ./wc/zig
_ 8 6 pm ./wc/zig/bar
_ 9 9 pm ./wc/zig/foo

A command like 'svn rollback -r5 wc' will subtract the revision 5 to 7
change from everything. It's not clear that this is correct, it won't
revert the revision 9 change in wc/zig/foo for example. Subtracting
the revision 5 to HEAD change is not obviously correct either, it may
do the wrong thing on wc/zig/bar as it will add the subtract the
revision 8 to HEAD changes but bar is only at revision 8.

To rollback a mixed revision working copy to a given revision is
hard. The diff code has an entire editor in libsvn_wc/diff.c to do it.
That's why I was curious when you claimed to have done it in 100
lines.

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 12 21:59:47 2002

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.