Jump to content

Revision Tracker - Track all changes to all scripts


Beege
 Share

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. 

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 3 months later...

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
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

×
×
  • Create New...