MCPcopy Create free account
hub / github.com/KDE/kdevelop / isVersionControlled

Method isVersionControlled

plugins/bazaar/bazaarplugin.cpp:130–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130bool BazaarPlugin::isVersionControlled(const QUrl& localLocation)
131{
132 QDir workCopy = BazaarUtils::workingCopy(localLocation);
133 auto* job = new DVcsJob(workCopy, this, OutputJob::Silent);
134 job->setType(VcsJob::Unknown);
135 job->setIgnoreError(true);
136 *job << "bzr" << "ls" << "--from-root" << "-R" << "-V";
137 job->exec();
138 if (job->status() == VcsJob::JobSucceeded) {
139 QList<QFileInfo> filesAndDirectoriesList;
140 const auto output = job->output().split(QLatin1Char('\n'));
141 filesAndDirectoriesList.reserve(output.size());
142 const QChar dirSeparator = QDir::separator();
143 for (const auto& fod : output) {
144 filesAndDirectoriesList.append(QFileInfo(workCopy.absolutePath() + dirSeparator + fod));
145 }
146 QFileInfo fi(localLocation.toLocalFile());
147 if (fi.isDir() || fi.isFile()) {
148 QFileInfo file(localLocation.toLocalFile());
149 return filesAndDirectoriesList.contains(file);
150 }
151 }
152 return false;
153}
154
155VcsJob* BazaarPlugin::log(const QUrl& localLocation, const VcsRevision& rev, long unsigned int limit)
156{

Callers

nothing calls this directly

Calls 12

setIgnoreErrorMethod · 0.80
execMethod · 0.80
outputMethod · 0.80
toLocalFileMethod · 0.80
QFileInfoClass · 0.50
setTypeMethod · 0.45
statusMethod · 0.45
splitMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected