Rename sync journal to ._sync_xxx.db.

The added underscore means that older clients will also ignore the
file.
This commit is contained in:
Christian Kamm 2016-11-22 13:17:04 +01:00
parent 3e59a9b316
commit 9641c7a1e7
7 changed files with 10 additions and 10 deletions

View file

@ -230,7 +230,7 @@ static CSYNC_EXCLUDE_TYPE _csync_excluded_common(c_strlist_t *excludes, const ch
}
blen = strlen(bname);
rc = csync_fnmatch(".sync_*.db*", bname, 0);
rc = csync_fnmatch("._sync_*.db*", bname, 0);
if (rc == 0) {
match = CSYNC_FILE_SILENTLY_EXCLUDED;
goto out;

View file

@ -149,13 +149,13 @@ static void check_csync_excluded(void **state)
assert_int_equal(rc, CSYNC_FILE_SILENTLY_EXCLUDED);
/* also the new form of the database name */
rc = csync_excluded_no_ctx(csync->excludes, ".sync_5bdd60bdfcfa.db", CSYNC_FTW_TYPE_FILE);
rc = csync_excluded_no_ctx(csync->excludes, "._sync_5bdd60bdfcfa.db", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_SILENTLY_EXCLUDED);
rc = csync_excluded_no_ctx(csync->excludes, ".sync_5bdd60bdfcfa.db.ctmp", CSYNC_FTW_TYPE_FILE);
rc = csync_excluded_no_ctx(csync->excludes, "._sync_5bdd60bdfcfa.db.ctmp", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_SILENTLY_EXCLUDED);
rc = csync_excluded_no_ctx(csync->excludes, ".sync_5bdd60bdfcfa.db-shm", CSYNC_FTW_TYPE_FILE);
rc = csync_excluded_no_ctx(csync->excludes, "._sync_5bdd60bdfcfa.db-shm", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_SILENTLY_EXCLUDED);
rc = csync_excluded_no_ctx(csync->excludes, "subdir/.sync_5bdd60bdfcfa.db", CSYNC_FTW_TYPE_FILE);
rc = csync_excluded_no_ctx(csync->excludes, "subdir/._sync_5bdd60bdfcfa.db", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_SILENTLY_EXCLUDED);

View file

@ -153,7 +153,7 @@ By default, the ownCloud Client ignores the following files:
* Files matched by one of the patterns defined in the Ignored Files Editor
* Files containing characters that do not work on certain file systems ``(`\, /, :, ?, *, ", >, <, |`)``.
* Files starting with ``.sync_xxxxxxx.db`` and the old format ``.csync_journal.db``,
* Files starting with ``._sync_xxxxxxx.db`` and the old format ``.csync_journal.db``,
as these files are reserved for journalling.
If a pattern selected using a checkbox in the `ignoredFilesEditor-label` (or if

View file

@ -634,7 +634,7 @@ void Folder::wipe()
// Delete files that have been partially downloaded.
slotDiscardDownloadProgress();
//Unregister the socket API so it does not keep the .sync_journal file open
//Unregister the socket API so it does not keep the ._sync_journal file open
FolderMan::instance()->socketApi()->slotUnregisterPath(alias());
_journal.close(); // close the sync journal

View file

@ -169,7 +169,7 @@ void FolderWatcherPrivate::slotReceivedNotification(int fd)
if (event->len > 0 && event->wd > -1) {
QByteArray fileName(event->name);
// qDebug() << Q_FUNC_INFO << event->name;
if (fileName.startsWith(".sync_") ||
if (fileName.startsWith("._sync_") ||
fileName.startsWith(".csync_journal.db") ||
fileName.startsWith(".owncloudsync.log")) {
// qDebug() << "ignore journal";

View file

@ -48,7 +48,7 @@ void SyncJournalDb::setAccountParameterForFilePath( const QString& localPath, co
{
// localPath always has a trailing slash
_dbFile = localPath;
_dbFile.append( QLatin1String(".sync_"));
_dbFile.append( QLatin1String("._sync_"));
// FIXME: Maybe it is better to only allow different hosts, without path component.
QString remoteUrlPath = remoteUrl.toString();
if( remotePath != QLatin1String("/") ) {

View file

@ -738,7 +738,7 @@ public:
_account->setCredentials(new FakeCredentials{_fakeQnam});
_journalDb.reset(new OCC::SyncJournalDb());
_journalDb->setDatabaseFilePath(localPath() + ".sync_test.db");
_journalDb->setDatabaseFilePath(localPath() + "._sync_test.db");
_syncEngine.reset(new OCC::SyncEngine(_account, localPath(), "", _journalDb.get()));
// A new folder will update the local file state database on first sync.