Jump to content
Sign in to follow this  
Beege

Revision Tracker - Track all changes to all scripts

Recommended Posts

Here is two apps I've been working on to track the changes I make to scripts as I create them. One is for monitoring your script changes, the other is view/restore all the changes that have been made.
 
RevMonitor
RevMonitor works by reciving shell change notifications from windows. For every .au3 file thats within a directory being monitored, 2 files will eventually be created ( as changes happen). One file is a dictionary file that holds all unique lines from the script. The second file is the revisons file that holds all revisons made to the script. A revison entry is a string of line numbers from the dictionary that make up the script. The entry also contains the Date and Time, plus weather it passed au3check at the time. (Date | Au3Check | Revision)
 
For an example take the following script:

#include <array.au3>

Global $aArray1[1]

Func _ShowArray(ByRef $aArray)
    If Not IsArray($aArray) Then Return SetError(1)
    _ArrayDisplay($aArray)
    If @error Then Return SetError(1)
EndFunc

Func _ShowArray2(ByRef $aArray)
    If Not IsArray($aArray) Then Return SetError(1)
    _ArrayDisplay($aArray)
    If @error Then Return SetError(2)
EndFunc

 
The dictionary for the file would look like this:

#include <array.au3>

Global $aArray1[1]
Func _ShowArray(ByRef $aArray)
    If Not IsArray($aArray) Then Return SetError(1)
    _ArrayDisplay($aArray)
    If @error Then Return SetError(1)
EndFunc
Func _ShowArray2(ByRef $aArray)
    If @error Then Return SetError(2)

A entry from the revison file would look like this:

11/29/2013 01:09:23 AM|0|0.1.2.1.1.3.4.5.6.7.1.8.4.5.9.7

 
RevRestore
RevRestore is used for restoring a file. Each dictionary/revison file that gets created for a script being monitored will always get created in a "backup" directory located in the same directory as the script (same way tidy makes backups). To view a revison file, you select the script (not the actual revison file). I wrote it this way to make the revison file easy to open from scite. 
 
To add to SciTE, simply open the users options file (Tools->"Open User Options File") and add something similar to the following lines:

# 45 Open Revisions File
command.45.$(au3)="C:\RevTracker\RevRestore.exe" "$(FilePath)"
command.name.45.$(au3)=Restore Revision
command.shortcut.45.$(au3)=Ctrl+Shift+R

ScreenShots:


screenshot.PNG

popup.PNG

 

Credits - Thank you to all:

Melba23 - Toast, GuiFrame

Ward - QuickLZ

Yashied - Restart

 

Download:

Revision Tracker.html

Note: The .html link is just to help me keep track of downloads. Open the .html file and a download dialog will display. 

 

Share this post


Link to post
Share on other sites
Guest

Thenks! the RevMonitor.exe working good and detects changes.

but when i want to select the au3 file with RevRestore to restore the changes then i get this error:

