You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2015/08/12 00:21:54 UTC

svn commit: r1695385 - in /subversion/branches/patch-exec: BRANCH-README subversion/libsvn_diff/parse-diff.c

Author: danielsh
Date: Tue Aug 11 22:21:54 2015
New Revision: 1695385

URL: http://svn.apache.org/r1695385
Log:
On the patch-exec branch, document a design decision.

* subversion/libsvn_diff/parse-diff.c
  (parse_bits_into_executability): Document why we parse 0644 and 0755 only.

Modified:
    subversion/branches/patch-exec/BRANCH-README
    subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c

Modified: subversion/branches/patch-exec/BRANCH-README
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/BRANCH-README?rev=1695385&r1=1695384&r2=1695385&view=diff
==============================================================================
--- subversion/branches/patch-exec/BRANCH-README (original)
+++ subversion/branches/patch-exec/BRANCH-README Tue Aug 11 22:21:54 2015
@@ -9,7 +9,7 @@ Steps:
 - [DONE] Implement "make it executable" support, with tests
 - [DONE] Implement "make it non-executable" support, with tests
 - [DONE] Handle svn:executable and 'new mode' lines both present
-- [TODO] parser: Review handling of modes other than 0644/0755
+- [DONE] parser: Review handling of modes other than 0644/0755
                  Consider checking "mode & 0111"
 
 - [TODO] Support symlinks as well (mode 120000)

Modified: subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c?rev=1695385&r1=1695384&r2=1695385&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c Tue Aug 11 22:21:54 2015
@@ -1276,6 +1276,19 @@ parse_bits_into_executability(svn_trista
                                 0 /* min */,
                                 0777777 /* max: six octal digits */,
                                 010 /* radix (octal) */));
+
+  /* Note: 0644 and 0755 are the only modes that can occur for plain files.
+   * We deliberately choose to parse only those values: we are strict in what
+   * we accept _and_ in what we produce.
+   *
+   * (Having said that, though, we could consider relaxing the parser to also
+   * map
+   *     (mode & 0111) == 0000 -> svn_tristate_false
+   *     (mode & 0111) == 0111 -> svn_tristate_true
+   *        [anything else]    -> svn_tristate_unknown
+   * .)
+   */
+
   switch (mode & 0777)
     {
       case 0644: