Commits

Nathan Durnan committed 34bc9c2

Still working on commit hook. See issue 7 and issue 8 @bitbucket.

* Status and Update hooks seem to be working from command line and from within TortoiseHG.
* Commit hook works perfect from command line, but fails to include the updated .hgtimestamp file in commit from TortoiseHG.

Comments (0)

Files changed (1)

 
 
 def Pre_Commit_Hook(repo, **kwargs):
+	'''Keyword Arguments as follows:
+		kwargs:{
+			'pats': [],
+			'args': '',
+			'ui': <mercurial.ui.ui object at 0x????????>,
+			'hooktype': '',
+			'opts': {
+				'exclude': [],
+				'message': '',
+				'addremove': None,
+				'include': [],
+				'close_branch': None,
+				'user': '',
+				'date': '',
+				'logfile': ''
+			}
+		}
+	'''
 	timestamp_mod(repo.ui, repo, **dict({'save': True, 'restore': None}))
-
+	kwargs['pats'].append('.hgtimestamp')
 
 def Post_Status_Hook(repo, **kwargs):
+	'''Keyword Arguments as follows:
+		kwargs:{
+			'pats': [], 
+			'hooktype': '', 
+			'args': '', 
+			'ui': <mercurial.ui.ui object at 0x????????>, 
+			'result': None, 
+			'opts': {
+				'ignored': None, 
+				'all': None, 
+				'copies': None, 
+				'exclude': [], 
+				'unknown': None, 
+				'rev': [], 
+				'subrepos': None, 
+				'include': [], 
+				'print0': None, 
+				'added': None, 
+				'deleted': None, 
+				'removed': None, 
+				'change': '', 
+				'no_status': None, 
+				'modified': None, 
+				'clean': None
+			}
+		}
+	'''
 	timestamp_mod(repo.ui, repo, **dict({'save': None, 'restore': None}))
 
 
 def Update_Hook(repo, **kwargs):
+	'''Keyword Arguments as follows:
+		kwargs:{
+			'error': 0,
+			'ui': <mercurial.ui.ui object at 0x????????>,
+			'hooktype': '',
+			'parent1': '',
+			'parent2': ''
+		}
+	'''
 	timestamp_mod(repo.ui, repo, **dict({'save': None, 'restore': True}))
 
 
 	#end of loop through dictionary items.
 	#Make sure to close the file!
 	file_TimeStampRecords.close()
-	#Make sure to add the modified record file to the repository!
-	# Note: this may generate a warning "already tracked!" message.
-	commands.add(repo.ui, repo, file_TimeStampRecords.name)
 #_ end of _save_Timestamps ____________________________________________________