diff options
author | peter <peter@FreeBSD.org> | 2013-11-11 01:00:29 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2013-11-11 01:00:29 +0000 |
commit | 68301b10e52aedbf076b5b08303439d75c192e18 (patch) | |
tree | c05673887167c7ecd55a62ed72830f5186f453c1 /subversion/libsvn_wc/update_editor.c | |
parent | 3b9f7e96381479fb03ae2c36d490a38718f71083 (diff) | |
download | FreeBSD-src-68301b10e52aedbf076b5b08303439d75c192e18.zip FreeBSD-src-68301b10e52aedbf076b5b08303439d75c192e18.tar.gz |
Import svn-1.8.4, which includes fixes for both security and merge
handling.
Diffstat (limited to 'subversion/libsvn_wc/update_editor.c')
-rw-r--r-- | subversion/libsvn_wc/update_editor.c | 65 |
1 files changed, 53 insertions, 12 deletions
diff --git a/subversion/libsvn_wc/update_editor.c b/subversion/libsvn_wc/update_editor.c index a353b1b..e02dc30 100644 --- a/subversion/libsvn_wc/update_editor.c +++ b/subversion/libsvn_wc/update_editor.c @@ -1012,9 +1012,13 @@ window_handler(svn_txdelta_window_t *window, void *baton) if (err) { - /* We failed to apply the delta; clean up the temporary file. */ - svn_error_clear(svn_io_remove_file2(hb->new_text_base_tmp_abspath, TRUE, - hb->pool)); + /* We failed to apply the delta; clean up the temporary file if it + already created by lazy_open_target(). */ + if (hb->new_text_base_tmp_abspath) + { + svn_error_clear(svn_io_remove_file2(hb->new_text_base_tmp_abspath, + TRUE, hb->pool)); + } } else { @@ -3009,18 +3013,55 @@ absent_node(const char *path, kind = svn_node_unknown; } - if (status == svn_wc__db_status_normal - && kind == svn_node_dir) + if (status == svn_wc__db_status_normal) { - /* We found an obstructing working copy! + svn_boolean_t wcroot; + /* We found an obstructing working copy or a file external! */ - We can do two things now: - 1) notify the user, record a skip, etc. - 2) Just record the absent node in BASE in the parent - working copy. + SVN_ERR(svn_wc__db_is_wcroot(&wcroot, eb->db, local_abspath, + scratch_pool)); - As option 2 happens to be exactly what we do anyway, lets do that. - */ + if (wcroot) + { + /* + We have an obstructing working copy; possibly a directory external + + We can do two things now: + 1) notify the user, record a skip, etc. + 2) Just record the absent node in BASE in the parent + working copy. + + As option 2 happens to be exactly what we do anyway, fall through. + */ + } + else + { + /* The server asks us to replace a file external + (Existing BASE node; not reported by the working copy crawler or + there would have been a delete_entry() call. + + There is no way we can store this state in the working copy as + the BASE layer is already filled. + + We could error out, but that is not helping anybody; the user is not + even seeing with what the file external would be replaced, so let's + report a skip and continue the update. + */ + + if (eb->notify_func) + { + svn_wc_notify_t *notify; + notify = svn_wc_create_notify( + local_abspath, + svn_wc_notify_update_skip_obstruction, + scratch_pool); + + eb->notify_func(eb->notify_baton, notify, scratch_pool); + } + + svn_pool_destroy(scratch_pool); + return SVN_NO_ERROR; + } } else if (status == svn_wc__db_status_not_present || status == svn_wc__db_status_server_excluded |