Skip to content

Conflicts: Upload them files if env variable says so - #6038

Merged
ckamm merged 1 commit into
masterfrom
upload-conflicts
Sep 19, 2017
Merged

ckamm merged 1 commit into
masterfrom
upload-conflicts

Conversation

@ckamm

@ckamm ckamm commented Sep 18, 2017

Copy link
Copy Markdown
Contributor

Set OWNCLOUD_UPLOAD_CONFLICT_FILES=1 to trigger this behavior.

Note that this is experimental and unsupported. The real feature is
likely to end up in 2.5.

Uploading conflict files is simply done by removing the pattern from
csync_exclude. The rest here deals with making the conflict notification
ui approximately work.

There are still some concerns about where an uploaded conflict file
appears in the sync protocol and issues list (it should be in both, but
is only in one of them currently!).

See #4557.

@ckamm ckamm added this to the 2.4.0 milestone Sep 18, 2017
@ckamm ckamm self-assigned this Sep 18, 2017
@ckamm
ckamm requested review from guruz and ogoffart September 18, 2017 10:39

@ogoffart ogoffart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall.

if (rc == 0) {
static bool uploadConflictFiles = qgetenv("OWNCLOUD_UPLOAD_CONFLICT_FILES").toInt() != 0;
if (!uploadConflictFiles) {
if (OCC::Utility::isConflictFile(bname)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allocates to convert bname from char* to QByteArray. Is it possible to have the finction take a non-owning char* instead of a QByteArray? (ideally, the function should take a std::string_view)

Comment thread src/csync/csync_exclude.cpp Outdated
}
rc = csync_fnmatch(conflict, path, 0);
if (rc == 0) {
static bool uploadConflictFiles = qgetenv("OWNCLOUD_UPLOAD_CONFLICT_FILES").toInt() != 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is duplicated a lot. Could that go in some helper function?

Set OWNCLOUD_UPLOAD_CONFLICT_FILES=1 to trigger this behavior.

Note that this is experimental and unsupported. The real feature is
likely to end up in 2.5.

Uploading conflict files is simply done by removing the pattern from
csync_exclude. The rest here deals with making the conflict notification
ui approximately work.

There are still some concerns about where an uploaded conflict file
appears in the sync protocol and issues list (it should be in both, but
is only in one of them currently!).

See #4557.

@ogoffart ogoffart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ckamm
ckamm merged commit 53195b0 into master Sep 19, 2017
@ckamm
ckamm deleted the upload-conflicts branch September 19, 2017 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants