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

[PATCH] New client diff callbacks

From: Stephen Butler <sbutler_at_elego.de>
Date: Wed, 27 Feb 2008 17:12:42 +0100

Hi Julian and other conflict-resolvers,

Here is a diff that is useful for tree-conflict detection, but which
is not strictly part of the tree-conflict code. Can it be merged into
the Subversion trunk?

We want to do two things that will rely on this patch.

1. Stop an update/switch/merge operation if it tries to enter a
directory containing old, unresolved conflicts, including text or
property conflicts. This would resolve issue #2202. Requires a
callback for opening a directory.

2. Notify the user if (new) tree conflicts have been detected in a
directory. Requires a callback for closing a directory.

For update/switch, appropriate callbacks already exist in the struct
svn_delta_editor_t.

For merge, the code in libsvn_client implements a smaller set of
callbacks, declared in svn_wc_diff_callbacks2_t. This patch adds the
two missing callbacks.

Due to client code shared by merge and diff, adding the new callbacks
for the merge-specific code requires a slew of changes to the
diff-specific code in order to compile. If there's a better way,
please point me in the right direction.

Regards,
Steve

[[[

Extend the diff-callbacks struct to handle the opening and closing of
a directory explicitly. For backward compatibility, name the new
struct svn_wc_diff_callbacks3_t.

In libsvn_wc, create the new struct, adjust all relevant function args
and comments to track the new version, and add code to call the new
callbacks (dir_opened() and dir_closed()).

In libsvn_client, add new callback implementations for diff and merge,
and track the version change.

For merge, the new callbacks don't do anything yet, but we plan to use
them to improve conflict detection. The dir_opened() function will be
useful in blocking merge into a conflicted directory. The
dir_closed() function will be useful in reporting tree conflicts.

For diff, the new callbacks exist for compatibility only.

* subversion/include/svn_wc.h
   (svn_wc_diff_callbacks3_t): New struct.
   (svn_wc_diff_callbacks2_t): Moved comments to the new struct,
    editing slightly to avoid repetition. Added deprecation comments.
   (svn_wc_get_diff_editor5): New function.
   (svn_wc_get_diff_editor4): Deprecated (edit to comment only).
   (svn_wc_diff5): New function.
   (svn_wc_diff4): Deprecated (edit to comment only).

* subversion/libsvn_wc/diff.c
   (edit_baton): Track diff-callbacks version in struct field.
   (make_editor_baton,
    svn_wc_get_diff_editor4): Track diff-callbacks version.
   (file_changed,
    file_added,
    file_deleted,
    dir_added,
    dir_deleted,
    dir_props_changed): Track diff-callbacks version in comments only.
   (dir_opened,
    dir_closed,
    svn_wc_diff5): New functions.
   (svn_wc_diff4): Deprecated (edit to comment only).
   (callbacks2_wrapper): New struct.

* subversion/libsvn_client/repos_diff.c
   (edit_baton): Track diff-callbacks version bump in struct.
   (close_directory): Move the call to get_path_access() so that it is
    done unconditionally, because a valid adm_access is always needed
    by the call to the new dir_closed() callback.
   (svn_client__get_diff_editor): Track diff-callbacks version.

* subversion/libsvn_client/client.h
   (svn_client__get_diff_editor): Track diff-callbacks version.

* subversion/libsvn_client/diff.c
   (diff_cmd_baton,
    diff_props_changed,
    diff_file_changed,
    diff_file_added,
    diff_file_deleted_with_diff,
    diff_file_deleted_no_diff,
    diff_dir_added,
    diff_dir_deleted: Track diff-callbacks version in comment only.
   (diff_dir_opened,
    diff_dir_closed): New functions.
   (diff_wc_wc,
    diff_repos_repos,
    diff_repos_wc): Track diff-callbacks version in args; track new
    public function names.
   (svn_client_diff4): Track diff-callbacks version internally.
    Include the new functions in the diff-callback initialization.

* subversion/libsvn_client/diff.c
   (merge_props_changed,
    merge_file_changed,
    merge_file_added,
    merge_file_deleted_with_diff,
    merge_file_deleted_no_diff,
    merge_dir_added,
    merge_dir_deleted: Track diff-callbacks version in comment only.
   (merge_dir_opened,
    merge_dir_closed): New functions.
   (drive_merge_report_editor): Track diff-callbacks version in args

]]]

-- 
Stephen Butler | Software Developer
elego Software Solutions GmbH
Gustav-Meyer-Allee 25 | 13355 Berlin | Germany
fon: +49 30 2345 8696 | mobile: +49 163 25 45 015
fax: +49 30 2345 8695 | http://www.elegosoft.com
Geschäftsführer: Olaf Wagner | Sitz der Gesellschaft: Berlin
Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org

Received on 2008-02-27 17:13:23 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.