forked from qt-creator/qt-creator
		
	Perforce: Reduced delay before submit dialog is shown
Qt Creator's Perforce plugin uses "fstat" command to gather the files in the project. This takes ~40 seconds on a 12.000 files project. By using "files" command the operation of gathering the files in the project takes ~1 second. Change-Id: Id8257d33a5dda2e06f0f365d5e3b30a49a094483 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com> Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
This commit is contained in:
		
				
					committed by
					
						 Tobias Hunger
						Tobias Hunger
					
				
			
			
				
	
			
			
			
						parent
						
							0a0a620489
						
					
				
				
					commit
					dffd71f4f1
				
			| @@ -635,20 +635,19 @@ void PerforcePlugin::startSubmitProject() | ||||
|     m_commitMessageFileName = saver.fileName(); | ||||
|  | ||||
|     args.clear(); | ||||
|     args << QLatin1String("fstat"); | ||||
|     args << QLatin1String("files"); | ||||
|     args.append(perforceRelativeProjectDirectory(state)); | ||||
|     PerforceResponse fstatResult = runP4Cmd(state.currentProjectTopLevel(), args, | ||||
|     PerforceResponse filesResult = runP4Cmd(state.currentProjectTopLevel(), args, | ||||
|                                             RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); | ||||
|     if (fstatResult.error) { | ||||
|     if (filesResult.error) { | ||||
|         cleanCommitMessageFile(); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     QStringList fstatLines = fstatResult.stdOut.split(QLatin1Char('\n')); | ||||
|     QStringList filesLines = filesResult.stdOut.split(QLatin1Char('\n')); | ||||
|     QStringList depotFileNames; | ||||
|     foreach (const QString &line, fstatLines) { | ||||
|         if (line.startsWith(QLatin1String("... depotFile"))) | ||||
|             depotFileNames.append(line.mid(14)); | ||||
|     foreach (const QString &line, filesLines) { | ||||
|         depotFileNames.append(line.left(line.lastIndexOf(QRegExp(QLatin1String("#[0-9]+\\s-\\s"))))); | ||||
|     } | ||||
|     if (depotFileNames.isEmpty()) { | ||||
|         VcsOutputWindow::appendWarning(tr("Project has no files")); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user