Jump to content

Get SVN Rev Number


bo8ster
 Share

Recommended Posts

Hi all. My first post in this section. Someone in the General Help and Support requested this. I added a CmdLine option to it hope you like.

Once you get the rev number, it can be used for logging for test logs - thought it might be useful.

; ===============================================================================
; AutoIt Version:   3.0
;
; Requirement(s):   External:   Subversion - svnversion
;
;                   Internal:   AutoIt 3.0
; Notes
;   Finds the revision number of a given versioned folder using svnversion.
;   For understanding results, see the svnversion help.
;   Script created using SVN v1.4.5
; ===============================================================================
#include <file.au3>
#include <array.au3>
#include <Constants.au3>

Local $path = ""
Local $rev = ""

If $CmdLine[0] == 1 Then ; a path was passed in
    $path = $CmdLine[1]
    ConsoleWrite($CmdLine[1])
Else
    $path = @ScriptDir ; this may not be a versioned directory
EndIf

Local $pid = Run(@ComSpec & " /c svnversion", $path, @SW_HIDE,  $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)

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]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...