You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/08/10 22:56:05 UTC

svn commit: r984206 [28/35] - in /subversion/branches/ignore-mergeinfo: ./ build/ build/generator/ build/generator/templates/ build/hudson/ build/hudson/jobs/subversion-1.6.x-solaris/ build/hudson/jobs/subversion-1.6.x-ubuntu/ build/hudson/jobs/subvers...

Modified: subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/log.c?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/log.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/log.c Tue Aug 10 20:55:56 2010
@@ -1,5 +1,5 @@
 /*
- * log.c: handle the log-report request and response
+ * log.c: mod_dav_svn REPORT handler for querying revision log info
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one

Modified: subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/mergeinfo.c?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/mergeinfo.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/mergeinfo.c Tue Aug 10 20:55:56 2010
@@ -1,5 +1,5 @@
 /*
- * mergeinfo.c :  routines for getting mergeinfo
+ * mergeinfo.c: mod_dav_svn REPORT handler for querying mergeinfo
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one
@@ -56,7 +56,6 @@ dav_svn__get_mergeinfo_report(const dav_
   int ns;
   apr_bucket_brigade *bb;
   apr_hash_index_t *hi;
-  svn_boolean_t sent_anything = FALSE;
 
   /* These get determined from the request document. */
   svn_revnum_t rev = SVN_INVALID_REVNUM;
@@ -145,7 +144,6 @@ dav_svn__get_mergeinfo_report(const dav_
      we are condemned to live in another universe, so we must keep
      track ourselves of whether we've sent anything or not.  See the
      long comment after the 'cleanup' label for more details. */
-  sent_anything = TRUE;
   serr = dav_svn__brigade_puts(bb, output,
                                DAV_XML_HEADER DEBUG_CR
                                "<S:" SVN_DAV__MERGEINFO_REPORT " "

Modified: subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/replay.c?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/replay.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/replay.c Tue Aug 10 20:55:56 2010
@@ -1,5 +1,5 @@
 /*
- * replay.c :  routines for replaying revisions
+ * replay.c: mod_dav_svn REPORT handler for replaying revisions
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one

Modified: subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/update.c?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/reports/update.c Tue Aug 10 20:55:56 2010
@@ -1,5 +1,5 @@
 /*
- * update.c: handle the update-report request and response
+ * update.c: mod_dav_svn REPORT handler for transmitting tree deltas
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one
@@ -924,6 +924,7 @@ dav_svn__update_report(const dav_resourc
   void *rbaton = NULL;
   update_ctx_t uc = { 0 };
   svn_revnum_t revnum = SVN_INVALID_REVNUM;
+  svn_boolean_t revnum_is_head = FALSE;
   svn_revnum_t from_revnum = SVN_INVALID_REVNUM;
   int ns;
   /* entry_counter and entry_is_empty are for operational logging. */
@@ -1131,6 +1132,7 @@ dav_svn__update_report(const dav_resourc
                                     "Could not determine the youngest "
                                     "revision for the update process.",
                                     resource->pool);
+      revnum_is_head = TRUE;
     }
 
   uc.svndiff_version = resource->info->svndiff_version;
@@ -1246,6 +1248,21 @@ dav_svn__update_report(const dav_resourc
                   {
                     rev = SVN_STR_TO_REV(this_attr->value);
                     saw_rev = TRUE;
+                    if (revnum_is_head && rev > revnum)
+                      {
+                        /* ### This error could be improved with more details
+                           ### if we know  that this repository is a slave
+                           ### repository in a master-slave setup. */
+                        return dav_svn__new_error_tag(
+                                            resource->pool,
+                                            HTTP_INTERNAL_SERVER_ERROR,
+                                            0,
+                                            "A reported revision is higher"
+                                            " than the current HEAD revision"
+                                            " of the repository.",
+                                            SVN_DAV_ERROR_NAMESPACE,
+                                            SVN_DAV_ERROR_TAG);
+                      }
                   }
                 else if (strcmp(this_attr->name, "depth") == 0)
                   depth = svn_depth_from_word(this_attr->value);
@@ -1327,13 +1344,7 @@ dav_svn__update_report(const dav_resourc
   /* Try to deduce what sort of client command is being run, then
      make this guess available to apache's logging subsystem. */
   {
-    const char *action, *spath, *log_depth;
-
-    if (requested_depth == svn_depth_unknown)
-      log_depth = "";
-    else
-      log_depth = apr_pstrcat(resource->pool, " depth=",
-                              svn_depth_to_word(requested_depth), NULL);
+    const char *action, *spath;
 
     if (target)
       spath = svn_path_join(src_path, target, resource->pool);

Modified: subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/repos.c?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/repos.c Tue Aug 10 20:55:56 2010
@@ -4263,14 +4263,38 @@ dav_svn__create_version_resource(dav_res
 }
 
 
-/* POST handler for commits over HTTP protocol v2.
+/* POST handler for HTTP protocol v2.
+ 
+   Currently we allow POSTs only against the "me resource", which may
+   in the future act as a dispatcher of sorts for handling potentially
+   many different kinds of operations as specified by the body of the
+   POST request itself.
+
+   ### TODO: Define what the format of those POST bodies might be.  If
+   ### XML, we have access to Apache's streamy XML parsing code, but
+   ### ... it's XML.  Meh.  If skels, we get skels!  But we need to
+   ### write our own streamy skel parsing routine around a brigade
+   ### read loop.  Ewww...
+   ###
+   ### Today we only support transaction creation requests, but we
+   ### could conceivable support the likes of a multi-path lock
+   ### and/or unlock request, or some other thing for which stock
+   ### WebDAV doesn't work or doesn't work well enough.
+   ###
+   ### Fortunately, today we don't use the POST body at all, and we'll
+   ### be able to get away with not defining the body format in the
+   ### future thanks to the following:
+
+   As a special consideration, an empty POST body is interpreted as a
+   simple request to create a new commit transaction based on the HEAD
+   revision.  The new transaction name will be returned via a custom
+   response header SVN_DAV_TXN_NAME_HEADER.
 */
 int dav_svn__method_post(request_rec *r)
 {
   dav_resource *resource;
   dav_error *derr;
   const char *txn_name;
-  const char *repos_root_uri;
 
   derr = get_resource(r, dav_svn__get_root_dir(r),
                       "ignored", 0, &resource);
@@ -4287,10 +4311,6 @@ int dav_svn__method_post(request_rec *r)
 
   /* Build a "201 Created" response with header that tells the client
      our new transaction's name. */
-  repos_root_uri = dav_svn__build_uri(resource->info->repos,
-                                      DAV_SVN__BUILD_URI_PUBLIC,
-                                      SVN_IGNORED_REVNUM, "", 0,
-                                      resource->pool);
   apr_table_set(resource->info->r->headers_out, SVN_DAV_TXN_NAME_HEADER,
                 txn_name);
   r->status = HTTP_CREATED;