You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Joseph Dunn <jo...@colorado.edu> on 2004/03/22 06:44:17 UTC

possible bug in svnadmin

Greetings svn devs,
I was writing a script to dump a repository on a regular basis.  I wanted to use dates in the svnadmin dump command, but they don't work.  This was brought up on the #svn irc channel and I was told to send en email to the dev list.  To duplicate the problem simply take any svn respository and try to dump all revisions from a certain date forward.  According to the documentation anywhere that a revision number can be used a date in {} can be used.  However, although svnadmin dump checks the syntax of the date, but then dumps all revisions.  If anyone would like an example repository, I have a sample one, but I don't see what it can tell you that I can't.  Well, I'll use an svn log command to translate the dates into versions, but it'd be nice to be able to skip that step.  Let me know if you need any other information.

-Joe Dunn

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: PATCH: svnadmin revision specifiers [was Re: possible bug in svnadmin]

Posted by Ben Reser <be...@reser.org>.
On Fri, Mar 26, 2004 at 12:16:22AM +0000, Julian Foad wrote:
> I'll commit this in a couple of days if there are no objections.
> 
> I don't think we will port this to the 1.0 branch; it will appear first in 
> version 1.1.0.

Looks good to me.

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

PATCH: svnadmin revision specifiers [was Re: possible bug in svnadmin]

Posted by Julian Foad <ju...@btopenworld.com>.
Joseph Dunn wrote:
> My bored co-worker came up with a small patch to make svnadmin
> dump recognize dates.  We only tested it minimally, but it seems pretty
> straight forward.  I've just inlined it between the hash marks.

Inspired by this patch, I've gone on and written a more complete version, noticing that the same code was used in "svnadmin deltify" as well, and adding validation to reject forms like "-rBASE".

I'll commit this in a couple of days if there are no objections.

I don't think we will port this to the 1.0 branch; it will appear first in version 1.1.0.

- Julian


> On Mon, 22 Mar 2004, Julian Foad wrote:
> 
>>Thanks for reporting this.  I can see in the code that the function 'subcommand_dump' does not currently handle the '{DATE}' method of specifying a revision.  Unfortunately it does not throw an error, and just ignores the revision specification.  It should throw an error for any revision specification that it cannot handle: not just dates, but also 'COMMITTED' etc.


Re: possible bug in svnadmin

Posted by Julian Foad <ju...@btopenworld.com>.
Joseph Dunn wrote:
> My bored co-worker came up with a small patch to make svnadmin
> dump recognize dates.  We only tested it minimally, but it seems pretty
> straight forward.  I've just inlined it between the hash marks.

That looks OK (except for white space style).  Ideally, as I mentioned, it should also throw an error for the other types of revision specification that are still not recognised, but that could be done as a separate improvement by somebody else.

- Julian


