You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Chia-liang Kao <cl...@clkao.org> on 2003/11/26 05:14:20 UTC

[PATCH] dir_delta content check

Revised patch with cmpilato's comments and additional md5 check.

Avoid dir_delta from calling apply_textdelta that is actually noop
with ignore_ancestry is on. This makes many things work better in the
case of two mutually merged branches, since editors now know the
source and target stream are the same without having to construct the
fulltext from the noop txdelta. svn diff the two branches will no
longer show a lot of empty diffs.

* libsvn_repos/delta.c
  (compare_files): New.
  (delta_files): Use compare_files instead of svn_fs_contents_changed
  with ignore_ancestry is on.


Re: [PATCH] dir_delta content check

Posted by "C. Michael Pilato" <cm...@collab.net>.
Chia-liang Kao <cl...@clkao.org> writes:

> Revised patch with cmpilato's comments and additional md5 check.
> 
> Avoid dir_delta from calling apply_textdelta that is actually noop
> with ignore_ancestry is on. This makes many things work better in the
> case of two mutually merged branches, since editors now know the
> source and target stream are the same without having to construct the
> fulltext from the noop txdelta. svn diff the two branches will no
> longer show a lot of empty diffs.
> 
> * libsvn_repos/delta.c
>   (compare_files): New.
>   (delta_files): Use compare_files instead of svn_fs_contents_changed
>   with ignore_ancestry is on.

I'll review and apply this soon.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] dir_delta content check

Posted by "C. Michael Pilato" <cm...@collab.net>.
Greg Hudson <gh...@MIT.EDU> writes:

> (It also means: whenever you use an apostrophe with a pronoun,
> you're using a contraction, not a possessive.  :) )

An indication of my state of mind at the time, I can assure you.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: OT: apostrophes [was: Re: [PATCH] dir_delta content check]

Posted by kf...@collab.net.
Julian Foad <ju...@btopenworld.com> writes:
> If Greg's statement is correct, then it needs some further
> explanation as most of us have forgotton what might originally have
> come between the "Greg" and the "s" before it was deemed to be just
> the way we write a possessive.

I have the answer to your question, actually.

But please mail me privately for details; this is getting far away
from Subversion now, so we shouldn't bore the rest of the list with
it :-).

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

OT: apostrophes [was: Re: [PATCH] dir_delta content check]

Posted by Julian Foad <ju...@btopenworld.com>.
Greg Noel wrote:
> On Wednesday, Nov 26, 2003, at 08:19 US/Pacific, Greg Hudson wrote:
> 
>> ...  (It also means: whenever you use an apostrophe with a pronoun, 
>> you're using a contraction, not a possessive. :) )
> 
> Ah, that's close, but not quite right.  It really means: whenever you 
> use an apostrophe, you're using a contraction.  There's no need to 
> embroider it with qualifications about pronouns or possessives; it's the 
> same rule in all cases.
> 
> This is the Rule of the Apostrophe and it's by far the most regular rule 
> in English.  There's only one exception, and that's so rare that you 
> will probably never encounter it in a lifetime of writing.
> 
> The Rule of the Apostrophe is so simple that it appalls me that it's 
> abused so often.  Yes, I know that illiteracy is rampant, but this rule 
> is so easy to use correctly that there's no excuse for getting it wrong.
> 
> Whenever you use an apostrophe, you're using a contraction.  Period.

If Greg's statement is correct, then it needs some further explanation as most of us have forgotton what might originally have come between the "Greg" and the "s" before it was deemed to be just the way we write a possessive.

- Julian


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] dir_delta content check

Posted by Greg Noel <Gr...@san.rr.com>.
On Wednesday, Nov 26, 2003, at 08:19 US/Pacific, Greg Hudson wrote:

> ...  (It also means: whenever you use an apostrophe with a pronoun, 
> you're using a contraction, not a possessive. :) )

Ah, that's close, but not quite right.  It really means: whenever you 
use an apostrophe, you're using a contraction.  There's no need to 
embroider it with qualifications about pronouns or possessives; it's 
the same rule in all cases.

This is the Rule of the Apostrophe and it's by far the most regular 
rule in English.  There's only one exception, and that's so rare that 
you will probably never encounter it in a lifetime of writing.

The Rule of the Apostrophe is so simple that it appalls me that it's 
abused so often.  Yes, I know that illiteracy is rampant, but this rule 
is so easy to use correctly that there's no excuse for getting it wrong.

Whenever you use an apostrophe, you're using a contraction.  Period.

-- Greg Noel, retired UNIX guru


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] dir_delta content check

Posted by Greg Hudson <gh...@MIT.EDU>.
On Wed, 2003-11-26 at 03:19, C. Michael Pilato wrote:
> I mean,
> is there ever a time for any update-ish operation (update, switch,
> diff, merge, status -u) where it's important to know the difference
> between "this thing's contents have changed, but the result is a
> no-op" and "this things contents have no changed" ?

I don't think so.  It should be fine to always say the latter.

From another message:
> I still have some remaining doubt and confusion about textdeltas.  My
> assumption here is that the goal of a textdelta (in the general case)
> is to inform you about how to construct some fulltext given some other
> fulltext.  What is the expected outcome from a no-op textdelta then (a
> single, NULL window)?  Does that mean, "You're final outcome should be
> the empty file", or "You're final outcome is exactly the same as your
> source file"?

I think you got here on your own, but it means: "your final outcome
should be the empty file."  (It also means: whenever you use an
apostrophe with a pronoun, you're using a contraction, not a possessive.
:) )


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] dir_delta content check

Posted by "C. Michael Pilato" <cm...@collab.net>.
Chia-liang Kao <cl...@clkao.org> writes:

> Revised patch with cmpilato's comments and additional md5 check.
> 
> Avoid dir_delta from calling apply_textdelta that is actually noop
> with ignore_ancestry is on. This makes many things work better in the
> case of two mutually merged branches, since editors now know the
> source and target stream are the same without having to construct the
> fulltext from the noop txdelta. svn diff the two branches will no
> longer show a lot of empty diffs.
> 
> * libsvn_repos/delta.c
>   (compare_files): New.
>   (delta_files): Use compare_files instead of svn_fs_contents_changed
>   with ignore_ancestry is on.

Okay, I've cleaned up your patch (added lots of commentary, and fixed
some style things).  And now it has been committed as revision 7852.

Dude.  This sped up my test-cases by some 300% !!

So, let me start a theoretical discussion (open to any watching eyes).
I like that this is symmetrical with how commits work -- are there any
reasons why we wouldn't want dir-delta to *always* do this?  I mean,
is there ever a time for any update-ish operation (update, switch,
diff, merge, status -u) where it's important to know the difference
between "this thing's contents have changed, but the result is a
no-op" and "this things contents have no changed" ?

Update and switch don't care, because they just do contextual merges
of the textdeltas anyway.  Diff and merge certainly don't.  Status is
iffy -- we have a field in the status structure for
repos_text_changed.  But then again, we also have a
repos_prop_changed(), and it only gets set if there were real diffs in
the properties, not just because the props were touched.

Therefore, I'm seriously tempted to make dir-delta always use this new
code.

NOTE: Before anyone suggests modifying svn_fs_contents_changed() to do
this more careful checking -- don't.  The repository dumper code
actually does want to preserve the history of whether edits -- if even
no-ops -- happened on a node's props or contents, so the functionality
provided by svn_fs_props_changed() and svn_fs_contents_changed() must
remain unchanged (though, the API promises need a *serious* overhaul).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org