You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/12/06 19:02:32 UTC

svn commit: r1418017 - in /subversion/trunk/subversion: libsvn_client/add.c libsvn_client/client.h tests/cmdline/prop_tests.py

Author: pburba
Date: Thu Dec  6 18:02:31 2012
New Revision: 1418017

URL: http://svn.apache.org/viewvc?rev=1418017&view=rev
Log:
Ugh.  Follow-up to r1409064, implement a behavior that change promised but
didn't deliver.

Morals: 1) Mega commits that deliver multiple behavior changes are never a
great idea and 2) if you promised a behavior change but didn't a) change an
existing test or b) add a new test, well then you had better well be
suspicious.

* subversion/libsvn_client/add.c

  (add_dir_recursive): Remove one of the three arguments that control how
   ignore patterns are considered, we only need two because since r1409064
   we supposedly consider all ignore patterns or none, there's no in-between.

  (svn_client__get_all_ignores): Remove NO_IGNORE argument, just get *all*
   ignore patterns, unconditionally.

  (add): Update call to add_dir_recursive().

* subversion/libsvn_client/client.h

  (svn_client__get_all_ignores): Remove NO_IGNORE argument, just get *all*
   ignore patterns, unconditionally.

* subversion/tests/cmdline/prop_tests.py

  (inheritable_ignores): Alter test expectations such that the 'svn add
   --no-ignore' disregards *all* ignore patterns.  Also use sbox.ospath
   in place of os.path.join where possible.

Modified:
    subversion/trunk/subversion/libsvn_client/add.c
    subversion/trunk/subversion/libsvn_client/client.h
    subversion/trunk/subversion/tests/cmdline/prop_tests.py

