# Reading SVN Revision from File

## Recommended Posts

Heya, new user to auto it, been working away happily at it all day.

Basically what im doing is a bug submission Utility, it fills out a webform based on user input, one of the things I would like to submit (automatically)would be the

SVN Revision of a particular file , hopefully I can do this without asking our programmers to change the compiler.

Ive been trying FileGetVersion , however theres no SVN info on that tab

The svn info is on its own tab called "subversion".

If theres a way to read this without having to ask programmers to change something just for QA dept, that would be great .

Any help would be great

In the mean time I have used the "last modified" date, however thats not ideal since the person reading the bug would then have to look up the dates to find the revision number.

##### Share on other sites

Does anyone have a solution to this?

I'm facing a similar problem and I'm stumped (though I have to admit I am new to AutoIt). I'm working on automating testing routines for our software and I need the logfiles for the test runs to include the tested revision number. We are using SVN with Tortoise. I tried googling but there are so many pages about using SVN for version controlling AutoIt source code, it's impossible to find anything about AutoIt accessing SVN's data.

Any ideas? Help would be highly appreciated.

##### Share on other sites

Noxy

Using the Auto Info tool, are you able to get a control handle to a text box that contains the rev number?

Auto It can read the contents of text boxes.

In general, getting the rev # is not easy. I'm interested in this too so I'll see if I can't get something working.

I found this on Google - http://research.tannerpages.com/Blog/Good-...totools-project

Edited by bo8ster

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

##### Share on other sites

Ok, I can get a version number from a folder. Since each folder can have different versions, you can manage your checkouts/updates

#include <file.au3>
#include <array.au3>
#include <Constants.au3>

Global $rev = "" Local$pid = Run(@ComSpec & " /c svnversion", 'C:\foo\bar\trunk\', @SW_HIDE, $STDERR_CHILD +$STDOUT_CHILD)
While 1

$rev = StdoutRead($pid)
If @error Then ExitLoop
Local $result_array = StringSplit($rev, @LF)
If NOT ($result_array[1] == "") Then$rev = $result_array[1] ExitLoop EndIf Wend StdioClose($pid)
MsgBox(0, "STDOUT read:", $rev) You can also use Command Line Parameters like$CmdLine[0] to pass the path to AutoIT

Hope that helps

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

##### Share on other sites

Thank you bo8ster! That was very helpful

## Create an account

Register a new account