You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/04/20 16:58:08 UTC
svn commit: r935948 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c
copy.c entries.c entries.h log.c log.h update_editor.c workqueue.c
Author: gstein
Date: Tue Apr 20 14:58:07 2010
New Revision: 935948
URL: http://svn.apache.org/viewvc?rev=935948&view=rev
Log:
Split entry_modify2() into two functions: one to operate on the parent
stub, and one for normal entry modifications. I think this will be easier
to locate/fix/rewrite this stuff since we can tackle one type of entry
without worrying about the other.
The loggy_delete_entry() also grew a couple extra parameters to install a
not-present node after the entry has been deleted. There was only one
parent-stub loggy modification, and it occurred directly after the entry
deletion. Rather than having loggy_entry_modify support parent stubs, I
simply made loggy_delete_entry pick up extra functionality.
* subversion/libsvn_wc/entries.h:
(svn_wc__entry_modify2): renamed to ...
(svn_wc__entry_modify): ... this, and lost the PARENT_STUB param
(svn_wc__entry_modify_stub): new function to modify the parent stub
* subversion/libsvn_wc/entries.c:
(svn_wc__entry_modify2): renamed to ...
(entry_modify): ... this, and made static.
(svn_wc__entry_modify, svn_wc__entry_modify_stub): new functions
wrapping entry_modify
(svn_wc__tweak_entry): rewrite to use one of the two public functions
depending on its parameters. avoid using the internal function, so we
can more easily change the modify functions
(svn_wc__temp_mark_missing_not_present): switch to entry_modify_stub
* subversion/libsvn_wc/log.h:
(svn_wc__loggy_delete_entry): add REVISION and KIND params
* subversion/libsvn_wc/log.c:
(log_do_modify_entry): switch to entry_modify() and leave a couple
comments about this call.
(log_do_delete_entry): renamed to ...
(basic_delete_entry): ... this. the params are changed to a standard DB,
LOCAL_ABSPATH, and SCRATCH_POOL. code updated to track renames.
(log_do_delete_entry): added (again) with new REVISION and KIND params.
calls the old functionality (basic_delete_entry), then proceeds to
create the not-present node if required.
(start_handler): for LOG_DELETE_ENTRY, parse out the extra REVISION and
KIND params, and pass them to log_do_delete_entry.
(svn_wc__loggy_delete_entry): take the extra REVISION and KIND params
and add them to the XML block
* subversion/libsvn_wc/adm_ops.c:
(mark_item_copied): switch to entry_modify()
(svn_wc_add4): switch to using entry_modify and entry_modify_stub as
appropriate.
(svn_wc__set_file_external_location): switch to entry_modify
* subversion/libsvn_wc/copy.c:
(post_copy_cleanup, copy_dir_administratively): switch to entry_modify
* subversion/libsvn_wc/update_editor.c:
(do_entry_deletion): rejigger the code to make one of two calls to
loggy_delete_entry, based on whether a not-present node is required
after the deletion.
(add_directory): switch to entry_modify and entry_modify_stub
(close_file): switch to entry_modify
* subversion/libsvn_wc/workqueue.c:
(run_revert): switch to entry_modify and entry_modify_stub
(run_deletion_postcommit): switch to entry_modify
(log_do_committed): switch to entry_modify_stub
Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/copy.c
subversion/trunk/subversion/libsvn_wc/entries.c
subversion/trunk/subversion/libsvn_wc/entries.h
subversion/trunk/subversion/libsvn_wc/log.c
subversion/trunk/subversion/libsvn_wc/log.h
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/libsvn_wc/workqueue.c
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=935948&r1=935947&r2=935948&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Tue Apr 20 14:58:07 2010
@@ -1189,8 +1189,8 @@ mark_item_copied(svn_wc__db_t *db,
SVN_ERR(svn_wc__db_read_pristine_props(&props, db, local_abspath,
scratch_pool, scratch_pool));
tmp_entry.copied = TRUE;
- SVN_ERR(svn_wc__entry_modify2(db, local_abspath, kind, FALSE, &tmp_entry,
- SVN_WC__ENTRY_MODIFY_COPIED, scratch_pool));
+ SVN_ERR(svn_wc__entry_modify(db, local_abspath, kind, &tmp_entry,
+ SVN_WC__ENTRY_MODIFY_COPIED, scratch_pool));
/* Reinstall the pristine properties on WORKING */
SVN_ERR(svn_wc__db_temp_working_set_props(db, local_abspath, props,
@@ -1493,9 +1493,14 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
}
if (modify_flags)
- SVN_ERR(svn_wc__entry_modify2(db, local_abspath, kind,
- kind == svn_node_dir /* parent_stub */,
- &tmp_entry, modify_flags, pool));
+ {
+ if (kind == svn_node_dir)
+ SVN_ERR(svn_wc__entry_modify_stub(db, local_abspath,
+ &tmp_entry, modify_flags, pool));
+ else
+ SVN_ERR(svn_wc__entry_modify(db, local_abspath, kind,
+ &tmp_entry, modify_flags, pool));
+ }
/* If this is a replacement without history, we need to reset the
properties for PATH. */
@@ -1581,9 +1586,8 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
tmp_entry.schedule = is_replace
? svn_wc_schedule_replace
: svn_wc_schedule_add;
- SVN_ERR(svn_wc__entry_modify2(db, local_abspath, svn_node_dir,
- FALSE /* parent_stub */,
- &tmp_entry, modify_flags, pool));
+ SVN_ERR(svn_wc__entry_modify(db, local_abspath, svn_node_dir,
+ &tmp_entry, modify_flags, pool));
}
SVN_ERR(svn_wc__db_temp_op_set_working_incomplete(
@@ -2750,10 +2754,10 @@ svn_wc__set_file_external_location(svn_w
entry.file_external_rev.kind = svn_opt_revision_unspecified;
}
- SVN_ERR(svn_wc__entry_modify2(wc_ctx->db, local_abspath,
- svn_node_unknown, FALSE,
- &entry, SVN_WC__ENTRY_MODIFY_FILE_EXTERNAL,
- scratch_pool));
+ SVN_ERR(svn_wc__entry_modify(wc_ctx->db, local_abspath,
+ svn_node_unknown,
+ &entry, SVN_WC__ENTRY_MODIFY_FILE_EXTERNAL,
+ scratch_pool));
return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=935948&r1=935947&r2=935948&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Tue Apr 20 14:58:07 2010
@@ -658,8 +658,8 @@ post_copy_cleanup(svn_wc__db_t *db,
flags |= SVN_WC__ENTRY_MODIFY_KIND;
}
- SVN_ERR(svn_wc__entry_modify2(db, child_abspath, svn_node_unknown,
- FALSE, &tmp_entry, flags, iterpool));
+ SVN_ERR(svn_wc__entry_modify(db, child_abspath, svn_node_unknown,
+ &tmp_entry, flags, iterpool));
}
/* Remove lock stuffs. */
@@ -782,9 +782,9 @@ copy_dir_administratively(svn_wc_context
will cause svn_wc_add4() below to fail. Set the URL to the
URL of the first copy for now to prevent this. */
tmp_entry.url = apr_pstrdup(scratch_pool, copyfrom_url);
- SVN_ERR(svn_wc__entry_modify2(db, dst_abspath, svn_node_dir, FALSE,
- &tmp_entry, SVN_WC__ENTRY_MODIFY_URL,
- scratch_pool));
+ SVN_ERR(svn_wc__entry_modify(db, dst_abspath, svn_node_dir,
+ &tmp_entry, SVN_WC__ENTRY_MODIFY_URL,
+ scratch_pool));
}
else
{
Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=935948&r1=935947&r2=935948&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Tue Apr 20 14:58:07 2010
@@ -2910,14 +2910,14 @@ fold_scheduling(svn_boolean_t *skip_sche
-svn_error_t *
-svn_wc__entry_modify2(svn_wc__db_t *db,
- const char *local_abspath,
- svn_node_kind_t kind,
- svn_boolean_t parent_stub,
- svn_wc_entry_t *entry,
- apr_uint64_t modify_flags,
- apr_pool_t *scratch_pool)
+static svn_error_t *
+entry_modify(svn_wc__db_t *db,
+ const char *local_abspath,
+ svn_node_kind_t kind,
+ svn_boolean_t parent_stub,
+ svn_wc_entry_t *entry,
+ apr_uint64_t modify_flags,
+ apr_pool_t *scratch_pool)
{
apr_pool_t *subpool = svn_pool_create(scratch_pool);
svn_error_t *err;
@@ -3009,6 +3009,32 @@ svn_wc__entry_modify2(svn_wc__db_t *db,
}
+svn_error_t *
+svn_wc__entry_modify(svn_wc__db_t *db,
+ const char *local_abspath,
+ svn_node_kind_t kind,
+ svn_wc_entry_t *entry,
+ apr_uint64_t modify_flags,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_return(entry_modify(db, local_abspath, kind, FALSE,
+ entry, modify_flags, scratch_pool));
+}
+
+
+svn_error_t *
+svn_wc__entry_modify_stub(svn_wc__db_t *db,
+ const char *local_abspath,
+ svn_wc_entry_t *entry,
+ apr_uint64_t modify_flags,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_return(entry_modify(db, local_abspath,
+ svn_node_dir, TRUE,
+ entry, modify_flags, scratch_pool));
+}
+
+
svn_wc_entry_t *
svn_wc_entry_dup(const svn_wc_entry_t *entry, apr_pool_t *pool)
{
@@ -3120,8 +3146,13 @@ svn_wc__tweak_entry(svn_wc__db_t *db,
}
else if (modify_flags)
{
- SVN_ERR(svn_wc__entry_modify2(db, local_abspath, entry->kind, parent_stub,
- &tmp_entry, modify_flags, scratch_pool));
+ if (entry->kind == svn_node_dir && parent_stub)
+ SVN_ERR(svn_wc__entry_modify_stub(db, local_abspath,
+ &tmp_entry, modify_flags,
+ scratch_pool));
+ else
+ SVN_ERR(svn_wc__entry_modify(db, local_abspath, entry->kind,
+ &tmp_entry, modify_flags, scratch_pool));
}
return SVN_NO_ERROR;
@@ -3383,12 +3414,12 @@ svn_wc__temp_mark_missing_not_present(co
tmp_entry.deleted = TRUE;
tmp_entry.schedule = svn_wc_schedule_normal;
- SVN_ERR(svn_wc__entry_modify2(wc_ctx->db, local_abspath,
- svn_node_dir, TRUE, &tmp_entry,
- (SVN_WC__ENTRY_MODIFY_DELETED
- | SVN_WC__ENTRY_MODIFY_SCHEDULE
- | SVN_WC__ENTRY_MODIFY_FORCE),
- scratch_pool));
+ SVN_ERR(svn_wc__entry_modify_stub(wc_ctx->db, local_abspath,
+ &tmp_entry,
+ (SVN_WC__ENTRY_MODIFY_DELETED
+ | SVN_WC__ENTRY_MODIFY_SCHEDULE
+ | SVN_WC__ENTRY_MODIFY_FORCE),
+ scratch_pool));
return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/libsvn_wc/entries.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.h?rev=935948&r1=935947&r2=935948&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.h (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.h Tue Apr 20 14:58:07 2010
@@ -144,29 +144,24 @@ svn_error_t *svn_wc__atts_to_entry(svn_w
of the node.
Perform all allocations in SCRATCH_POOL.
-
- -----
-
- A cross between svn_wc__get_entry() and svn_wc__entry_modify().
-
- If PARENT_STUB is TRUE, then this function will modify a directory's
- stub entry in the parent. If PARENT_STUB is FALSE, then it will operate
- on a directory's real entry.
-
- PARENT_STUB must be FALSE if KIND==FILE.
-
- If KIND is svn_kind_unknown, then PARENT_STUB is interpreted based on
- what is found on disk. */
+*/
svn_error_t *
-svn_wc__entry_modify2(svn_wc__db_t *db,
+svn_wc__entry_modify(svn_wc__db_t *db,
const char *local_abspath,
svn_node_kind_t kind,
- svn_boolean_t parent_stub,
svn_wc_entry_t *entry,
apr_uint64_t modify_flags,
apr_pool_t *scratch_pool);
+/* Like svn_wc__entry_modify(), but modifies the "parent stub". */
+svn_error_t *
+svn_wc__entry_modify_stub(svn_wc__db_t *db,
+ const char *local_abspath,
+ svn_wc_entry_t *entry,
+ apr_uint64_t modify_flags,
+ apr_pool_t *scratch_pool);
+
/* Remove LOCAL_ABSPATH from DB, unconditionally.
All temporary allocations will be performed in SCRATCH_POOL. */
Modified: subversion/trunk/subversion/libsvn_wc/log.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/log.c?rev=935948&r1=935947&r2=935948&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/log.c (original)
+++ subversion/trunk/subversion/libsvn_wc/log.c Tue Apr 20 14:58:07 2010
@@ -367,18 +367,10 @@ log_do_modify_entry(struct log_runner *l
if (valuestr && strcmp(valuestr, "true") == 0)
modify_flags |= SVN_WC__ENTRY_MODIFY_FORCE;
- /* Now write the new entry out. Note that we want to always operate
- on the stub if name is not THIS_DIR. This loggy function is intended
- to operate on the data in ADM_ABSPATH, so we do NOT want to reach
- down into a subdir. For entry_modify2(), it is okay to set PARENT_STUB
- to TRUE for files (kind errors are not raised). */
- err = svn_wc__entry_modify2(loggy->db,
- svn_dirent_join(loggy->adm_abspath,
- name,
- loggy->pool),
- svn_node_unknown,
- *name != '\0' /* parent_stub */,
- entry, modify_flags, loggy->pool);
+ /* ### this function never needs to modify a parent stub.
+ ### NOTE: this call to entry_modify MAY create a new node. */
+ err = svn_wc__entry_modify(loggy->db, local_abspath, svn_node_unknown,
+ entry, modify_flags, loggy->pool);
if (err)
return svn_error_createf(SVN_ERR_WC_BAD_ADM_LOG, err,
_("Error modifying entry for '%s'"), name);
@@ -409,30 +401,25 @@ log_do_delete_lock(struct log_runner *lo
/* Ben sez: this log command is (at the moment) only executed by the
update editor. It attempts to forcefully remove working data. */
/* Delete a node from version control, and from disk if unmodified.
- * NAME is the name of the file or directory to be deleted, which is a child
- * of the directory represented by LOGGY->adm_access. If it is unversioned,
+ * LOCAL_ABSPATH is the name of the file or directory to be deleted.
+ * If it is unversioned,
* do nothing and return no error. Otherwise, delete its WC entry and, if
* the working version is unmodified, delete it from disk. */
static svn_error_t *
-log_do_delete_entry(struct log_runner *loggy, const char *name)
+basic_delete_entry(svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
{
- const char *local_abspath;
svn_wc__db_kind_t kind;
svn_boolean_t hidden;
svn_error_t *err;
- local_abspath = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
-
/* Figure out if 'name' is a dir or a file */
- SVN_ERR(svn_wc__db_read_kind(&kind, loggy->db, local_abspath, TRUE,
- loggy->pool));
-
+ SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, TRUE, scratch_pool));
if (kind == svn_wc__db_kind_unknown)
return SVN_NO_ERROR; /* Already gone */
- SVN_ERR(svn_wc__db_node_hidden(&hidden, loggy->db, local_abspath,
- loggy->pool));
-
+ SVN_ERR(svn_wc__db_node_hidden(&hidden, db, local_abspath, scratch_pool));
if (hidden)
return SVN_NO_ERROR;
@@ -450,8 +437,8 @@ log_do_delete_entry(struct log_runner *l
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
- loggy->db, local_abspath,
- loggy->pool, loggy->pool));
+ db, local_abspath,
+ scratch_pool, scratch_pool));
if (status == svn_wc__db_status_obstructed ||
status == svn_wc__db_status_obstructed_add ||
status == svn_wc__db_status_obstructed_delete)
@@ -465,20 +452,19 @@ log_do_delete_entry(struct log_runner *l
*/
if (status != svn_wc__db_status_obstructed_add)
{
- SVN_ERR(svn_wc__entry_remove(loggy->db, local_abspath,
- loggy->pool));
+ SVN_ERR(svn_wc__entry_remove(db, local_abspath, scratch_pool));
return SVN_NO_ERROR;
}
}
}
- err = svn_wc__internal_remove_from_revision_control(loggy->db,
+ err = svn_wc__internal_remove_from_revision_control(db,
local_abspath,
TRUE, /* destroy */
FALSE, /* instant_error*/
NULL, NULL,
- loggy->pool);
+ scratch_pool);
if (err && err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD)
{
@@ -492,6 +478,48 @@ log_do_delete_entry(struct log_runner *l
}
+static svn_error_t *
+log_do_delete_entry(struct log_runner *loggy,
+ const char *name,
+ svn_revnum_t revision,
+ svn_node_kind_t kind)
+{
+ const char *local_abspath;
+
+ local_abspath = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
+
+ SVN_ERR(basic_delete_entry(loggy->db, local_abspath, loggy->pool));
+
+ if (SVN_IS_VALID_REVNUM(revision))
+ {
+ svn_wc_entry_t tmp_entry;
+
+ tmp_entry.revision = revision;
+ tmp_entry.kind = kind;
+ tmp_entry.deleted = TRUE;
+
+ if (kind == svn_node_dir)
+ SVN_ERR(svn_wc__entry_modify_stub(loggy->db,
+ local_abspath,
+ &tmp_entry,
+ SVN_WC__ENTRY_MODIFY_REVISION
+ | SVN_WC__ENTRY_MODIFY_KIND
+ | SVN_WC__ENTRY_MODIFY_DELETED,
+ loggy->pool));
+ else
+ SVN_ERR(svn_wc__entry_modify(loggy->db,
+ local_abspath,
+ svn_node_file,
+ &tmp_entry,
+ SVN_WC__ENTRY_MODIFY_REVISION
+ | SVN_WC__ENTRY_MODIFY_KIND
+ | SVN_WC__ENTRY_MODIFY_DELETED,
+ loggy->pool));
+ }
+
+ return SVN_NO_ERROR;
+}
+
/* */
static svn_error_t *
log_do_add_tree_conflict(struct log_runner *loggy,
@@ -554,7 +582,18 @@ start_handler(void *userData, const char
err = log_do_delete_lock(loggy, name);
}
else if (strcmp(eltname, SVN_WC__LOG_DELETE_ENTRY) == 0) {
- err = log_do_delete_entry(loggy, name);
+ const char *attr;
+ svn_revnum_t revision;
+ svn_node_kind_t kind;
+
+ attr = svn_xml_get_attr_value(SVN_WC__ENTRY_ATTR_REVISION, atts);
+ revision = SVN_STR_TO_REV(attr);
+ attr = svn_xml_get_attr_value(SVN_WC__ENTRY_ATTR_KIND, atts);
+ if (strcmp(attr, "dir") == 0)
+ kind = svn_node_dir;
+ else
+ kind = svn_node_file;
+ err = log_do_delete_entry(loggy, name, revision, kind);
}
else if (strcmp(eltname, SVN_WC__LOG_MV) == 0) {
const char *dest = svn_xml_get_attr_value(SVN_WC__LOG_ATTR_DEST, atts);
@@ -758,6 +797,8 @@ svn_error_t *
svn_wc__loggy_delete_entry(svn_wc__db_t *db,
const char *adm_abspath,
const char *path,
+ svn_revnum_t revision,
+ svn_wc__db_kind_t kind,
apr_pool_t *scratch_pool)
{
const char *loggy_path1;
@@ -766,7 +807,12 @@ svn_wc__loggy_delete_entry(svn_wc__db_t
SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
svn_xml_make_open_tag(&log_accum, scratch_pool, svn_xml_self_closing,
SVN_WC__LOG_DELETE_ENTRY,
- SVN_WC__LOG_ATTR_NAME, loggy_path1,
+ SVN_WC__LOG_ATTR_NAME,
+ loggy_path1,
+ SVN_WC__ENTRY_ATTR_REVISION,
+ apr_psprintf(scratch_pool, "%ld", revision),
+ SVN_WC__ENTRY_ATTR_KIND,
+ kind == svn_wc__db_kind_dir ? "dir" : "file",
NULL);
return svn_error_return(svn_wc__wq_add_loggy(db, adm_abspath, log_accum,
Modified: subversion/trunk/subversion/libsvn_wc/log.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/log.h?rev=935948&r1=935947&r2=935948&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/log.h (original)
+++ subversion/trunk/subversion/libsvn_wc/log.h Tue Apr 20 14:58:07 2010
@@ -78,12 +78,16 @@ svn_wc__loggy_translated_file(svn_wc__db
associated with PATH from the entries file.
ADM_ABSPATH is the absolute path for the access baton for PATH.
+ ### REVISION and KIND
+
Use SCRATCH_POOL for temporary allocations.
*/
svn_error_t *
svn_wc__loggy_delete_entry(svn_wc__db_t *db,
const char *adm_abspath,
const char *path,
+ svn_revnum_t revision,
+ svn_wc__db_kind_t kind,
apr_pool_t *scratch_pool);
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=935948&r1=935947&r2=935948&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Tue Apr 20 14:58:07 2010
@@ -2205,36 +2205,27 @@ do_entry_deletion(struct edit_baton *eb,
}
/* Issue a loggy command to delete the entry from version control and to
- * delete it from disk if unmodified, but leave any modified files on disk
- * unversioned. */
- SVN_ERR(svn_wc__loggy_delete_entry(eb->db, dir_abspath, local_abspath,
- pool));
+ delete it from disk if unmodified, but leave any modified files on disk
+ unversioned.
- /* If the thing being deleted is the *target* of this update, then
+ If the thing being deleted is the *target* of this update, then
we need to recreate a 'deleted' entry, so that the parent can give
accurate reports about itself in the future. */
- if (strcmp(local_abspath, eb->target_abspath) == 0)
+ if (strcmp(local_abspath, eb->target_abspath) != 0)
{
- svn_wc_entry_t tmp_entry;
-
- tmp_entry.revision = *(eb->target_revision);
- /* ### Why not URL as well? This might be a switch. ... */
- /* tmp_entry.url = *(eb->target_url) or db->new_URL ? */
- if (kind == svn_wc__db_kind_dir)
- tmp_entry.kind = svn_node_dir;
- else /* kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink*/
- tmp_entry.kind = svn_node_file;
-
- tmp_entry.deleted = TRUE;
-
- SVN_ERR(svn_wc__loggy_entry_modify(eb->db,
- dir_abspath, local_abspath,
- &tmp_entry,
- SVN_WC__ENTRY_MODIFY_REVISION
- | SVN_WC__ENTRY_MODIFY_KIND
- | SVN_WC__ENTRY_MODIFY_DELETED,
- pool));
-
+ /* Delete, and do not leave a not-present node. */
+ SVN_ERR(svn_wc__loggy_delete_entry(eb->db, dir_abspath, local_abspath,
+ SVN_INVALID_REVNUM,
+ svn_wc__db_kind_unknown,
+ pool));
+ }
+ else
+ {
+ /* Delete, leaving a not-present node. */
+ SVN_ERR(svn_wc__loggy_delete_entry(eb->db, dir_abspath, local_abspath,
+ *eb->target_revision,
+ kind,
+ pool));
eb->target_deleted = TRUE;
}
@@ -2639,9 +2630,8 @@ add_directory(const char *path,
SVN_WC__ENTRY_MODIFY_FORCE;
}
- SVN_ERR(svn_wc__entry_modify2(eb->db, db->local_abspath,
- svn_node_dir, TRUE,
- &tmp_entry, modify_flags, pool));
+ SVN_ERR(svn_wc__entry_modify_stub(eb->db, db->local_abspath,
+ &tmp_entry, modify_flags, pool));
if (db->add_existed)
{
@@ -2662,9 +2652,9 @@ add_directory(const char *path,
modify_flags |= SVN_WC__ENTRY_MODIFY_URL;
}
- SVN_ERR(svn_wc__entry_modify2(eb->db, db->local_abspath,
- svn_node_dir, FALSE,
- &tmp_entry, modify_flags, pool));
+ SVN_ERR(svn_wc__entry_modify(eb->db, db->local_abspath,
+ svn_node_dir,
+ &tmp_entry, modify_flags, pool));
}
}
@@ -4891,11 +4881,11 @@ close_file(void *file_baton,
tmp_entry.file_external_path = entry->file_external_path;
tmp_entry.file_external_peg_rev = entry->file_external_peg_rev;
tmp_entry.file_external_rev = entry->file_external_rev;
- SVN_ERR(svn_wc__entry_modify2(eb->db, fb->local_abspath,
- svn_node_file, FALSE /* parent_stub */,
- &tmp_entry,
- SVN_WC__ENTRY_MODIFY_FILE_EXTERNAL,
- pool));
+ SVN_ERR(svn_wc__entry_modify(eb->db, fb->local_abspath,
+ svn_node_file,
+ &tmp_entry,
+ SVN_WC__ENTRY_MODIFY_FILE_EXTERNAL,
+ pool));
}
}
@@ -4910,10 +4900,10 @@ close_file(void *file_baton,
svn_wc_entry_t tmp_entry;
tmp_entry.schedule = svn_wc_schedule_delete;
- SVN_ERR(svn_wc__entry_modify2(eb->db, fb->local_abspath,
- svn_node_file, FALSE /* parent_stub */,
- &tmp_entry, SVN_WC__ENTRY_MODIFY_SCHEDULE,
- pool));
+ SVN_ERR(svn_wc__entry_modify(eb->db, fb->local_abspath,
+ svn_node_file,
+ &tmp_entry, SVN_WC__ENTRY_MODIFY_SCHEDULE,
+ pool));
}
/* This file was locally-added. This file is now being added by the
@@ -4927,12 +4917,12 @@ close_file(void *file_baton,
/* ### we need to use FORCE to ensure transition to normal. otherwise,
### it would remain in the added state. */
tmp_entry.schedule = svn_wc_schedule_normal;
- SVN_ERR(svn_wc__entry_modify2(eb->db, fb->local_abspath,
- svn_node_file, FALSE /* parent_stub */,
- &tmp_entry,
- SVN_WC__ENTRY_MODIFY_SCHEDULE
- | SVN_WC__ENTRY_MODIFY_FORCE,
- pool));
+ SVN_ERR(svn_wc__entry_modify(eb->db, fb->local_abspath,
+ svn_node_file,
+ &tmp_entry,
+ SVN_WC__ENTRY_MODIFY_SCHEDULE
+ | SVN_WC__ENTRY_MODIFY_FORCE,
+ pool));
}
/* ### we may as well run whatever is in the queue right now. this
Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=935948&r1=935947&r2=935948&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Tue Apr 20 14:58:07 2010
@@ -471,9 +471,9 @@ run_revert(svn_wc__db_t *db,
node_kind = svn_node_file;
}
- SVN_ERR(svn_wc__entry_modify2(db, local_abspath, node_kind, FALSE,
- &tmp_entry, modify_flags,
- scratch_pool));
+ SVN_ERR(svn_wc__entry_modify(db, local_abspath, node_kind,
+ &tmp_entry, modify_flags,
+ scratch_pool));
/* ### need to revert some bits in the parent stub. sigh. */
if (kind == svn_wc__db_kind_dir)
@@ -493,9 +493,9 @@ run_revert(svn_wc__db_t *db,
tmp_entry.copyfrom_url = NULL;
tmp_entry.copyfrom_rev = SVN_INVALID_REVNUM;
tmp_entry.schedule = svn_wc_schedule_normal;
- SVN_ERR(svn_wc__entry_modify2(db, local_abspath, svn_node_dir, TRUE,
- &tmp_entry, modify_flags,
- scratch_pool));
+ SVN_ERR(svn_wc__entry_modify_stub(db, local_abspath,
+ &tmp_entry, modify_flags,
+ scratch_pool));
}
}
@@ -1035,11 +1035,11 @@ run_deletion_postcommit(svn_wc__db_t *db
the directory can also place a 'deleted' dir entry in the
parent. */
tmp_entry.revision = new_revision;
- SVN_ERR(svn_wc__entry_modify2(db, local_abspath,
- svn_node_dir, FALSE,
- &tmp_entry,
- SVN_WC__ENTRY_MODIFY_REVISION,
- scratch_pool));
+ SVN_ERR(svn_wc__entry_modify(db, local_abspath,
+ svn_node_dir,
+ &tmp_entry,
+ SVN_WC__ENTRY_MODIFY_REVISION,
+ scratch_pool));
SVN_ERR(svn_wc__db_temp_determine_keep_local(&keep_local, db,
local_abspath,
@@ -1562,13 +1562,13 @@ log_do_committed(svn_wc__db_t *db,
If this fails for you in the transition to one DB phase, please
run svn cleanup one level higher. */
- err = svn_wc__entry_modify2(db, local_abspath, svn_node_dir,
- TRUE, &tmp_entry,
- (SVN_WC__ENTRY_MODIFY_SCHEDULE
- | SVN_WC__ENTRY_MODIFY_COPIED
- | SVN_WC__ENTRY_MODIFY_DELETED
- | SVN_WC__ENTRY_MODIFY_FORCE),
- pool);
+ err = svn_wc__entry_modify_stub(db, local_abspath,
+ &tmp_entry,
+ (SVN_WC__ENTRY_MODIFY_SCHEDULE
+ | SVN_WC__ENTRY_MODIFY_COPIED
+ | SVN_WC__ENTRY_MODIFY_DELETED
+ | SVN_WC__ENTRY_MODIFY_FORCE),
+ pool);
if (err != NULL)
return svn_error_createf(SVN_ERR_WC_BAD_ADM_LOG, err,
_("Error modifying entry of '%s'"), "");
@@ -2087,7 +2087,7 @@ run_file_install(svn_wc__db_t *db,
finfo.size, last_mod_time,
scratch_pool));
- /* ### there used to be a call to entry_modify2() here, to set the
+ /* ### there used to be a call to entry_modify() above, to set the
### TRANSLATED_SIZE and LAST_MOD_TIME values. that function elided
### copyfrom information that snuck into the database. it should
### not be there in the first place, but we can manually get rid