Line 21341 (File ''C:Program Files (x86)AutoIt3Rzvision
TrackerCompiIedRevRestore.exe"):

Error: Error parsing function call.

Edited by Guest

Share this post


Link to post
Share on other sites

Thank you gil900. This is corrected now. Please download again and let me know if you still have issues. Thanks

Share this post


Link to post
Share on other sites
Guest

Thank you gil900. This is corrected now. Please download again and let me know if you still have issues. Thanks

 
Thank you!

Today i  started to use your tool and it is very good!

Share this post


Link to post
Share on other sites

An interesting idea Beege. I will test this in the next couple of days when I have free time.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Guest

I have a project with ~6200 lines and lots of Revs in RevRestore.exe.

when i loading this project in RevRestore.exe then RevRestore works very slowly and each Rev load takes about 7-15 seconds..

it is very slow..

Edited by Guest

Share this post


Link to post
Share on other sites

Thank you for this tool. Looks really good.

So I downloaded the package, copied compilled .exe files into AutoItRevTracker folder, started RevMonitor.exe, selected the folder where my .au3 files are (tray icon stayed, new RevMon.ini file appeared in AutoItRevTracker folder).

Then opened SciTe, opened User Options file, at the bottom added suggested code and changed one line:

command.45.$(au3)="$(SciteDefaultHome)\..\RevTracker\RevRestore.exe" "$(FilePath)"
changed and saved test.au3 file, hit CTRL+SHIFT+R and received:

---------------------------

No Dictionary file found

---------------------------

Dictionary file not found:

E:Program FilesAutoItScriptsBackuptest.dic

---------------------------

OK

---------------------------

I do have ScriptsBackUp folder that I created manually before, but no new files there.

Anything I missed?

Thank you.

[EDIT]

It seems tracker only tracks new created files, saving existing files doesn't work? I've tried copy file content, delete the file, create a new document, paste the content and save it with the same filename as the old file - nothing.

Edited by VAN0

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By TXTechie
      Hello Everyone,
      I've developed my own GUI using AutoIt and I'm allowing users to minimize the GUI, but I also want to include some kind of timer so that it will automatically restore the GUI after something like 30 minutes or an hour. However, I also want them to be able to manually restore the GUI by clicking the application's icon in the taskbar.
      I've searched through the forums, but I'm not sure how to get started.
      Any ideas or functions to research are appreciated!
      Regards,
      TX Techie
    • By Jahar
      Hi All,
      Please help me on how to fetch date/time of last windows 10 system restore point using autoit? Basically its about querying the last restore point.
    • By Miliardsto
      Hello. How to make GUI restore from tray with slower speed or effect?
    • By Queener
      I'm not sure if I'm doing it right or there's a better way to restore windows from hidden in system tray, but if I remove the if statement then it's able to restore the program from system tray, but if I add the if statement then it doesn't restore it. Here's what I gotten so far and the reason why I use the if statement is because #32770 opens many other apps also.

      WinSetState("[CLASS:#32770]", "", @SW_SHOW) If WinExists($title_Pass_Entrance) Then WinWaitActive(WinActivate($title_Pass_Entrance))   ControlSend($title_Pass_Entrance, "", "[CLASS:Edit; INSTANCE:1]", "TempPassword")   ControlClick($title_Pass_Entrance, "", "[CLASS:Button; INSTANCE:2]", "left", 1) EndIf   >>>> Window <<<< Title:    Enter Safe Combination Class:    #32770 Position:    728, 411 Size:    465, 218 Style:    0x94C800C4 ExStyle:    0x00010101 Handle:    0x0000000000050A7A >>>> Control <<<< Class:     Instance:     ClassnameNN:     Name:     Advanced (Class):     ID:     Text:     Position:     Size:     ControlClick Coords:     Style:     ExStyle:     Handle:   
    • By Chimaera
      Ive had a bit of code from a long time ago and its always worked perfectly until recently
      It creates a restore point of a given name that i choose and i use it when i finalize a customers pc to go back to them.
      the original code was from Venom 007
      Global $CuDate = _Date_Time_GetLocalTime() Global $sRestorePointName = 'Tech_Finish ' & StringTrimRight(_Date_Time_SystemTimeToDateTimeStr($CuDate), 9) Func _CreateRestorePoint($sRestorePointName) ; Author = Venom007 SplashTextOn('Restore Point', 'Creating Restore Point.' & @CRLF & @CRLF & _ 'Please Wait', 300, 90, -1, -1, 18) Local $objSystemRestore $objSystemRestore = ObjGet('winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore') If Not $objSystemRestore.createrestorepoint($sRestorePointName, 0, 100) = 0 Then SetError(1) SplashOff() If Not @error Then SplashTextOn('System Restore', 'System Restore Point Created Successfully.', 300, 45) Sleep(2000) SplashOff() Else SplashTextOn('System Restore Error', 'System Restore Point Was Not Created.', 300, 45) Sleep(2000) SplashOff() EndIf EndFunc ;==>_CreateRestorePoint Just recently now im seeing windows 10 machines it fails at this line im pretty sure
      $objSystemRestore = ObjGet('winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore') Does anyone know what has changed in win 10 to cause this?
×
×
  • Create New...