开发者

Depend on the svn revision i want download file in PHP

Depend on the svn revision i want download file

Command : svn log -r ".$fileId ." -v

Output:

Array
(
    [0] => ------------------------------------------------------------------------
    [1] => r11369 | owner | 2011-03-14 15:42:38 +0530 (Mon, 14 Mar 2011) | 1 line
    [2] => Changed paths:
    [3] =>    A /Process Related Documents/Engineering/SourceCode/fullpath
    [4] => 
    [5] => Uploaded By Username
    [6] => ------------------------------------------------------------------------
)

there is fi开发者_如何学运维ve revision for 1 file

r01,r02,r03,r04 and r05 now i want download r03 file ..


If I'm parsing your question correctly, what you are saying is thus:

You've walked through the history / found the info, and you know that there are five different revisions where this file has been modified. Based on that, you've selected one of those revisions (the third one), and you want to see what the file looked like at that time.

For this, you want svn cat.

cat: Output the content of specified files or URLs. usage: cat TARGET[@REV]... If specified, REV determines in which revision the target is first looked up. Valid options: -r [--revision] ARG : ARG (some commands also take ARG1:ARG2 range) A revision argument can be one of: NUMBER revision number '{' DATE '}' revision at start of the date 'HEAD' latest in repository 'BASE' base rev of item's working copy 'COMMITTED' last commit at or before BASE 'PREV' revision just before COMMITTED

Having selected the revision number from the repository, simply svn cat uri://to/repository/to/file -r REVNUM.

Alternatively, as you are using PHP, it may be easier to get at the information you want via the svn PECL package as opposed to trying to parse the command line output.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