Commits

Nathan Durnan committed 34d8e53 Merge

Merge with hotfixes

Comments (0)

Files changed (1)

 #==============================================================================
 def Wrap_Commit(repo, text="", user=None, date=None, myMatch=None, force=False, editor=False, extra={}):
 	repo.ui.debug('Wrap_Commit accessed!\n')
-	# Make sure the match object is created.
-	if not myMatch:
-		myMatch = match.always('')
+	#Check for a merge-commit. 
+	#  Don't run timestamp code on merge.
+	if (len(repo.parents()) > 1):
+		repo.ui.status('Wrap_Commit aborted - Merge in progress')
 	else:
-		pass
-	# End of check for non-existent match object.
-	List_CommitMatch = myMatch.files() + [File_TimestampRecords]
-	timestamp_mod(repo.ui, repo, **dict({'save': True, 'restore': None}))
-	# Make sure record file is part of repository and commit. 
-	if not File_TimestampRecords in repo.dirstate:
-		repo.ui.debug('Wrap_Commit: ', File_TimestampRecords, ' not in repo.dirstate  Adding...\n')
-		commands.add(repo.ui, repo, File_TimestampRecords)
-	#end of check for record file in repository.
-	#Update match fileset for use under TortoiseHg.
-	#  TortoiseHg doesn't seem to catch the updated file
-	#  unless it is manually added to the match fileset.
-	if File_TimestampRecords in myMatch.files():
-		# Don't need to do anything if record file already in commit.
-		repo.ui.debug('Wrap_Commit: ', File_TimestampRecords, ' already in match\n')
-		pass
-	else:
-		# Add the record file to the match object.
-		myMatch.files().append(File_TimestampRecords)
-	# end of check for record file.
-	repo.ui.debug('Match Files: ', str(myMatch.files()), '\n')
+		# Make sure the match object is created.
+		if not myMatch:
+			myMatch = match.always('')
+		else:
+			pass
+		# End of check for non-existent match object.
+		List_CommitMatch = myMatch.files() + [File_TimestampRecords]
+		timestamp_mod(repo.ui, repo, **dict({'save': True, 'restore': None}))
+		# Make sure record file is part of repository and commit. 
+		if not File_TimestampRecords in repo.dirstate:
+			repo.ui.debug('Wrap_Commit: ', File_TimestampRecords, ' not in repo.dirstate  Adding...\n')
+			commands.add(repo.ui, repo, File_TimestampRecords)
+		#end of check for record file in repository.
+		#Update match fileset for use under TortoiseHg.
+		#  TortoiseHg doesn't seem to catch the updated file
+		#  unless it is manually added to the match fileset.
+		if File_TimestampRecords in myMatch.files():
+			# Don't need to do anything if record file already in commit.
+			repo.ui.debug('Wrap_Commit: ', File_TimestampRecords, ' already in match\n')
+			pass
+		else:
+			# Add the record file to the match object.
+			myMatch.files().append(File_TimestampRecords)
+		# end of check for record file.
+		repo.ui.debug('Match Files: ', str(myMatch.files()), '\n')
+	#end of check for merge-commit.
 	return repo.timestamp_origcommit(text, user, date, myMatch, force, editor, extra)
 #_ end of Wrap_Commit _________________________________________________________