> ##################################################
> diff -Nuar subversion-1.0.1/subversion/svnadmin/main.c subversion-1.0.1.mod/subversion/svnadmin/main.c
> --- subversion-1.0.1/subversion/svnadmin/main.c	2004-03-22 11:51:50.000000000 -0700
> +++ subversion-1.0.1.mod/subversion/svnadmin/main.c	2004-03-22 11:16:47.000000000 -0700
> @@ -451,6 +451,9 @@
>      lower = opt_state->start_revision.value.number;
>    else if (opt_state->start_revision.kind == svn_opt_revision_head)
>      lower = youngest;
> +  else if (opt_state->start_revision.kind == svn_opt_revision_date)
> +    SVN_ERR (svn_repos_dated_revision(&lower, repos,
> +        opt_state->start_revision.value.date, pool));
>    else
>      lower = SVN_INVALID_REVNUM;
> 
> @@ -458,6 +461,9 @@
>      upper = opt_state->end_revision.value.number;
>    else if (opt_state->end_revision.kind == svn_opt_revision_head)
>      upper = youngest;
> +  else if (opt_state->end_revision.kind == svn_opt_revision_date)
> +    SVN_ERR (svn_repos_dated_revision(&upper, repos,
> +        opt_state->end_revision.value.date, pool));
>    else
>      upper = SVN_INVALID_REVNUM;
> 
> #################################################
> On Mon, 22 Mar 2004, Julian Foad wrote:
> 
>>Joseph Dunn wrote:
>>
>>>I was writing a script to dump a repository on a regular basis.  I wanted to use dates in the svnadmin dump command, but they don't work.  This was brought up on the #svn irc channel and I was told to send en email to the dev list.  To duplicate the problem simply take any svn respository and try to dump all revisions from a certain date forward.  According to the documentation anywhere that a revision number can be used a date in {} can be used.  However, although svnadmin dump checks the syntax of the date, but then dumps all revisions.  If anyone would like an example repository, I have a sample one, but I don't see what it can tell you that I can't.  Well, I'll use an svn log command to translate the dates into versions, but it'd be nice to be able to skip that step.  Let me know if you need any other information.
>>
>>Thanks for reporting this.  I can see in the code that the function 'subcommand_dump' does not currently handle the '{DATE}' method of specifying a revision.  Unfortunately it does not throw an error, and just ignores the revision specification.  It should throw an error for any revision specification that it cannot handle: not just dates, but also 'COMMITTED' etc.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: possible bug in svnadmin

Posted by Joseph Dunn <Jo...@Colorado.EDU>.
My bored co-worker came up with a small patch to make svnadmin
dump recognize dates.  We only tested it minimally, but it seems pretty
straight forward.  I've just inlined it between the hash marks.
-Joe

##################################################
diff -Naur subversion-1.0.1/subversion/svnadmin/main.c subversion-1.0.1.mod/subversion/svnadmin/main.c
--- subversion-1.0.1/subversion/svnadmin/main.c	2004-03-22 11:51:50.000000000 -0700
+++ subversion-1.0.1.mod/subversion/svnadmin/main.c	2004-03-22 11:16:47.000000000 -0700
@@ -451,6 +451,9 @@
     lower = opt_state->start_revision.value.number;
   else if (opt_state->start_revision.kind == svn_opt_revision_head)
     lower = youngest;
+  else if (opt_state->start_revision.kind == svn_opt_revision_date)
+    SVN_ERR (svn_repos_dated_revision(&lower, repos,
+        opt_state->start_revision.value.date, pool));
   else
     lower = SVN_INVALID_REVNUM;

@@ -458,6 +461,9 @@
     upper = opt_state->end_revision.value.number;
   else if (opt_state->end_revision.kind == svn_opt_revision_head)
     upper = youngest;
+  else if (opt_state->end_revision.kind == svn_opt_revision_date)
+    SVN_ERR (svn_repos_dated_revision(&upper, repos,
+        opt_state->end_revision.value.date, pool));
   else
     upper = SVN_INVALID_REVNUM;

#################################################
On Mon, 22 Mar 2004, Julian Foad wrote:

> Joseph Dunn wrote:
> > I was writing a script to dump a repository on a regular basis.  I wanted to use dates in the svnadmin dump command, but they don't work.  This was brought up on the #svn irc channel and I was told to send en email to the dev list.  To duplicate the problem simply take any svn respository and try to dump all revisions from a certain date forward.  According to the documentation anywhere that a revision number can be used a date in {} can be used.  However, although svnadmin dump checks the syntax of the date, but then dumps all revisions.  If anyone would like an example repository, I have a sample one, but I don't see what it can tell you that I can't.  Well, I'll use an svn log command to translate the dates into versions, but it'd be nice to be able to skip that step.  Let me know if you need any other information.
>
> Thanks for reporting this.  I can see in the code that the function 'subcommand_dump' does not currently handle the '{DATE}' method of specifying a revision.  Unfortunately it does not throw an error, and just ignores the revision specification.  It should throw an error for any revision specification that it cannot handle: not just dates, but also 'COMMITTED' etc.
>
> - Julian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: possible bug in svnadmin

