[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Fix issue 3686 - executable flag is not maintained during a merge

From: Daniel Becroft <djcbecroft_at_gmail.com>
Date: Mon, 31 Jan 2011 15:21:42 +1000

Hi,

Attached is a (work-in-progress) patch to fix issue 3686[1].

For those unfamiliar with the issue: when a binary file (with svn:executable
set) is modified as a result of a merge, the executable flag is missing
post-merge. A commit will restore the flag.

I've looked into the code, and have found the problem. Essentially, in
libsvn_client/merge.c, there is a "Special case" merge for binary files.
Essentially, if the WORKING version is equal to the LEFT version, then we
directly copy the RIGHT over the top. As a result, the file never gets
included in the workqueue, and the sync_file_flags task is never run.

I believe the solution is to move this logic from libsvn_client to
libsvn_wc, and specifically the merge_binary_file function. This has further
effects as well. This function would always raise a conflict for binary
files, whereas now it will attempt to merge (using the above special case
logic), and if this isn't possible, then raise the conflict.

I'm submitting this patch as a "am I on the right track?" submission, rather
than a final job. I'll craft a log message if I'm correct.

Cheers,
Daniel B.

Received on 2011-01-31 06:22:44 CET

This is an archived mail posted to the Subversion Dev mailing list.