Modified: subversion/trunk/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/add.c?rev=1418017&r1=1418016&r2=1418017&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/add.c (original)
+++ subversion/trunk/subversion/libsvn_client/add.c Thu Dec  6 18:02:31 2012
@@ -381,9 +381,6 @@ add_file(const char *local_abspath,
  * If DIR_ABSPATH (or any item below DIR_ABSPATH) is already scheduled for
  * addition, add will fail and return an error unless FORCE is TRUE.
  *
- * Files and directories that match ignore patterns will not be added unless
- * NO_IGNORE is TRUE.
- *
  * Use MAGIC_COOKIE (which may be NULL) to detect the mime-type of files
  * if necessary.
  *
@@ -411,7 +408,6 @@ static svn_error_t *
 add_dir_recursive(const char *dir_abspath,
                   svn_depth_t depth,
                   svn_boolean_t force,
-                  svn_boolean_t no_ignore,
                   svn_boolean_t no_autoprops,
                   svn_magic__cookie_t *magic_cookie,
                   apr_hash_t *config_autoprops,
@@ -435,7 +431,7 @@ add_dir_recursive(const char *dir_abspat
 
   if (refresh_ignores)
     SVN_ERR(svn_client__get_all_ignores(&ignores, dir_abspath,
-                                        no_ignore, ctx, scratch_pool,
+                                        ctx, scratch_pool,
                                         iterpool));
 
   /* Add this directory to revision control. */
@@ -517,7 +513,7 @@ add_dir_recursive(const char *dir_abspat
             refresh_ignores = FALSE;
 
           SVN_ERR(add_dir_recursive(abspath, depth_below_here,
-                                    force, no_ignore, no_autoprops,
+                                    force, no_autoprops,
                                     magic_cookie, config_autoprops,
                                     refresh_ignores, ignores, ctx,
                                     iterpool));
@@ -892,7 +888,6 @@ svn_error_t *svn_client__get_inherited_i
 
 svn_error_t *svn_client__get_all_ignores(apr_array_header_t **ignores,
                                          const char *local_abspath,
-                                         svn_boolean_t no_ignore,
                                          svn_client_ctx_t *ctx,
                                          apr_pool_t *result_pool,
                                          apr_pool_t *scratch_pool)
@@ -951,11 +946,8 @@ svn_error_t *svn_client__get_all_ignores
 
   /* Now that we are sure we have an existing parent, get the config ignore
      and the local ignore patterns... */
-  if (!no_ignore)
-    SVN_ERR(svn_wc_get_ignores2(ignores, ctx->wc_ctx, local_abspath,
-                                ctx->config, result_pool, scratch_pool));
-  else
-    *ignores = apr_array_make(result_pool, 16, sizeof(const char *));
+  SVN_ERR(svn_wc_get_ignores2(ignores, ctx->wc_ctx, local_abspath,
+                              ctx->config, result_pool, scratch_pool));
 
   /* ...and add the inherited ignores to it. */
   for (i = 0; i < inherited_ignores->nelts; i++)
@@ -1041,9 +1033,9 @@ add(const char *local_abspath,
       /* We use add_dir_recursive for all directory targets
          and pass depth along no matter what it is, so that the
          target's depth will be set correctly. */
-      err = add_dir_recursive(local_abspath, depth, force, no_ignore,
+      err = add_dir_recursive(local_abspath, depth, force,
                               no_autoprops, magic_cookie, NULL,
-                              TRUE, ignores, ctx, scratch_pool);
+                              !no_ignore, ignores, ctx, scratch_pool);
     }
   else if (kind == svn_node_file)
     err = add_file(local_abspath, magic_cookie, NULL,

Modified: subversion/trunk/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1418017&r1=1418016&r2=1418017&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Thu Dec  6 18:02:31 2012
@@ -394,7 +394,6 @@ svn_error_t *svn_client__get_all_auto_pr
    RESULT_POOL.  Use SCRATCH_POOL for temporary allocations. */
 svn_error_t *svn_client__get_all_ignores(apr_array_header_t **ignores,
                                          const char *local_abspath,
-                                         svn_boolean_t no_ignore,
                                          svn_client_ctx_t *ctx,
                                          apr_pool_t *result_pool,
                                          apr_pool_t *scratch_pool);

Modified: subversion/trunk/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/prop_tests.py?rev=1418017&r1=1418016&r2=1418017&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/prop_tests.py Thu Dec  6 18:02:31 2012
@@ -2535,11 +2535,11 @@ def inheritable_ignores(sbox):
   sbox.simple_propset('svn:ignore', '*.foo', 'A/B/E')
   sbox.simple_commit()
 
-  # Some directories and files that should be added because they don't
-  # match any applicable ignores.
-  X_dir_path = os.path.join(wc_dir, 'ADD-ME-DIR-X')
-  Y_dir_path = os.path.join(wc_dir, 'A', 'ADD-ME-DIR-Y.doo')
-  Z_dir_path = os.path.join(wc_dir, 'A', 'D', 'G', 'ADD-ME-DIR-Z.doo')
+  # Some directories and files that should always be added because they
+  # don't match any applicable ignore patterns.
+  X_dir_path = sbox.ospath('ADD-ME-DIR-X')
+  Y_dir_path = sbox.ospath('A/ADD-ME-DIR-Y.doo')
+  Z_dir_path = sbox.ospath('A/D/G/ADD-ME-DIR-Z.doo')
   os.mkdir(X_dir_path)
   os.mkdir(Y_dir_path)
   os.mkdir(Z_dir_path)
@@ -2547,11 +2547,11 @@ def inheritable_ignores(sbox):
   # Some directories and files that should be ignored when adding
   # because they match an ignore pattern (unless of course they are
   # the direct target of an add, which we always add).
-  boo_dir_path = os.path.join(wc_dir, 'IGNORE-ME-DIR.boo')
-  goo_dir_path = os.path.join(wc_dir, 'IGNORE-ME-DIR.boo', 'IGNORE-ME-DIR.goo')
-  doo_dir_path = os.path.join(wc_dir, 'A', 'B', 'IGNORE-ME-DIR.doo')
-  moo_dir_path = os.path.join(wc_dir, 'A', 'D', 'IGNORE-ME-DIR.moo')
-  foo_dir_path = os.path.join(wc_dir, 'A', 'B', 'E', 'IGNORE-ME-DIR.foo')
+  boo_dir_path = sbox.ospath('IGNORE-ME-DIR.boo')
+  goo_dir_path = sbox.ospath('IGNORE-ME-DIR.boo/IGNORE-ME-DIR.goo')
+  doo_dir_path = sbox.ospath('A/B/IGNORE-ME-DIR.doo')
+  moo_dir_path = sbox.ospath('A/D/IGNORE-ME-DIR.moo')
+  foo_dir_path = sbox.ospath('A/B/E/IGNORE-ME-DIR.foo')
   os.mkdir(boo_dir_path)
   os.mkdir(goo_dir_path)
   os.mkdir(doo_dir_path)
@@ -2650,8 +2650,8 @@ def inheritable_ignores(sbox):
                                      '--config-dir', config_dir)
   os.chdir(saved_wd)
 
-  # Now revert and try the add with the --no-ignore flag, only the
-  # svn:global-ignores should be enforced.
+  # Now revert and try the add with the --no-ignore flag, nothing should
+  # be ignored.
   svntest.actions.run_and_verify_svn(None, None, [], 'revert', wc_dir, '-R')
   saved_wd = os.getcwd()
   os.chdir(sbox.wc_dir)
@@ -2665,10 +2665,20 @@ def inheritable_ignores(sbox):
                                  'IGNORE-ME-DIR.goo') + '\n',
      'A         ' + os.path.join('A', 'B', 'E', 'IGNORE-ME-DIR.foo') + '\n',
      'A         ' + os.path.join('A', 'B', 'E', 'ignore-me-file.foo') + '\n',
-     'A         ' + os.path.join('A', 'D', 'G', 'ignore-me-file.goo') + '\n'])
-  svntest.actions.run_and_verify_svn("Adds in spite of ignores", expected,
-                                     [], 'add', '.', '--force','--no-ignore',
-                                     '--config-dir', config_dir)
+     'A         ' + os.path.join('A', 'D', 'G', 'ignore-me-file.goo') + '\n',
+
+     'A         ' + os.path.join('A', 'B', 'E', 'ignore-me-file.doo') + '\n',
+     'A         ' + os.path.join('A', 'B', 'IGNORE-ME-DIR.doo') + '\n',
+     'A         ' + os.path.join('A', 'B', 'IGNORE-ME-DIR.doo',
+                                 'ignore-me-file.doo') + '\n',
+     'A         ' + os.path.join('A', 'B', 'IGNORE-ME-DIR.doo',
+                                 'ignore-me-file.roo') + '\n',
+     'A         ' + os.path.join('A', 'D', 'IGNORE-ME-DIR.moo') + '\n',
+     'A         ' + os.path.join('A', 'D', 'ignore-me-file.moo') + '\n'])
+  svntest.actions.run_and_verify_svn("Files ignored with --no-ignore",
+                                     expected, [], 'add', '.', '--force',
+                                     '--no-ignore', '--config-dir',
+                                     config_dir)
 
 def almost_known_prop_names(sbox):
   "propset with svn: prefix but unknown name"