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

Re: Committing incomplete directories

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Mon, 24 Oct 2011 18:41:46 +0100

Julian Foad <julianfoad_at_btopenworld.com> writes:

> Philip Martin <philip.martin_at_wandisco.com> wrote:
>> http://subversion.tigris.org/issues/show_bug.cgi?id=4042
> [...] Should we support that in 1.7?  Or should we simply have the
>> client refuse to commit incomplete nodes.  Most incomplete nodes
>> occur after an interrupted update, but wc could have incomplete
>> working nodes resulting from a wc-wc copy.
>
> I think we should start refusing to commit changes to or in an
> incomplete' directory, in order to keep things simple. I don't see a
> practical reason why such a commit should be supported, only the
> eternal desire to keep backward-compatibility. Back-compat is very
> important to me in general, but here it appears to me that we have an
> example of a behaviour which isn't wanted and merely happened to
> exist. (I mean the ability to commit a dir while it's marked
> incomplete' is not important, I don't mean nobody ever finds a use for
> it.) Please speak up if I'm wrong about that.

I think it's relatively simple to make 1.7 behave the same as 1.6:

Index: subversion/libsvn_wc/adm_ops.c
===================================================================
--- subversion/libsvn_wc/adm_ops.c (revision 1188176)
+++ subversion/libsvn_wc/adm_ops.c (working copy)
@@ -174,6 +174,7 @@
     }
 
   SVN_ERR_ASSERT(status == svn_wc__db_status_normal
+ || status == svn_wc__db_status_incomplete
                  || status == svn_wc__db_status_added);
 
   if (kind != svn_kind_dir)
Index: subversion/libsvn_wc/wc_db.c
===================================================================
--- subversion/libsvn_wc/wc_db.c (revision 1188176)
+++ subversion/libsvn_wc/wc_db.c (working copy)
@@ -8567,6 +8567,7 @@
   apr_int64_t repos_id;
   const char *repos_relpath;
   apr_int64_t op_depth;
+ svn_wc__db_status_t old_presence;
 
     /* If we are adding a file or directory, then we need to get
      repository information from the parent node since "this node" does
@@ -8629,6 +8630,8 @@
   if (cb->keep_changelist && have_act)
     changelist = svn_sqlite__column_text(stmt_act, 1, scratch_pool);
 
+ old_presence = svn_sqlite__column_token(stmt_info, 3, presence_map);
+
   /* ### other stuff? */
 
   SVN_ERR(svn_sqlite__reset(stmt_info));
@@ -8684,8 +8687,10 @@
   else
     parent_relpath = svn_relpath_dirname(local_relpath, scratch_pool);
 
- /* ### other presences? or reserve that for separate functions? */
- new_presence = svn_wc__db_status_normal;
+ /* Preserve any incomplete status */
+ new_presence = (old_presence == svn_wc__db_status_incomplete
+ ? svn_wc__db_status_incomplete
+ : svn_wc__db_status_normal);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_APPLY_CHANGES_TO_BASE_NODE));

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Received on 2011-10-24 19:42:21 CEST

This is an archived mail posted to the Subversion Dev mailing list.