You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <rh...@sharpsvn.net> on 2009/04/15 14:07:50 UTC

RE: export of invalid revision (issue #3400)

> -----Original Message-----
> From: Ryan Schmidt [mailto:subversion-2009a@ryandesign.com]
> Sent: woensdag 15 april 2009 14:25
> To: Jay Foad
> Cc: users@subversion.tigris.org
> Subject: Re: export of invalid revision
> 
> On Apr 15, 2009, at 06:27, Jay Foad wrote:
> 
> > I get:
> >
> > $ svn checkout -r 1000000
> > https://llvm.org/svn/llvm-project/llvm/trunk/include/llvm/ADT
> > svn: No such revision 1000000
> >
> > but:
> >
> > $ svn export -r 1000000
> > https://llvm.org/svn/llvm-project/llvm/trunk/include/llvm/ADT foo
> > A    foo
> > A    foo/ScopedHashTable.h
> > [...]
> > A    foo/APFloat.h
> > Exported revision 69159.
> >
> > Instead of diagnosing that I've asked for a valid revision, svn export
> > has quietly given me a different revision instead. Is this a bug?
> >
> > I'm using:
> >
> > $ svn --version
> > svn, version 1.5.1 (r32289)
> >    compiled Dec 31 2008, 06:38:09
> 
> Issue confirmed on svn 1.6.1 on Mac OS X 10.4.11.
> 
> "svn ls -r 1000000 DIRURL" also produces a listing, unexpectedly.
> 
> "svn cat -r 1000000 FILEURL" also produces the file contents,
> unexpectedly.
> 
> I would call these bugs.

Confirmed on svn 1.6.1. Also with svn info.

I'm not sure if I would call it a bug; moving this thread to dev@s.t.o for
further discussion on whether this is a bug or not.

All these functions use svn_client__ra_session_from_path() to parse the
revision conversion. This in turn calls svn_client__get_revision_number()
which has this code fragment:

/* Final check -- if our caller provided a youngest revision, and
  the number we wound up with is younger than that revision, we need
  to stick to our caller's idea of "youngest". */
  if (youngest_rev
      && SVN_IS_VALID_REVNUM(*youngest_rev)
      && SVN_IS_VALID_REVNUM(*revnum)
      && (*revnum > *youngest_rev))
    *revnum = *youngest_rev;


	Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1727669

Re: export of invalid revision (issue #3400)

Posted by Edmund Wong <ed...@kdtc.net>.
John Peacock wrote:
> Edmund Wong wrote:
>> 1) Assume the user meant that he/she wanted the latest
>>     revision but can't be bothered to find it out the
>>     hard way.  (Newbie question: How does one find out
>>     what the latest revision is, aside for doing a
>>     'svn update'?)
> 
> FWIW, -rHEAD always points to the latest revision.
> 

Thanks.

> I don't think we should support "magically" deciding what the user 
> "probably" meant, since they could have meant some completely different 
> repo, which actually has 10000+ revisions and were just in the wrong 
> directory (think about svn:externals)...

So basically giving an error message would suffice?

Edmund

PS: You guys certainly are lightning fast on the post. I only
just posted that.  I wish telecom customer reps were that
fast.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1728752

Re: export of invalid revision (issue #3400)

Posted by John Peacock <jo...@havurah-software.org>.
Edmund Wong wrote:
> 1) Assume the user meant that he/she wanted the latest
>     revision but can't be bothered to find it out the
>     hard way.  (Newbie question: How does one find out
>     what the latest revision is, aside for doing a
>     'svn update'?)

FWIW, -rHEAD always points to the latest revision.

I don't think we should support "magically" deciding what the user 
"probably" meant, since they could have meant some completely different 
repo, which actually has 10000+ revisions and were just in the wrong 
directory (think about svn:externals)...

John

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1728530

RE: export of invalid revision (issue #3400)

Posted by Bert Huijben <rh...@sharpsvn.net>.
> -----Original Message-----
> From: Edmund Wong [mailto:ed@kdtc.net]
> Sent: woensdag 15 april 2009 17:12
> To: dev@subversion.tigris.org
> Subject: Re: export of invalid revision (issue #3400)
> 
> Bert Huijben wrote:
> 
> >> I would call these bugs.
> >
> > Confirmed on svn 1.6.1. Also with svn info.
> >
> > I'm not sure if I would call it a bug; moving this thread to dev@s.t.o
for
> > further discussion on whether this is a bug or not.
> 
> I suppose it depends on one's preference to how to take
> that 10000 or whatever number is being used and is way
> more than the current revision.
> 
> 1) Assume the user meant that he/she wanted the latest
>     revision but can't be bothered to find it out the
>     hard way. (Newbie question: How does one find out
>     what the latest revision is, aside for doing a
>     'svn update'?)
> 
> 2) Assume the user didn't know what was going on and
>     give him/her an error :
> 
>      "You've given me an invalid revision number."
> 
> The important issue here is consistency, IMHO.  A consistent
> behaviour of dealing with invalid (again, depends on
> point of view) input will help subversion be more
> effective.   Just my $0.02.
> 
> >
> > All these functions use svn_client__ra_session_from_path() to parse the
> > revision conversion. This in turn calls
svn_client__get_revision_number()
> > which has this code fragment:
> 
> But what I DO know from this issue and your response to
> it is the following:
> 
>    1) I still have WAYS to go in figuring this code out.
>    2) I was barking up the wrong tree.  I was looking at
>       the source code under libsvn_client/ and svn/.
> 
> > /* Final check -- if our caller provided a youngest revision, and
> >   the number we wound up with is younger than that revision, we need
> >   to stick to our caller's idea of "youngest". */
> >   if (youngest_rev
> >       && SVN_IS_VALID_REVNUM(*youngest_rev)
> >       && SVN_IS_VALID_REVNUM(*revnum)
> >       && (*revnum > *youngest_rev))
> >     *revnum = *youngest_rev;
> >
> 
> In any event, *if* it is a bug,  would it be considered
> a bite-sized one?  (This is coming from someone looking
> for 'easy' bite-size tasks without being too overwhelmed.
> i.e. issue 3342, which I'm still pondering.)

It would be bite sized.. The code to change is just this last block, which
should return an error instead of setting *revnum.

But changing it has a lot of impact on the rest of the code for users who
might expect the current behavior... So everything depends on whether
everyone agrees this is a bug... or not.

	Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1728814

Re: export of invalid revision (issue #3400)

Posted by Edmund Wong <ed...@kdtc.net>.
Bert Huijben wrote:

>> I would call these bugs.
> 
> Confirmed on svn 1.6.1. Also with svn info.
> 
> I'm not sure if I would call it a bug; moving this thread to dev@s.t.o for
> further discussion on whether this is a bug or not.

I suppose it depends on one's preference to how to take
that 10000 or whatever number is being used and is way
more than the current revision.

1) Assume the user meant that he/she wanted the latest
    revision but can't be bothered to find it out the
    hard way. (Newbie question: How does one find out
    what the latest revision is, aside for doing a
    'svn update'?)

2) Assume the user didn't know what was going on and
    give him/her an error :

     "You've given me an invalid revision number."

The important issue here is consistency, IMHO.  A consistent
behaviour of dealing with invalid (again, depends on
point of view) input will help subversion be more
effective.   Just my $0.02.

> 
> All these functions use svn_client__ra_session_from_path() to parse the
> revision conversion. This in turn calls svn_client__get_revision_number()
> which has this code fragment:

But what I DO know from this issue and your response to
it is the following:

   1) I still have WAYS to go in figuring this code out.
   2) I was barking up the wrong tree.  I was looking at
      the source code under libsvn_client/ and svn/.

> /* Final check -- if our caller provided a youngest revision, and
>   the number we wound up with is younger than that revision, we need
>   to stick to our caller's idea of "youngest". */
>   if (youngest_rev
>       && SVN_IS_VALID_REVNUM(*youngest_rev)
>       && SVN_IS_VALID_REVNUM(*revnum)
>       && (*revnum > *youngest_rev))
>     *revnum = *youngest_rev;
> 

In any event, *if* it is a bug,  would it be considered
a bite-sized one?  (This is coming from someone looking
for 'easy' bite-size tasks without being too overwhelmed.
i.e. issue 3342, which I'm still pondering.)

Again, just my humble $0.02.

Edmund

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1728399