Fixes: Show untracked files in git submit dialog

Details: Move routine to get project file list into VCSBase, use it in p4 and git to filter submit lists.
This commit is contained in:
Friedemann Kleint
2009-01-09 17:52:41 +01:00
parent fb93fdaea2
commit 05033a9d36
4 changed files with 75 additions and 41 deletions

View File

@@ -463,22 +463,8 @@ void PerforcePlugin::diffCurrentFile()
void PerforcePlugin::diffCurrentProject()
{
QTC_ASSERT(m_projectExplorer, return);
QStringList files;
QString name;
ProjectExplorer::Project *currentProject = m_projectExplorer->currentProject();
if (currentProject) {
files << currentProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
name = currentProject->name();
} else if (m_projectExplorer->session()) {
name = m_projectExplorer->session()->file()->fileName();
QList<ProjectExplorer::Project *> projects = m_projectExplorer->session()->projects();
foreach (ProjectExplorer::Project *project, projects)
files << project->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
}
QStringList nativeFiles;
foreach (const QString &f, files)
nativeFiles << QDir::toNativeSeparators(f);
const QStringList nativeFiles = VCSBase::VCSBaseSubmitEditor::currentProjectFiles(true, &name);
p4Diff(nativeFiles, name);
}
@@ -538,23 +524,8 @@ void PerforcePlugin::submit()
m_changeTmpFile->seek(0);
// Assemble file list of project
QTC_ASSERT(m_projectExplorer, return);
QStringList files;
QString name;
ProjectExplorer::Project *currentProject = m_projectExplorer->currentProject();
if (currentProject) {
files << currentProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
name = currentProject->name();
} else if (m_projectExplorer->session()) {
name = m_projectExplorer->session()->file()->fileName();
QList<ProjectExplorer::Project *> projects = m_projectExplorer->session()->projects();
foreach (ProjectExplorer::Project *project, projects)
files << project->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
}
QStringList nativeFiles;
foreach (const QString &f, files)
nativeFiles << QDir::toNativeSeparators(f);
const QStringList nativeFiles = VCSBase::VCSBaseSubmitEditor::currentProjectFiles(true, &name);
PerforceResponse result2 = runP4Cmd(QStringList(QLatin1String("fstat")), nativeFiles,
CommandToWindow|StdErrToWindow|ErrorToWindow);
if (result2.error) {