Commits

Nathan Durnan  committed 6f8e160

Refactored repository listing method.
Started on Save option code.

  • Participants
  • Parent commits fa061df
  • Branches development

Comments (0)

Files changed (1)

File TimestampMod.py

 #==============================================================================
 # Import Modules
 #------------------------------------------------------------------------------
-from mercurial import cmdutil	#required for some repository access methods.
 import os	#required for filesystem access methods.
 import time	#required for time functions.
 
 	#Retrieve Repository Manifest contents.
 	#--------------------
 	ui.debug('______\nGenerating file list from repo...\n------\n')
-	RepoContext = cmdutil.revsingle(repo, None)
-	for myFile in RepoContext:
+	#establish category lists from repository status.
+	L_modified, L_added, L_removed, L_deleted, L_unknown, L_ignored, L_clean = repo.status(ignored=True, clean=True, unknown=True)
+	L_changed = L_modified + L_added
+	L_manifest = L_changed + L_clean
+	for myFile in L_manifest:
 		s_fileName = str(myFile).strip()
 		if s_fileName.endswith(('.hg','.Hg','.hG','.HG'),0,3):
 			#don't add internal hg files to timestamp list.
 		#Save timestamps for all files under version control (typically pre-commit)
 		#--------------------
 		ui.note('______\nSaving timestamps...\n------\n')
+		flag_Update = False
+		#remove deleted items from dictionary.
+		for s_fileName in L_deleted:
+			try:
+				del TimeStamp_dict[s_fileName]
+				flag_Update = True
+			except:
+				ui.debug('Deleted file ', s_fileName, 'not in dictionary\n')
+		#end of remove deleted items.
+		
 		
 		
 	elif opts['restore']: