You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2013/11/20 05:02:55 UTC

svn commit: r1543706 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_wc/diff_local.c

Author: svn-role
Date: Wed Nov 20 04:02:54 2013
New Revision: 1543706

URL: http://svn.apache.org/r1543706
Log:
Merge r1541635 from trunk:

 * r1541635
   Allow using 'svn diff F:/' for those poor Windows users that have a working
   copy in the root of the drive.
   Justification:
     Endless recursion is bad, especially in case some users might get into
     this in a pretty normal code path.
   Votes:
     +1: rhuijben, philip, stsp

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1541635

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1543706&r1=1543705&r2=1543706&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed Nov 20 04:02:54 2013
@@ -199,12 +199,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1541635
-   Allow using 'svn diff F:/' for those poor Windows users that have a working
-   copy in the root of the drive.
-   Justification:
-     Endless recursion is bad, especially in case some users might get into
-     this in a pretty normal code path.
-   Votes:
-     +1: rhuijben, philip, stsp

Modified: subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c?rev=1543706&r1=1543705&r2=1543706&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c Wed Nov 20 04:02:54 2013
@@ -116,13 +116,20 @@ ensure_state(struct diff_baton *eb,
   apr_pool_t *ns_pool;
   if (!eb->cur)
     {
-      if (!svn_dirent_is_ancestor(eb->anchor_abspath, local_abspath))
+      const char *relpath;
+
+      relpath = svn_dirent_skip_ancestor(eb->anchor_abspath, local_abspath);
+      if (! relpath)
         return SVN_NO_ERROR;
 
-      SVN_ERR(ensure_state(eb,
-                           svn_dirent_dirname(local_abspath,scratch_pool),
-                           FALSE,
-                           scratch_pool));
+      /* Don't recurse on the anchor, as that might loop infinately because
+            svn_dirent_dirname("/",...)   -> "/"
+            svn_dirent_dirname("C:/",...) -> "C:/" (Windows) */
+      if (*relpath)
+        SVN_ERR(ensure_state(eb,
+                             svn_dirent_dirname(local_abspath,scratch_pool),
+                             FALSE,
+                             scratch_pool));
     }
   else if (svn_dirent_is_child(eb->cur->local_abspath, local_abspath, NULL))
     SVN_ERR(ensure_state(eb, svn_dirent_dirname(local_abspath,scratch_pool),