Commit 3fb84565 authored by Nikolai Krasheninnikov's avatar Nikolai Krasheninnikov Committed by Méven Car
Browse files

Added SVN add/delete/revert directory.

Summary:
Added "SVN Add" on directory addition with appropriate "SVN Revert" action.
Also for directories already under VCS control added "SVN Delete" action.

Test Plan:
1. Create empty directory.
2. Try "SVN Add" on it: it should be added.
3. Try "SVN Revert" on it: it should be reverted.
4. Try "SVN Add", then "SVN Commit". It should be commited fine.
5. Try "SVN Delete", then "SVN Commit". It should be deleted from CVS and commited fine.
6. Try the same with a dir with an empty file in it right-clicking on the directory name and inside directory.

Reviewers: meven, elvisangelaccio

Reviewed By: meven

Differential Revision: https://phabricator.kde.org/D27652
parent 31c122b6
......@@ -396,7 +396,14 @@ void FileViewSvnPlugin::removeFiles()
void FileViewSvnPlugin::revertFiles()
{
execSvnCommand(QStringLiteral("revert"), QStringList(),
QStringList arguments;
// If we are reverting a directory let's revert everything in it.
if (!m_contextDir.isEmpty()) {
arguments << QLatin1String("--depth") << QLatin1String("infinity");
}
execSvnCommand(QStringLiteral("revert"), arguments,
i18nc("@info:status", "Reverting files from SVN repository..."),
i18nc("@info:status", "Reverting of files from SVN repository failed."),
i18nc("@info:status", "Reverted files from SVN repository."));
......@@ -573,10 +580,14 @@ QList<QAction*> FileViewSvnPlugin::directoryActions(const KFileItem& directory)
const ItemVersion version = itemVersion(directory);
m_showLocalChangesAction->setEnabled(enabled && (version != NormalVersion));
m_addAction->setEnabled(enabled && (version == UnversionedVersion));
m_removeAction->setEnabled(enabled && (version == NormalVersion));
if (version == LocallyModifiedVersion || version == AddedVersion || version == RemovedVersion) {
m_commitAction->setEnabled(enabled);
m_revertAction->setEnabled(enabled);
} else {
m_commitAction->setEnabled(false);
m_revertAction->setEnabled(false);
}
QList<QAction*> actions;
......@@ -584,6 +595,9 @@ QList<QAction*> FileViewSvnPlugin::directoryActions(const KFileItem& directory)
actions.append(m_showLocalChangesAction);
actions.append(m_commitAction);
actions.append(m_showUpdatesAction);
actions.append(m_addAction);
actions.append(m_removeAction);
actions.append(m_revertAction);
return actions;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment