Dear working copy gods and other svn-hacking fellows,
To create a user-visible tree conflicts report file,
I call a function called "svn_wc__write_tree_conflict_report()".
This function gets a log accumulator and an adm_access.
It fetches the entry out of the adm_access, reads tree-conflict
data from it (if any), transforms that into a human readable description
(the "report") and writes that to a temp file.
Then it uses the log to schedule a move of the temp file to the
user-visible file tree_conflicts.txt, which resides in the tree-conflicted
directory in the working copy. See below for the current implementation of
When calling this function in libsvn_wc/update_editor.c:close_directory(),
tree-conflict data about files that are deleted by the update
make it into the entry retrieved from the adm_access.
But files that the update merely edits do not appear in that entry
object at the time this function is called. They end up on disk though
when the whole update is done. It seems that changes to files are somehow
processed later than changes to directories, is that correct?
I'm now trying to find the proper place in libsvn_wc/update_editor.c
to call this function so that tree conflict data for files that are
modified by the update is present in the entry retrieved from the
adm_access when this function is run.
Any idea where to put this function call?
Maybe I need to call it multiple times?
Both close_file() and complete_directory() seem likely candidates,
but to be honest, with my limited understanding of how the update
editor, the log and the entries files on disk interact with one
another, it's a bit hard for me to find the correct spot just by RTFS.
I thought before going into trial and error I might get an expert's
opinion on this. Thanks for helpėng me out :)
Oh, and if this whole idea is moot for some reason, tell me! Thanks.
As promised, the code for the function I want to call:
const char *dir_path, *native_text;
const char *report_tmp_path, *report_path;
const svn_wc_entry_t *entry;
/* Make sure the node is a directory.
* Otherwise we should not have been called. */
dir_path = svn_wc_adm_access_path(adm_access);
SVN_ERR(svn_wc_entry(&entry, dir_path, adm_access, TRUE, pool));
assert(entry->kind == svn_node_dir);
conflicts = apr_array_make(pool, 0,
SVN_ERR(svn_wc__read_tree_conflicts_from_entry(conflicts, entry, pool));
report = svn_stringbuf_create("", pool);
/* Should we print dir_path and timestamp in the conflict report? */
for (i = 0; i < conflicts->nelts; i++)
conflict = APR_ARRAY_IDX(conflicts, i,
SVN_ERR(svn_wc__append_tree_conflict_to_report(report, conflict, pool));
native_text = svn_utf_cstring_from_utf8_fuzzy(report->data, pool);
/* Write the report to a temp file. */
/* Loggy move the temp file to the user-visible file.
* Assumes that the move will succeed even if another application
* has locked the file. Is that a safe assumption?
report_path_buf = svn_stringbuf_create(SVN_WC__TREE_CONFLICT_REPORT, pool);
report_path = svn_path_join(dir_path, report_path_buf->data, pool);
/* Update the entry with the path (relative to DIR_PATH) of the
* user-visible report file. */
tmp_entry.tree_conflict_report = svn_path_is_child(dir_path,
Stefan Sperling <firstname.lastname@example.org> Software Developer
elego Software Solutions GmbH HRB 77719
Gustav-Meyer-Allee 25, Gebaeude 12 Tel: +49 30 23 45 86 96
13355 Berlin Fax: +49 30 23 45 86 95
http://www.elego.de Geschaeftsfuehrer: Olaf Wagner
Received on Wed Dec 12 22:05:32 2007
- application/pgp-signature attachment: stored