You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Vijayaguru Guruchave <vi...@collab.net> on 2010/09/06 16:19:35 UTC

[PATCH]svnrdump to dump single specified revision

Hi,

'svnrdump dump -r n <URL>' dumps the revisions from 'n' to HEAD.The attached patch dumps the single specified revision alone.
[[[
  Log:
   svnrdump to dump the single specified revision.

  * subversion/svnrdump/svnrdump.c
     (main): Dump the single specified revision by assigning start_revision to end_revision while passing revision number to '-r' option.

  Patch by: Vijayaguru G <vi...@collab.net>
]]]

Thanks & Regards,
Vijayaguru


Re: [PATCH]svnrdump to dump single specified revision

Posted by Stefan Sperling <st...@elego.de>.
On Mon, Sep 06, 2010 at 09:53:24PM +0530, vijayaguru wrote:
> Attaching the patch,
> 
> Thanks & Regards,
> Vijayaguru

>From the output of svnrdump help dump:

  dump: usage: svnrdump dump URL [-r LOWER[:UPPER]]

  Dump revisions LOWER to UPPER of repository at remote URL to stdout in a 'dumpfile' portable format.
  If omitted, LOWER defaults to zero and UPPER to the latest latest revision.

So I don't think this patch is necessary. Instead, you can invoke svnrdump
like this: svnrdump dump -r42:42 URL

> Index: subversion/svnrdump/svnrdump.c
> ===================================================================
> --- subversion/svnrdump/svnrdump.c	(revision 993027)
> +++ subversion/svnrdump/svnrdump.c	(working copy)
> @@ -471,7 +471,10 @@
>                                                                  NULL, 10);
>                }
>              else
> +              {
>                opt_baton->start_revision = (svn_revnum_t)strtoul(opt_arg, NULL, 10);
> +              opt_baton->end_revision = opt_baton->start_revision;
> +              }
>            }
>            break;
>          case 'q':


One more remark you can keep in mind for future patches:
We usually use apr_atoi64() to parse numbers from a string. We should also
check for overflow. See the parse_offset() function in libsvn_diff/parse-diff.c
for an example.

Thanks,
Stefan

Re: [PATCH]svnrdump to dump single specified revision

Posted by Stefan Sperling <st...@elego.de>.
On Mon, Sep 06, 2010 at 09:53:24PM +0530, vijayaguru wrote:
> Attaching the patch,
> 
> Thanks & Regards,
> Vijayaguru

Re: [PATCH]svnrdump to dump single specified revision

Posted by vijayaguru <vi...@collab.net>.
Attaching the patch,

Thanks & Regards,
Vijayaguru
On Mon, 2010-09-06 at 21:49 +0530, Vijayaguru Guruchave wrote:
> Hi,
> 
> 'svnrdump dump -r n <URL>' dumps the revisions from 'n' to HEAD.The attached patch dumps the single specified revision alone.
> [[[
>   Log:
>    svnrdump to dump the single specified revision.
> 
>   * subversion/svnrdump/svnrdump.c
>      (main): Dump the single specified revision by assigning start_revision to end_revision while passing revision number to '-r' option.
> 
>   Patch by: Vijayaguru G <vi...@collab.net>
> ]]]
> 
> Thanks & Regards,
> Vijayaguru
> 


Re: [PATCH]svnrdump to dump single specified revision

Posted by vijayaguru <vi...@collab.net>.
Attaching the patch,

Thanks & Regards,
Vijayaguru
On Mon, 2010-09-06 at 21:49 +0530, Vijayaguru Guruchave wrote:
> Hi,
> 
> 'svnrdump dump -r n <URL>' dumps the revisions from 'n' to HEAD.The attached patch dumps the single specified revision alone.
> [[[
>   Log:
>    svnrdump to dump the single specified revision.
> 
>   * subversion/svnrdump/svnrdump.c
>      (main): Dump the single specified revision by assigning start_revision to end_revision while passing revision number to '-r' option.
> 
>   Patch by: Vijayaguru G <vi...@collab.net>
> ]]]
> 
> Thanks & Regards,
> Vijayaguru
> 


Re: [PATCH]svnrdump to dump single specified revision

Posted by Ramkumar Ramachandra <ar...@gmail.com>.
Hi Vijayguru,

Vijayaguru Guruchave writes:
> 'svnrdump dump -r n <URL>' dumps the revisions from 'n' to HEAD.The attached patch dumps the single specified revision alone.
> [[[
>   Log:
>    svnrdump to dump the single specified revision.
> 
>   * subversion/svnrdump/svnrdump.c
>      (main): Dump the single specified revision by assigning start_revision to end_revision while passing revision number to '-r' option.
> 
>   Patch by: Vijayaguru G <vi...@collab.net>
> ]]]

Thanks for the patch. Although this was intended behavior, I figured
that `svnadmin` follows the convention of your patch.

Committed to r993102:

Index: subversion/svnrdump/svnrdump.c
===================================================================
--- subversion/svnrdump/svnrdump.c	(revision 992366)
+++ subversion/svnrdump/svnrdump.c	(working copy)
@@ -58,8 +58,7 @@ static const svn_opt_subcommand_desc2_t svnrdump__
       N_("usage: svnrdump dump URL [-r LOWER[:UPPER]]\n\n"
          "Dump revisions LOWER to UPPER of repository at remote URL "
          "to stdout in a 'dumpfile' portable format.\n"
-         "If omitted, LOWER defaults to zero and UPPER to the latest "
-         "latest revision.\n"),
+         "If only LOWER is given, dump that one revision.\n"),
       { 0 } },
     { "load", load_cmd, { 0 },
       N_("usage: svnrdump load URL\n\n"
@@ -75,7 +74,7 @@ static const svn_opt_subcommand_desc2_t svnrdump__
 
 static const apr_getopt_option_t svnrdump__options[] =
   {
-    {"revision",     'r', 1, N_("REV1[:REV2] range of revisions to dump")},
+    {"revision",     'r', 1, N_("specify revision number ARG (or X:Y range)")},
     {"quiet",         'q', 0, N_("no progress (only errors) to stderr")},
     {"config-dir",    opt_config_dir, 1, N_("read user configuration files from"
                                             " directory ARG") },
@@ -471,7 +470,10 @@ main(int argc, const char **argv)
                                                                 NULL, 10);
               }
             else
-              opt_baton->start_revision = (svn_revnum_t)strtoul(opt_arg, NULL, 10);
+              {
+                opt_baton->start_revision = (svn_revnum_t)strtoul(opt_arg, NULL, 10);
+                opt_baton->end_revision = opt_baton->start_revision;
+              }
           }
           break;
         case 'q':