Tracker: Patches

5 Use filename@REV when using SVN 1.5 - ID: 2035057
Last Update: Comment added ( sits )

This patch detects SVN version in Subversion.pm and if using SVN 1.5, we use

svn cat filename@REV

instead of

svn cat --revision REV filename

This seems to work in all cases and there are cases where the latter doesn't work (particularly in cases where the file's path has been moved/deleted at some later point in the repository's lifetime).


Charles Lechasseur ( clechasseur ) - 2008-08-01 09:40:29 PDT

5

Closed

Accepted

Nobody/Anonymous

None

None

Public


Comments ( 6 )

Date: 2008-08-05 22:25:31 PDT
Sender: sitsProject Admin


I've committed this in. Since pegged versions have been available since
Subversion 1.1, I haven't bothered with the version check.



Date: 2008-08-05 22:15:30 PDT
Sender: sitsProject Admin


That makes sense. Ok - I'll make sure this gets committed in - thanks for
taking the time to explain this.



Date: 2008-08-05 22:05:50 PDT
Sender: clechasseur


We had a topic that pointed to an URL that was later moved in the
repository. Trying to fetch the content of a file via "svn cat" with an
operative revision gave out an error saying that the path was not found in
a later revision. Using a pegged revision worked fine.


Date: 2008-08-05 03:33:52 PDT
Sender: sitsProject Admin


You probably right... just curious, can you tell me in your situation where
not using the pegged version is causing issues with a specific example?



Date: 2008-08-04 08:27:56 PDT
Sender: clechasseur


I see. But here, the fix is in the "retrieve" method, which is used to pull
the content of a file for a specific revision, NOT in the method that
generates the diff (which means that the revision passed to "retrieve"
comes from the topicfile, not from the start_tag and end_tag entered by the
user). In this case, using the pegged revision seems to make more sense. If
we ask for the content of file@REV, without specifying an operative
revision, we're basically asking for the latest version of file, looking at
the given history line, which will return what we want.

Is there a case where "retrieve" would need to work on something other than
a pegged revision?


Date: 2008-08-02 19:47:09 PDT
Sender: sitsProject Admin


The semantics of using pegged vs operative revisions are actually a little
bit different: http://svnbook.red-bean.com/en/1.1/ch07s03.html.

Pegged revisions have been around since 1.1 - 1.5 allowed them for
svn:externals properties, but that doesn't affect us here.

To do this right - we really need to just support the user entering in
pegged revisions directly into the start and end tag, and making the module
argument optional.

This would allow people to create some pretty complicates diffs as a
result.



Attached File ( 1 )

Filename Description Download
Subversion.pm.diff.2.diff Patch for Subversion.pm to enable filename@REV Download

Changes ( 4 )

Field Old Value Date By
status_id Open 2008-08-05 22:25:31 PDT sits
resolution_id None 2008-08-05 22:25:31 PDT sits
close_date - 2008-08-05 22:25:31 PDT sits
File Added 286762: Subversion.pm.diff.2.diff 2008-08-01 09:40:29 PDT clechasseur