문제

I need to read the contents of the file by using the url of the file and without having the local copy.

eg Url : https://10.0.8.45/svn/Repos/Project/ReadMe.txt

We need to run another script based on values in the above url. We are running the script in client side, so we don't know the Repository Path here in order use "svnlook cat" command.

Thanks in advance.

도움이 되었습니까?

해결책

svn cat URL@HEAD - in your case:

 https://10.0.8.45/svn/Repos/Project/trunk/ReadMe.txt@HEAD

Should do the job - assuming standard svn project layout.

다른 팁

svn cat URL@REV in common case

If you're looking at the most recent copy of the file:

$ svn cat https://10.0.8.45/svn/Repos/Project/ReadMe.txt > ReadMe.txt

This will print out the file onto your terminal and redirect it to a file called ReadMe.txt.

If you need a different revision of that file, you can use the -r parameter:

$ svn cat -r2323 https://10.0.8.45/svn/Repos/Project/ReadMe.txt > ReadMe.txt

If that file has moved, you may need to add the @to pin the repository view. The @ basically says _The way the repository was laid out at this revision. For example, you need revision 1234, but that revision was at https://10.0.8.45/sv/Repos/Project/other/ReadMe.txt, you will need to do this:

$ svn cat -r1234 https://10.0.8.45/svn/Repos/Project/ReadMe.txt@1234

If users need to do this alot, you should look into ViewVC or Sventon. These are browser based repository browsers. I like Sventon. I find it pretty easy to setup, and you can download zipped up versions of file. It's also pretty fast, and you don't need Sventon on the same system as your repository.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top