subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From artag...@apache.org
Subject svn commit: r966851 - /subversion/trunk/subversion/svnrdump/svnrdump.c
Date Thu, 22 Jul 2010 20:43:38 GMT
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));
 
       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")));
+      SVNRDUMP_ERR(usage(argv[0], pool));
+      exit(EXIT_FAILURE);
+    }
 
   SVNRDUMP_ERR(replay_range(session, url, start_revision, end_revision,
                             quiet, pool));



Mime
View raw message