You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2002/01/22 20:35:47 UTC
server diffs and svn diff -rREV1:REV2
Hello
I have a fix for 'svn diff -rREV1:REV2' that copes with the new diffs
sent over ra_dav. It all works :-) except it breaks ra_local :-(
Consider a file at REV3 in the working copy. When asking for a REV1 to
REV2 diff, then it appears that ra_dav sends a diff that will
construct REV2 from REV3, but ra_local sends a diff that will
construct REV2 from REV1. [When using ra_dav the the
svn_ra_callbacks_t get_wc_prop function is invoked to determine the
working copy revision. This doesn't happen over ra_local.]
Am I right in thinking that ra_local sends diffs differently from
ra_dav?
Now I know how to cause ra_dav to mimic the ra_local behaviour, but
that is effectively disabling an ra_dav feature. It would also make
some of my new code redundant, which seems like a waste.
There doesn't seem to be a way within the editor to determine which
file is the baseline for the diff, I just have to know. Is passing an
ra_dav/ra_local flag into the function that creates the editor the
best way to do this?
--
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: server diffs and svn diff -rREV1:REV2
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Tue, Jan 22, 2002 at 02:27:56PM -0800, Greg Stein wrote:
> On Tue, Jan 22, 2002 at 03:53:00PM -0500, Garrett Rooney wrote:
> > On Tue, Jan 22, 2002 at 08:35:47PM +0000, Philip Martin wrote:
> >...
> > > Now I know how to cause ra_dav to mimic the ra_local behaviour, but
> > > that is effectively disabling an ra_dav feature. It would also make
> > > some of my new code redundant, which seems like a waste.
> >
> > (i haven't looked at this code at all, but...)
> >
> > why not change ra_local to have the same behavior as ra_dav?
>
> Cuz the ra_dav behavior is broken? :-)
*grin* i guess that's a good reason...
> >...
> > that just seems icky... i mean someday there might be more ra layers,
> > and we dont' want to have to adjust diff to handle all of them... the
> > whole point of the ra API is that it's supposed to look the same from
> > the point of view of the client libs.
>
> Right. We fix ra_dav then, so that get_file can operate the same across the
> various RA layers.
cool.
-garrett
--
garrett rooney Unix was not designed to stop you from
rooneg@electricjellyfish.net doing stupid things, because that would
http://electricjellyfish.net/ stop you from doing clever things.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: server diffs and svn diff -rREV1:REV2
Posted by Greg Stein <gs...@lyra.org>.
On Tue, Jan 22, 2002 at 03:53:00PM -0500, Garrett Rooney wrote:
> On Tue, Jan 22, 2002 at 08:35:47PM +0000, Philip Martin wrote:
>...
> > Now I know how to cause ra_dav to mimic the ra_local behaviour, but
> > that is effectively disabling an ra_dav feature. It would also make
> > some of my new code redundant, which seems like a waste.
>
> (i haven't looked at this code at all, but...)
>
> why not change ra_local to have the same behavior as ra_dav?
Cuz the ra_dav behavior is broken? :-)
Per my previous mail, it is returning an svndiff when it should be returning
a full text. To return a full text, it needs a new callback to get the
"delta base fulltext" to apply the incoming svndiff against.
>...
> that just seems icky... i mean someday there might be more ra layers,
> and we dont' want to have to adjust diff to handle all of them... the
> whole point of the ra API is that it's supposed to look the same from
> the point of view of the client libs.
Right. We fix ra_dav then, so that get_file can operate the same across the
various RA layers.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: server diffs and svn diff -rREV1:REV2
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Tue, Jan 22, 2002 at 08:35:47PM +0000, Philip Martin wrote:
> Hello
>
> I have a fix for 'svn diff -rREV1:REV2' that copes with the new diffs
> sent over ra_dav. It all works :-) except it breaks ra_local :-(
>
> Consider a file at REV3 in the working copy. When asking for a REV1 to
> REV2 diff, then it appears that ra_dav sends a diff that will
> construct REV2 from REV3, but ra_local sends a diff that will
> construct REV2 from REV1. [When using ra_dav the the
> svn_ra_callbacks_t get_wc_prop function is invoked to determine the
> working copy revision. This doesn't happen over ra_local.]
>
> Am I right in thinking that ra_local sends diffs differently from
> ra_dav?
>
> Now I know how to cause ra_dav to mimic the ra_local behaviour, but
> that is effectively disabling an ra_dav feature. It would also make
> some of my new code redundant, which seems like a waste.
(i haven't looked at this code at all, but...)
why not change ra_local to have the same behavior as ra_dav?
> There doesn't seem to be a way within the editor to determine which
> file is the baseline for the diff, I just have to know. Is passing an
> ra_dav/ra_local flag into the function that creates the editor the
> best way to do this?
that just seems icky... i mean someday there might be more ra layers,
and we dont' want to have to adjust diff to handle all of them... the
whole point of the ra API is that it's supposed to look the same from
the point of view of the client libs.
-garrett
--
garrett rooney Unix was not designed to stop you from
rooneg@electricjellyfish.net doing stupid things, because that would
http://electricjellyfish.net/ stop you from doing clever things.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: server diffs and svn diff -rREV1:REV2
Posted by Greg Stein <gs...@lyra.org>.
On Wed, Jan 23, 2002 at 12:06:50AM +0000, Philip Martin wrote:
> Greg Stein <gs...@lyra.org> writes:
>...
> > Hmm. The get_file() call needs to be changed. It shouldn't just return a
> > diff. How is the caller supposed to know whether they got a fulltext or a
> > diff?
>
> As far as I can see, because get_wc_prop() returned a non-null value!
> I can force ra_dav to return a full text by not providing a version
> when get_wc_prop() is called.
My question was rhetorical. A caller should *NOT* have to figure out whether
it receives an svndiff stream vs a fulltext based on whether get_wc_prop was
called!
In fact, if get_wc_prop is called, there is still *no* guarantee that you
didn't get a fulltext.
No... the problem lies in ra_dav's get_file() implementation. The spec
states that the file is written to the stream. The *fulltext* file. Thus,
ra_dav needs to build the fulltext based on the information it has (a prior
fulltext, specified by the get_wc_prop results) and the svndiff returned by
the server. With those two pieces, it can construct the new fulltext.
> > When I did the diff work, I realized that we probably want a callback that
> > says "give me the base fulltext that you said I have." e.g. if the client
> > provides wc-props for rev 5 of FOO, then the callback would return that
> > fulltext. The get_file function would then compose the fulltext with the
> > diff to provide the fulltext of rev R to the caller.
> >
> > The diff code would then get_file() two fulltexts and then diff them.
>
> No, it gets a single fulltext, and uses a diff to generate the second.
What diff? How does it get that?
I'm presuming the "gets a single fulltext" is done with get_file? And that
(today) it isn't returning a fulltext, so things break?
>...
> > > Now I know how to cause ra_dav to mimic the ra_local behaviour, but
> > > that is effectively disabling an ra_dav feature. It would also make
> > > some of my new code redundant, which seems like a waste.
> >
> > Turning off the diff-over-the-wire would suck. I think the problem is in
> > get_file, and the need for the extra callback.
>
> While the get_wc_prop() "trick" works it is not necessary.
What trick? I'm getting suspicious here...
> > > There doesn't seem to be a way within the editor to determine which
> > > file is the baseline for the diff, I just have to know. Is passing an
> > > ra_dav/ra_local flag into the function that creates the editor the
> > > best way to do this?
> >
> > I don't know how the "svn diff -r REV1:REV2" works. It seems that you always
> > have to fetch two full texts and have the client run diff over them (using
> > whatever options the user supplies; e.g. -u or -C)
>
> I have realised that when creating a REV2 version there is no need to
> prefer a wc to REV2 diff over a REV1 to REV2 diff. There is no a
> priori reason why one should be better than the other.
Correct. And if you try to tell the RA reporter that you have REV1, then you
better respond to get_wc_prop() with the props for REV1. And that could get
nasty.
And if you don't have the props, then you've just forced ra_dav into sending
a fulltext rather than a diff (say, against the wc).
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: server diffs and svn diff -rREV1:REV2
Posted by Philip Martin <ph...@codematters.co.uk>.
Greg Stein <gs...@lyra.org> writes:
> On Tue, Jan 22, 2002 at 08:35:47PM +0000, Philip Martin wrote:
> > Hello
> >
> > I have a fix for 'svn diff -rREV1:REV2' that copes with the new diffs
> > sent over ra_dav. It all works :-) except it breaks ra_local :-(
> >
> > Consider a file at REV3 in the working copy. When asking for a REV1 to
> > REV2 diff, then it appears that ra_dav sends a diff that will
> > construct REV2 from REV3, but ra_local sends a diff that will
> > construct REV2 from REV1. [When using ra_dav the the
> > svn_ra_callbacks_t get_wc_prop function is invoked to determine the
> > working copy revision. This doesn't happen over ra_local.]
>
> Hmm. The get_file() call needs to be changed. It shouldn't just return a
> diff. How is the caller supposed to know whether they got a fulltext or a
> diff?
As far as I can see, because get_wc_prop() returned a non-null value!
I can force ra_dav to return a full text by not providing a version
when get_wc_prop() is called.
>
> When I did the diff work, I realized that we probably want a callback that
> says "give me the base fulltext that you said I have." e.g. if the client
> provides wc-props for rev 5 of FOO, then the callback would return that
> fulltext. The get_file function would then compose the fulltext with the
> diff to provide the fulltext of rev R to the caller.
>
> The diff code would then get_file() two fulltexts and then diff them.
No, it gets a single fulltext, and uses a diff to generate the second.
>
> > Am I right in thinking that ra_local sends diffs differently from
> > ra_dav?
>
> ra_local will never return a diff against a working copy file. It just grabs
> the fulltext of the rev/path that you ask for.
That's what I thought.
>
> > Now I know how to cause ra_dav to mimic the ra_local behaviour, but
> > that is effectively disabling an ra_dav feature. It would also make
> > some of my new code redundant, which seems like a waste.
>
> Turning off the diff-over-the-wire would suck. I think the problem is in
> get_file, and the need for the extra callback.
While the get_wc_prop() "trick" works it is not necessary.
>
> > There doesn't seem to be a way within the editor to determine which
> > file is the baseline for the diff, I just have to know. Is passing an
> > ra_dav/ra_local flag into the function that creates the editor the
> > best way to do this?
>
> I don't know how the "svn diff -r REV1:REV2" works. It seems that you always
> have to fetch two full texts and have the client run diff over them (using
> whatever options the user supplies; e.g. -u or -C)
I have realised that when creating a REV2 version there is no need to
prefer a wc to REV2 diff over a REV1 to REV2 diff. There is no a
priori reason why one should be better than the other.
I think I have a solution; certainly all the tests, some new, pass
over ra_dav and ra_local. I'll check it in.
--
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: server diffs and svn diff -rREV1:REV2
Posted by Greg Stein <gs...@lyra.org>.
On Tue, Jan 22, 2002 at 08:35:47PM +0000, Philip Martin wrote:
> Hello
>
> I have a fix for 'svn diff -rREV1:REV2' that copes with the new diffs
> sent over ra_dav. It all works :-) except it breaks ra_local :-(
>
> Consider a file at REV3 in the working copy. When asking for a REV1 to
> REV2 diff, then it appears that ra_dav sends a diff that will
> construct REV2 from REV3, but ra_local sends a diff that will
> construct REV2 from REV1. [When using ra_dav the the
> svn_ra_callbacks_t get_wc_prop function is invoked to determine the
> working copy revision. This doesn't happen over ra_local.]
Hmm. The get_file() call needs to be changed. It shouldn't just return a
diff. How is the caller supposed to know whether they got a fulltext or a
diff?
When I did the diff work, I realized that we probably want a callback that
says "give me the base fulltext that you said I have." e.g. if the client
provides wc-props for rev 5 of FOO, then the callback would return that
fulltext. The get_file function would then compose the fulltext with the
diff to provide the fulltext of rev R to the caller.
The diff code would then get_file() two fulltexts and then diff them.
> Am I right in thinking that ra_local sends diffs differently from
> ra_dav?
ra_local will never return a diff against a working copy file. It just grabs
the fulltext of the rev/path that you ask for.
> Now I know how to cause ra_dav to mimic the ra_local behaviour, but
> that is effectively disabling an ra_dav feature. It would also make
> some of my new code redundant, which seems like a waste.
Turning off the diff-over-the-wire would suck. I think the problem is in
get_file, and the need for the extra callback.
> There doesn't seem to be a way within the editor to determine which
> file is the baseline for the diff, I just have to know. Is passing an
> ra_dav/ra_local flag into the function that creates the editor the
> best way to do this?
I don't know how the "svn diff -r REV1:REV2" works. It seems that you always
have to fetch two full texts and have the client run diff over them (using
whatever options the user supplies; e.g. -u or -C)
I'm not sure how I see this as an editor change. But that is probably
because I don't see how the editor plays into fetching the two full texts to
perform the diff.
[ you can't do a diff with the standard editor stuff because that would
deliver you delta windows or an svndiff -- no context ]
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org