Posted by Julian Foad <ju...@btopenworld.com>.
Joseph Dunn wrote:
> Alright, so does this mean you'll fix it to throw the error, or to handle
> the date, or both?  From what you said I'm guessing the error will be
> thrown, and the date ignored.  Of course, I'd prefer if the date worked,
> but in the spirit of open source I'm guessing that's my problem =).

I carefully avoided saying what would be done, since I don't know!  I would also like to see the date option implemented, if possible, but am not offering to implement it.

- Julian


> On Mon, 22 Mar 2004, Julian Foad wrote:
> 
>>Joseph Dunn wrote:
>>
>>>I was writing a script to dump a repository on a regular basis.  I wanted to use dates in the svnadmin dump command, but they don't work.  This was brought up on the #svn irc channel and I was told to send en email to the dev list.  To duplicate the problem simply take any svn respository and try to dump all revisions from a certain date forward.  According to the documentation anywhere that a revision number can be used a date in {} can be used.  However, although svnadmin dump checks the syntax of the date, but then dumps all revisions.  If anyone would like an example repository, I have a sample one, but I don't see what it can tell you that I can't.  Well, I'll use an svn log command to translate the dates into versions, but it'd be nice to be able to skip that step.  Let me know if you need any other information.
>>
>>Thanks for reporting this.  I can see in the code that the function 'subcommand_dump' does not currently handle the '{DATE}' method of specifying a revision.  Unfortunately it does not throw an error, and just ignores the revision specification.  It should throw an error for any revision specification that it cannot handle: not just dates, but also 'COMMITTED' etc.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: possible bug in svnadmin

Posted by Joseph Dunn <Jo...@Colorado.EDU>.
Alright, so does this mean you'll fix it to throw the error, or to handle
the date, or both?  From what you said I'm guessing the error will be
thrown, and the date ignored.  Of course, I'd prefer if the date worked,
but in the spirit of open source I'm guessing that's my problem =).
-Joe

On Mon, 22 Mar 2004, Julian Foad wrote:

> Joseph Dunn wrote:
> > I was writing a script to dump a repository on a regular basis.  I wanted to use dates in the svnadmin dump command, but they don't work.  This was brought up on the #svn irc channel and I was told to send en email to the dev list.  To duplicate the problem simply take any svn respository and try to dump all revisions from a certain date forward.  According to the documentation anywhere that a revision number can be used a date in {} can be used.  However, although svnadmin dump checks the syntax of the date, but then dumps all revisions.  If anyone would like an example repository, I have a sample one, but I don't see what it can tell you that I can't.  Well, I'll use an svn log command to translate the dates into versions, but it'd be nice to be able to skip that step.  Let me know if you need any other information.
>
> Thanks for reporting this.  I can see in the code that the function 'subcommand_dump' does not currently handle the '{DATE}' method of specifying a revision.  Unfortunately it does not throw an error, and just ignores the revision specification.  It should throw an error for any revision specification that it cannot handle: not just dates, but also 'COMMITTED' etc.
>
> - Julian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: possible bug in svnadmin

Posted by Julian Foad <ju...@btopenworld.com>.
Joseph Dunn wrote:
> I was writing a script to dump a repository on a regular basis.  I wanted to use dates in the svnadmin dump command, but they don't work.  This was brought up on the #svn irc channel and I was told to send en email to the dev list.  To duplicate the problem simply take any svn respository and try to dump all revisions from a certain date forward.  According to the documentation anywhere that a revision number can be used a date in {} can be used.  However, although svnadmin dump checks the syntax of the date, but then dumps all revisions.  If anyone would like an example repository, I have a sample one, but I don't see what it can tell you that I can't.  Well, I'll use an svn log command to translate the dates into versions, but it'd be nice to be able to skip that step.  Let me know if you need any other information.

Thanks for reporting this.  I can see in the code that the function 'subcommand_dump' does not currently handle the '{DATE}' method of specifying a revision.  Unfortunately it does not throw an error, and just ignores the revision specification.  It should throw an error for any revision specification that it cannot handle: not just dates, but also 'COMMITTED' etc.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org