Jump to content
Mark Balla

Finding a SVN version of a folder or file

Recommended Posts

We been using Tortoise SVN for a while and I am familiar with the process but now need to do some simple automation.

 

I am trying to create a simple tool that reads the SVN version of a folder and matches it to a number in a document.

 

Does anyone have experience finding the SVN version number or know of a good resource link.

 

Mark 

Share this post


Link to post
Share on other sites

Well using the command line is the way to go, but I've never done it, I've just used tools that do it.

 

Here is a quick link where you can get the revision with the command line.

 

http://forums.ni.com/t5/LabVIEW/How-can-I-get-the-SVN-repository-version-in-my-VI/td-p/803586

 

I have yet to get the command to work for some reason not quite sure what I'm missing.

Share this post


Link to post
Share on other sites

You mean something like this?

post-28303-0-20125100-1410225434_thumb.p

 

The trouble with svn and versions is that when you use svn info on a FILE it only returns the revision of your file. To get the most recent revision on the server, you need to point it to the svn URL. The snippet can do both.

 

Just be careful with that because if your repository needs authentication it will not work unless you've saved your credentials in the tortoise svn password manager by ticking the "remember password" box. The --non-interactive switch disables password prompts, which you wouldn't be able to see anyway, because it's hidden away by System Exec.

 

I guess, as a workaround, you can pop up your own password dialog if you need one.

  • Like 2

Share this post


Link to post
Share on other sites

I was having problems also but I figured it out.

 

I needed to install the command line client tools that are unchecked by default.

 

 

post-584-0-60454400-1410228258.png

Share this post


Link to post
Share on other sites

You can also check out a specific file at a specific revision by using the svn cat command and redirecting into a file:

svn cat -r revision URL > Filename


I use this to investigate files, detect files marked as modified or conflicting, check out the base file and compare using LVCompare.

 

I use this to detect "false" changes due to RT deploys or conditional disable changes in compiled code and so on.  Files which are marked as modified or conflicting but which have no LVCompare changes versus their base reference URL can be reverted without danger and this makes commits much easier to handle when working on RT projects.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.