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

Re: svn commit: r966851 - /subversion/trunk/subversion/svnrdump/svnrdump.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 23 Jul 2010 10:43:06 +0300

artagnon_at_apache.org wrote on Thu, Jul 22, 2010 at 20:43:38 -0000:
> Author: artagnon
> Date: Thu Jul 22 20:43:38 2010
> New Revision: 966851
>
> URL: http://svn.apache.org/viewvc?rev=966851&view=rev
> Log:
> * subversion/svnrdump/svnrdump.c (main): Error out if UPPER refers to
> a non-existent revision.
>
> Modified:
> subversion/trunk/subversion/svnrdump/svnrdump.c
>
> Modified: subversion/trunk/subversion/svnrdump/svnrdump.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/svnrdump.c?rev=966851&r1=966850&r2=966851&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svnrdump/svnrdump.c (original)
> +++ subversion/trunk/subversion/svnrdump/svnrdump.c Thu Jul 22 20:43:38 2010
> @@ -214,7 +214,7 @@ replay_range(svn_ra_session_t *session,
> {
> SVN_ERR(svn_stream_printf(stdout_stream, pool,
> SVN_REPOS_DUMPFILE_REVISION_NUMBER
> - ": %d\n", start_revision));
> + ": %ld\n", start_revision));
>

Change is not in the log message. (strictly it isn't even a logical part of
this commit, but I'm not going to be *that* pedantic...)

> encoded_prophash = apr_hash_make(pool);
> propstring = svn_stringbuf_create("", pool);
> @@ -341,6 +341,7 @@ main(int argc, const char **argv)
> char *revision_cut = NULL;
> svn_revnum_t start_revision = svn_opt_revision_unspecified;
> svn_revnum_t end_revision = svn_opt_revision_unspecified;
> + svn_revnum_t latest_revision = svn_opt_revision_unspecified;
> svn_boolean_t quiet = FALSE;
> apr_pool_t *pool = NULL;
> svn_ra_session_t *session = NULL;
> @@ -445,10 +446,19 @@ main(int argc, const char **argv)
> pool));
>
> /* Have sane start_revision and end_revision defaults if unspecified */
> + SVNRDUMP_ERR(svn_ra_get_latest_revnum(session, &latest_revision, pool));
> if (start_revision == svn_opt_revision_unspecified)
> start_revision = 0;
> if (end_revision == svn_opt_revision_unspecified)
> - SVNRDUMP_ERR(svn_ra_get_latest_revnum(session, &end_revision, pool));
> + end_revision = latest_revision;
> + if (end_revision > latest_revision)
> + {
> + SVN_INT_ERR(svn_cmdline_fprintf(stderr, pool,
> + _("UPPER refers to"
> + "a non-existent revision.\n")));

No newline in error messages (see HACKING).

May want to say the revision number here? e.g.,

    "Revision %ld does not exist" % end_revision,

because someone who isn't already deep in the code + usage message of svnrdump
wouldn't know what UPPER is.

> + SVNRDUMP_ERR(usage(argv[0], pool));
> + exit(EXIT_FAILURE);
> + }
>
> SVNRDUMP_ERR(replay_range(session, url, start_revision, end_revision,
> quiet, pool));
>
>
Received on 2010-07-23 09:44:50 CEST

This is an archived mail posted to the Subversion Dev mailing list.