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

Re: svn diff changes in progress

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-01-29 22:01:15 CET

<kfogel@collab.net> writes:

> + /* Sanity check. */
> + if ((start->kind == svn_client_revision_unspecified)
> + || (end->kind == svn_client_revision_unspecified))
> + {
> + return svn_error_create
> + (SVN_ERR_CLIENT_BAD_REVISION, 0, NULL, pool,
> + "svn_client_diff: caller failed to specify any revisions");
> + }

This is why I had second thoughts about adding unspecified to the
client interface. Using unspecified means that every client function
needs this sort of check, and yet in practice the application will
never pass in such a revision. Typical application pseudo-code

    if revision is unspecified
       revision = HEAD
    svn_client_update( revision )

and so the code in the library

    if revision is unspecified
       throw error

will never trigger.

Diff is awkward because at present it can take unspecified revisions,
however I would be happy to see code like

  if start_revision is unspecified and end_revision is not unspecified
     start_revision = CURRENT

  if start_revision is unspecified and end_revision is unspecified
     svn_diff_text_base_to_wc()

  else if end_revision is unspecified
     svn_diff_repos_to_wc( start_revision )

  else
     svn_diff_repos_to_repos( start_revision, end_revision )
   
in the application, so that diff doesn't require unspecified
revisions.

Philip

---------------------------------------------------------------------
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:01 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.