Commits

Nathan Durnan committed aa2febd

Added SubFolderLimit setting into INI file.
Allow user to specify how many subfolders deep to check for repositories.

Comments (0)

Files changed (3)

-_HgPreBackup.au3,1326144636.63
-HgPreBackup_x86.exe,1326144627.0
-HgPreBackup_x64.exe,1326144633.78
+.hgignore,1326153052.39
 .hgsub,1325791137.19
-HgPreBackupSettings.ini,1325896705.95
 .hgsubstate,1325791876.03
-README.rst,1325791389.33
+_HgPreBackup.au3,1326748210.7
 HgPreBackup.ico,1325031982.39
 HgPreBackup.svg,1325032006.66
-.hgignore,1326153052.39
-.hgtimestamp,1326153146.55
+HgPreBackup_x64.exe,1326144633.78
+HgPreBackup_x86.exe,1326144627.0
+HgPreBackupSettings.ini,1326748215.73
+README.rst,1326747812.58

HgPreBackupSettings.ini

 [settings]
 ;----------------------------------------------------------------------
 ;This section is where general preferences are specified.
+;  SubFolderLimt .: Maxmum number of subfolders to check within RepoPath.
 ;  Report ..: Send email of log file if errors are encountered.
 ;             Expected Values: 'True' or 'False'
 ;                 True  -> send email with error report
 ;       The more generous condition will always take precedence to 
 ;       preserve the maximum amount of historical log informatino.
 ;----------------------------------------------------------------------
-Report = False 
+SubFolderLimit = 10
+Report = False
 KeepLogCount = 10
 KeepLogDays = 30
 ;End of Settings
 	$myResult = $myResult And FileWriteLine($hFile, "[settings]")
 	$myResult = $myResult And FileWriteLine($hFile, ";----------------------------------------------------------------------")
 	$myResult = $myResult And FileWriteLine($hFile, ";This section is where general preferences are specified.")
+	$myResult = $myResult And FileWriteLine($hFile, ";  SubFolderLimt .: Maxmum number of subfolders to check within RepoPath.")
 	$myResult = $myResult And FileWriteLine($hFile, ";  Report ..: Send email of log file if errors are encountered.")
 	$myResult = $myResult And FileWriteLine($hFile, ";             Expected Values: 'True' or 'False'")
 	$myResult = $myResult And FileWriteLine($hFile, ";                 True  -> send email with error report")
 	$myResult = $myResult And FileWriteLine($hFile, ";       The more generous condition will always take precedence to ")
 	$myResult = $myResult And FileWriteLine($hFile, ";       preserve the maximum amount of historical log informatino.")
 	$myResult = $myResult And FileWriteLine($hFile, ";----------------------------------------------------------------------")
+	$myResult = $myResult And FileWriteLine($hFile, "SubFolderLimit = " & $Gi_RecurseLimit)
 	$myResult = $myResult And FileWriteLine($hFile, "Report = " & $Gb_ReportErrors)
 	$myResult = $myResult And FileWriteLine($hFile, "KeepLogCount = " & $Gi_KeepLogCount)
 	$myResult = $myResult And FileWriteLine($hFile, "KeepLogDays = " & $Gi_KeepLogDays)
 
 Func _ReadGlobalSettings( _
 		$IN_sSettingsFilePath)
+	Local $bValue, $iValue
 	#Region Read Path Items:
 	Local $sPath, $aTestPath, $szDrive, $szDir, $szFName, $szExt
 	;Read in Mercurial Path
 	$Gs_LogFileDir = _PathMake($szDrive, $szDir, $szFName, '')
 	#EndRegion Read Path Items
 	#Region Read Settings
-	Local $bValue = IniRead($IN_sSettingsFilePath, 'settings', 'Report', False)
+	$iValue = IniRead($IN_sSettingsFilePath, 'settings', 'SubFolderLimit', 10)
+	;Validate Setting Value
+	If (IsString($iValue) And _
+			StringIsDigit($iValue) Or StringIsFloat($iValue)) _
+	Or (IsNumber($iValue)) Then
+		$Gi_RecurseLimit = Number($iValue)
+	Else ;use default value
+		$Gi_RecurseLimit = 10
+	EndIf ;check for valid value in setting
+	$bValue = IniRead($IN_sSettingsFilePath, 'settings', 'Report', False)
 	;Validate Setting Value
 	If IsBool ($bValue) Then
 		$Gb_ReportErrors = $bValue
 	Else
 		$Gb_ReportErrors = False
 	EndIf
-	Local $iValue = IniRead($IN_sSettingsFilePath, 'settings', 'KeepLogCount', -1)
+	$iValue = IniRead($IN_sSettingsFilePath, 'settings', 'KeepLogCount', -1)
 	;Validate Setting Value
 	If (IsString($iValue) And _
 			StringIsDigit($iValue) Or StringIsFloat($iValue)) _