Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Fix for SVN 1.7+ changes

John Dancel1e3f0ccee90e
diff --git a/toonz/sources/toonz/dvdirtreeview.cpp b/toonz/sources/toonz/dvdirtreeview.cpp
index 6ea035019..a3070cd0c 100644
--- a/toonz/sources/toonz/dvdirtreeview.cpp
+++ b/toonz/sources/toonz/dvdirtreeview.cpp
@@ -1373,11 +1373,11 @@ void DvDirTreeView::onRefreshStatusError(const QString &text) {
void DvDirTreeView::checkPartialLock(const QString &workingDir,
const QStringList &files) {
QStringList args;
- args << "propget";
- args << "partial-lock";
+ args << "proplist";
int filesCount = files.count();
for (int i = 0; i < filesCount; i++) args << files.at(i);
args << "--xml";
+ args << "-v";
m_thread.disconnect(SIGNAL(done(const QString &)));
m_thread.disconnect(SIGNAL(error(const QString &)));
diff --git a/toonz/sources/toonz/svncommitdialog.cpp b/toonz/sources/toonz/svncommitdialog.cpp
index e3bfeb18a..fd3c644b5 100644
--- a/toonz/sources/toonz/svncommitdialog.cpp
+++ b/toonz/sources/toonz/svncommitdialog.cpp
@@ -1041,10 +1041,10 @@ void SVNCommitFrameRangeDialog::onLockDone() {
// Step 3: propget
QStringList args;
- args << "propget";
- args << "partial-lock";
+ args << "proplist";
args << m_file;
args << "--xml";
+ args << "-v";
m_thread.disconnect(SIGNAL(done(const QString &)));
connect(&m_thread, SIGNAL(done(const QString &)), this,
diff --git a/toonz/sources/toonz/svnlockframerangedialog.cpp b/toonz/sources/toonz/svnlockframerangedialog.cpp
index 9c30517e9..d8929adec 100644
--- a/toonz/sources/toonz/svnlockframerangedialog.cpp
+++ b/toonz/sources/toonz/svnlockframerangedialog.cpp
@@ -304,10 +304,10 @@ void SVNLockFrameRangeDialog::onLockDone() {
// Step 2: propget
QStringList args;
- args << "propget";
- args << "partial-lock";
+ args << "proplist";
args << m_file;
args << "--xml";
+ args << "-v";
m_thread.disconnect(SIGNAL(done(const QString &)));
connect(&m_thread, SIGNAL(done(const QString &)), this,
@@ -736,10 +736,10 @@ void SVNUnlockFrameRangeDialog::onLockDone() {
// Step 3: propget
QStringList args;
- args << "propget";
- args << "partial-lock";
+ args << "proplist";
args << m_file;
args << "--xml";
+ args << "-v";
m_thread.disconnect(SIGNAL(done(const QString &)));
connect(&m_thread, SIGNAL(done(const QString &)), this,
@@ -1074,10 +1074,10 @@ SVNFrameRangeLockInfoDialog::SVNFrameRangeLockInfoDialog(
// 1. propget
QStringList args;
- args << "propget";
- args << "partial-lock";
+ args << "proplist";
args << m_file;
args << "--xml";
+ args << "-v";
connect(&m_thread, SIGNAL(done(const QString &)), this,
SLOT(onPropGetDone(const QString &)));
diff --git a/toonz/sources/toonz/versioncontrol.cpp b/toonz/sources/toonz/versioncontrol.cpp
index bf8f4cf6e..1e02c67f8 100644
--- a/toonz/sources/toonz/versioncontrol.cpp
+++ b/toonz/sources/toonz/versioncontrol.cpp
@@ -327,8 +327,7 @@ void VersionControlManager::setFrameRange(TLevelSet *levelSet,
m_deleteLater = deleteLater;
QStringList args;
- args << "propget";
- args << "partial-lock";
+ args << "proplist";
bool checkVersionControl = false;
bool filesAddedToArgs = false;
@@ -379,6 +378,7 @@ void VersionControlManager::setFrameRange(TLevelSet *levelSet,
}
args << "--xml";
+ args << "-v";
TFilePath path = m_scene->getScenePath();
path = m_scene->decodeFilePath(path);
@@ -612,7 +612,15 @@ bool VersionControl::testSetup() {
//-----------------------------------------------------------------------------
bool VersionControl::isFolderUnderVersionControl(const QString &folderPath) {
QDir dir(folderPath);
- return dir.entryList(QDir::AllDirs | QDir::Hidden).contains(".svn");
+ if (dir.entryList(QDir::AllDirs | QDir::Hidden).contains(".svn")) return true;
+ // For SVN 1.7 and greater, check parent directories to see if it's under
+ // version control
+ while (dir.cdUp()) {
+ if (dir.entryList(QDir::AllDirs | QDir::Hidden).contains(".svn"))
+ return true;
+ }
+
+ return false;
}
//-----------------------------------------------------------------------------
diff --git a/toonz/sources/toonzlib/tproject.cpp b/toonz/sources/toonzlib/tproject.cpp
index 4c270d488..5a1c5d329 100644
--- a/toonz/sources/toonzlib/tproject.cpp
+++ b/toonz/sources/toonzlib/tproject.cpp
@@ -160,7 +160,15 @@ TFilePath searchProjectPath(TFilePath folder) {
bool isFolderUnderVersionControl(const TFilePath &folderPath) {
QDir dir(QString::fromStdWString(folderPath.getWideString()));
- return dir.entryList(QDir::AllDirs | QDir::Hidden).contains(".svn");
+ if (dir.entryList(QDir::AllDirs | QDir::Hidden).contains(".svn")) return true;
+ // For SVN 1.7 and greater, check parent directories to see if it's under
+ // version control
+ while (dir.cdUp()) {
+ if (dir.entryList(QDir::AllDirs | QDir::Hidden).contains(".svn"))
+ return true;
+ }
+
+ return false;
}
//===================================================================