You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/10/11 04:32:16 UTC
svn commit: r1181609 - /subversion/trunk/subversion/libsvn_wc/status.c
Author: rhuijben
Date: Tue Oct 11 02:32:16 2011
New Revision: 1181609
URL: http://svn.apache.org/viewvc?rev=1181609&view=rev
Log:
Revert the removal of the calculations of repository paths of remotely added
nodes in r953751, by reintroducing similar code using repository relative paths.
This should fix the javahl test failure recently introduced by markphip.
* subversion/libsvn_wc/status.c
(dir_baton, file_baton): Add repos_relpath field.
(tweak_statushash): Fill repos_relpath from baton if not already read from
the working copy.
(make_dir_baton, make_file_baton): Calculate and store repos_relpath.
Found by: markphip
philip
Modified:
subversion/trunk/subversion/libsvn_wc/status.c
Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=1181609&r1=1181608&r2=1181609&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Tue Oct 11 02:32:16 2011
@@ -184,6 +184,9 @@ struct dir_baton
/* The pool in which this baton itself is allocated. */
apr_pool_t *pool;
+ /* The repository root relative path to this item in the repository. */
+ const char *repos_relpath;
+
/* out-of-date info corresponding to ood_* fields in svn_wc_status3_t. */
svn_node_kind_t ood_kind;
svn_revnum_t ood_changed_rev;
@@ -223,6 +226,9 @@ struct file_baton
the code that syncs up the adm dir and working copy. */
svn_boolean_t prop_changed;
+ /* The repository root relative path to this item in the repository. */
+ const char *repos_relpath;
+
/* out-of-date info corresponding to ood_* fields in svn_wc_status3_t. */
svn_node_kind_t ood_kind;
svn_revnum_t ood_changed_rev;
@@ -1573,6 +1579,27 @@ tweak_statushash(void *baton,
{
struct dir_baton *b = this_dir_baton;
+ if (!statstruct->repos_relpath && b->repos_relpath)
+ {
+ if (statstruct->repos_node_status == svn_wc_status_deleted)
+ {
+ /* When deleting PATH, BATON is for PATH's parent,
+ so we must construct PATH's real statstruct->url. */
+ statstruct->repos_relpath =
+ svn_relpath_join(b->repos_relpath,
+ svn_dirent_basename(local_abspath,
+ NULL),
+ pool);
+ }
+ else
+ statstruct->repos_relpath = apr_pstrdup(pool, b->repos_relpath);
+
+ statstruct->repos_root_url =
+ b->edit_baton->anchor_status->repos_root_url;
+ statstruct->repos_uuid =
+ b->edit_baton->anchor_status->repos_uuid;
+ }
+
/* The last committed date, and author for deleted items
isn't available. */
if (statstruct->repos_node_status == svn_wc_status_deleted)
@@ -1606,6 +1633,14 @@ tweak_statushash(void *baton,
struct file_baton *b = baton;
statstruct->ood_changed_rev = b->ood_changed_rev;
statstruct->ood_changed_date = b->ood_changed_date;
+ if (!statstruct->repos_relpath && b->repos_relpath)
+ {
+ statstruct->repos_relpath = apr_pstrdup(pool, b->repos_relpath);
+ statstruct->repos_root_url =
+ b->edit_baton->anchor_status->repos_root_url;
+ statstruct->repos_uuid =
+ b->edit_baton->anchor_status->repos_uuid;
+ }
statstruct->ood_kind = b->ood_kind;
if (b->ood_changed_author)
statstruct->ood_changed_author =
@@ -1628,9 +1663,9 @@ find_dir_repos_relpath(const struct dir_
const svn_wc_status3_t *status = apr_hash_get(pb->statii,
db->local_abspath,
APR_HASH_KEY_STRING);
- /* Note that status->url is NULL in the case of a missing
- * directory, which means we need to recurse up another level to
- * get a useful URL. */
+ /* Note that status->repos_relpath could be NULL in the case of a missing
+ * directory, which means we need to recurse up another level to get
+ * a useful relpath. */
if (status)
return status->repos_relpath;
@@ -1675,6 +1710,7 @@ make_dir_baton(void **dir_baton,
d->statii = apr_hash_make(pool);
d->ood_changed_rev = SVN_INVALID_REVNUM;
d->ood_changed_date = 0;
+ d->repos_relpath = apr_pstrdup(pool, find_dir_repos_relpath(d, pool));
d->ood_kind = svn_node_dir;
d->ood_changed_author = NULL;
@@ -1768,6 +1804,8 @@ make_file_baton(struct dir_baton *parent
f->edit_baton = eb;
f->ood_changed_rev = SVN_INVALID_REVNUM;
f->ood_changed_date = 0;
+ f->repos_relpath = svn_relpath_join(find_dir_repos_relpath(pb, pool),
+ f->name, pool);
f->ood_kind = svn_node_file;
f->ood_changed_author = NULL;
return f;