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

Re: [PATCH v3] Fix failing three way diff for properties

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Wed, 11 Nov 2009 18:53:52 +0100

[[[
Fix failing three way diff for properties when invoking diff-full (df)
in the interactive conflict resolver.

* subversion/libsvn_wc/util.c
  (svn_wc__cd2_to_cd, svn_wc__cd_to_cd2): All the usual files needed
    in a three way diff is made available for properties as well as
    markers for binary format and mime.

Patch by: Daniel Näslund <daniel{_AT_}longitudo.com>
Suggested by: julianf
]]]

On Tue, Nov 10, 2009 at 09:02:59PM +0000, Julian Foad wrote:
> One more question: Are you sure the fields you are duplicating are not
> allowed to be NULL? If they are, then I think the apr_pstrdup() is not
> guaranteed to succeed and so you would have to do "thing ?
> apr_pstrdup(...) : NULL" or similar.

The mime type is not guaranteed to be non NULL so I've changed that.
It was not guarenteed to be non NULL for text only either so that was an
existing bug. merged_file may be NULL for properties if one of the
properties is binary. I've changed the assignment there.

Right now it's possible to inoke an interactive diff on binary
properties. I will fix this in a subsequent patch.

I've checked libsvn_wc/props.c and it's safe there. But as I see it, I
only need to check the declaration of the structs. It's up to the rest
of the code to obey the contract the declaration dictates. Else I will
have to chase down every possible code path.
 
I have only added checks for NULL so I haven't run any new tests.

Formatting of long lines can be difficult. Is this ok?

[[[
  new_conflict->mime_type = conflict->mime_type
                        ? apr_pstrdup(result_pool, conflict->mime_type)
                        : NULL;
]]]

/Daniel

Received on 2009-11-11 18:54:24 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.