Malcolm Rowe wrote:
> Could anyone explain the rationale behind our treatment of
> schedule-deleted files encountered during 'svn diff'? (I realise that
> using 'rationale' and 'diff' in the same sentence may provoke some humour,
> but presumably there is some reason for the current arrangement).
Malcolm, thanks for persisting with this awkward "diff" stuff.
You might find this idea a bit daunting, but I have been thinking for a long
time that a lot of the trouble and bugs in our implementation arise because the
logic for determining and traversing the two trees to compare is mixed up with
the logic for comparing them. It's partly separated, but not enough.
I feel it might be worth tackling the problem by designing and writing a
differencing engine (huh? I'm sure my history book said that had already been
invented :-)) that is driven in the same way for a repository diff, a local
diff of a repository-against-local diff.
Much of it is probably there already. Things to do include:
* See how the repos diff, the local diff and the mixed diff are driven, and
decide which method is the master method and convert the others to use that method.
* Ensure that the "from" and "to" trees are interchangeable, in that there are
no restrictions on which sorts of trees can be the "from" and which can be the
"to".
No small task, I know, but a load of goodness will fall out of it.
BTW, for your own testing you might like to try the attached patch which simply
adds a "WC" revision keyword so that you can try things like comparing "svn
diff 3:WC" with "svn diff WC:3" and see if there are any asymmetries that
indicate bugs. Some combinations, like "-rWC:BASE", aren't supported.
- Julian
Introduce the revision selector keyword "WC" to select the Working Copy.
* subversion/libsvn_subr/opt.c
(revision_from_word) Add keyword "WC".
Index: subversion/libsvn_subr/opt.c
===================================================================
--- subversion/libsvn_subr/opt.c (revision 8659)
+++ subversion/libsvn_subr/opt.c (working copy)
@@ -258,6 +258,8 @@
*
* - For "committed", set REVISION->kind to svn_opt_revision_committed.
*
+ * - For "wc", set REVISION->kind to svn_opt_revision_working.
+ *
* If match, return 0, else return -1 and don't touch REVISION.
*/
static int
@@ -279,6 +281,10 @@
{
revision->kind = svn_opt_revision_committed;
}
+ else if (strcasecmp (word, "wc") == 0)
+ {
+ revision->kind = svn_opt_revision_working;
+ }
else
return -1;
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Feb 13 20:53:13 2006