Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h	(revision 14784)
+++ subversion/include/svn_client.h	(working copy)
@@ -630,11 +630,30 @@
  * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the 
  * added item.
  *
+ * Use @a no_ignore to indicate that files and directories that match
+ * ignore patterns should be added.
+ *
  * Important:  this is a *scheduling* operation.  No changes will
  * happen to the repository until a commit occurs.  This scheduling
  * can be removed with svn_client_revert().
+ *
+ * @since New in 1.3.
  */
 svn_error_t *
+svn_client_add3 (const char *path,
+                 svn_boolean_t recursive,
+                 svn_boolean_t force,
+                 svn_boolean_t no_ignore,
+                 svn_client_ctx_t *ctx,
+                 apr_pool_t *pool);
+
+/**
+ * Similar to svn_client_add3(), but with the @a no_ignore parameter
+ * always set to @c FALSE.
+ *
+ * @deprecated Provided for backward compatibility with the 1.2 API.
+ */
+svn_error_t *
 svn_client_add2 (const char *path,
                  svn_boolean_t recursive,
                  svn_boolean_t force,
@@ -744,13 +763,32 @@
  * Use @a nonrecursive to indicate that imported directories should not
  * recurse into any subdirectories they may have.
  *
+ * Use @a no_ignore to indicate that files and directories that match
+ * ignore patterns should be imported.
+ *
  * ### kff todo: This import is similar to cvs import, in that it does
  * not change the source tree into a working copy.  However, this
  * behavior confuses most people, and I think eventually svn _should_
  * turn the tree into a working copy, or at least should offer the
  * option. However, doing so is a bit involved, and we don't need it
  * right now.  
+ *
+ * @since New in 1.3.
  */
+svn_error_t *svn_client_import2 (svn_client_commit_info_t **commit_info,
+                                 const char *path,
+                                 const char *url,
+                                 svn_boolean_t nonrecursive,
+                                 svn_boolean_t no_ignore,
+                                 svn_client_ctx_t *ctx,
+                                 apr_pool_t *pool);
+
+/**
+ * Similar to svn_client_import2 except for @a no_ignore set to FALSE
+ * always. 
+ * 
+ * @deprecated Provided for backward compatibility with the 1.2 API.
+ */
 svn_error_t *svn_client_import (svn_client_commit_info_t **commit_info,
                                 const char *path,
                                 const char *url,
@@ -758,7 +796,6 @@
                                 svn_client_ctx_t *ctx,
                                 apr_pool_t *pool);
 
-
 /** @since New in 1.2.
  *
  * Commit files or directories into repository, authenticating with
Index: subversion/libsvn_client/add.c
===================================================================
--- subversion/libsvn_client/add.c	(revision 14784)
+++ subversion/libsvn_client/add.c	(working copy)
@@ -266,6 +266,7 @@
 add_dir_recursive (const char *dirname,
                    svn_wc_adm_access_t *adm_access,
                    svn_boolean_t force,
+                   svn_boolean_t no_ignore,
                    svn_client_ctx_t *ctx,
                    apr_pool_t *pool)
 {
@@ -293,7 +294,8 @@
 
   SVN_ERR (svn_wc_adm_retrieve (&dir_access, adm_access, dirname, pool));
 
-  SVN_ERR (svn_wc_get_default_ignores (&ignores, ctx->config, pool));
+  if (!no_ignore)
+    SVN_ERR (svn_wc_get_default_ignores (&ignores, ctx->config, pool));
 
   /* Create a subpool for iterative memory control. */
   subpool = svn_pool_create (pool);
@@ -322,8 +324,11 @@
               || (this_entry.name[1] == '.' && this_entry.name[2] == '\0')))
         continue;
 
-      if (svn_cstring_match_glob_list (this_entry.name, ignores))
-        continue;
+      if (!no_ignore)
+        {
+          if (svn_cstring_match_glob_list (this_entry.name, ignores))
+            continue;
+        }
 
       /* Construct the full path of the entry. */
       fullpath = svn_path_join (dirname, this_entry.name, subpool);
@@ -332,7 +337,7 @@
       if (this_entry.filetype == APR_DIR)
         {
           SVN_ERR (add_dir_recursive (fullpath, dir_access, force,
-                                      ctx, subpool));
+                                      no_ignore, ctx, subpool));
         }
       else if (this_entry.filetype != APR_UNKFILE)
         {
@@ -384,6 +389,7 @@
 add (const char *path, 
      svn_boolean_t recursive,
      svn_boolean_t force,
+     svn_boolean_t no_ignore,
      svn_wc_adm_access_t *adm_access,
      svn_client_ctx_t *ctx,
      apr_pool_t *pool)
@@ -393,7 +399,7 @@
 
   SVN_ERR (svn_io_check_path (path, &kind, pool));
   if ((kind == svn_node_dir) && recursive)
-    err = add_dir_recursive (path, adm_access, force, ctx, pool);
+    err = add_dir_recursive (path, adm_access, force, no_ignore, ctx, pool);
   else if (kind == svn_node_file)
     err = add_file (path, ctx, adm_access, pool);
   else
@@ -426,7 +432,7 @@
                              TRUE, 0, ctx->cancel_func, ctx->cancel_baton,
                              pool));
 
-  err = add (path, recursive, FALSE, adm_access, ctx, pool);
+  err = add (path, recursive, FALSE, FALSE, adm_access, ctx, pool);
   
   err2 = svn_wc_adm_close (adm_access);
   if (err2)
@@ -442,9 +448,10 @@
 
 
 svn_error_t *
-svn_client_add2 (const char *path, 
+svn_client_add3 (const char *path, 
                  svn_boolean_t recursive,
                  svn_boolean_t force,
+                 svn_boolean_t no_ignore,
                  svn_client_ctx_t *ctx,
                  apr_pool_t *pool)
 {
@@ -456,7 +463,7 @@
                              TRUE, 0, ctx->cancel_func, ctx->cancel_baton,
                              pool));
 
-  err = add (path, recursive, force, adm_access, ctx, pool);
+  err = add (path, recursive, force, no_ignore, adm_access, ctx, pool);
   
   err2 = svn_wc_adm_close (adm_access);
   if (err2)
@@ -470,6 +477,20 @@
   return err;
 }
 
+svn_error_t *
+svn_client_add2 (const char *path,
+                 svn_boolean_t recursive,
+                 svn_boolean_t force,
+                 svn_client_ctx_t *ctx,
+                 apr_pool_t *pool)
+{
+  return svn_client_add3 (path,
+                          recursive,
+                          force,
+                          FALSE,
+                          ctx,
+                          pool);
+}
 
 static svn_error_t *
 path_driver_cb_func (void **dir_baton,
Index: subversion/libsvn_client/commit.c
===================================================================
--- subversion/libsvn_client/commit.c	(revision 14784)
+++ subversion/libsvn_client/commit.c	(working copy)
@@ -297,6 +297,7 @@
             const char *edit_path,
             svn_boolean_t nonrecursive,
             apr_hash_t *excludes,
+            svn_boolean_t no_ignore,
             import_ctx_t *import_ctx,
             svn_client_ctx_t *ctx,
             apr_pool_t *pool)
@@ -308,7 +309,8 @@
 
   SVN_ERR (svn_path_check_valid (path, pool));
 
-  SVN_ERR (svn_wc_get_default_ignores (&ignores, ctx->config, pool));
+  if (!no_ignore)
+    SVN_ERR (svn_wc_get_default_ignores (&ignores, ctx->config, pool));
 
   SVN_ERR (svn_io_get_dirents (&dirents, path, pool));
 
@@ -364,8 +366,11 @@
       if (apr_hash_get (excludes, abs_path, APR_HASH_KEY_STRING))
         continue;
 
-      if (svn_cstring_match_glob_list (filename, ignores))
-        continue;
+      if (!no_ignore)
+        {
+          if (svn_cstring_match_glob_list (filename, ignores))
+            continue;
+        }
 
       /* We only import subdirectories when we're doing a regular
          recursive import. */
@@ -399,9 +404,10 @@
             }
 
           /* Recurse. */
-          SVN_ERR (import_dir (editor, this_dir_baton, 
-                               this_path, this_edit_path, 
-                               FALSE, excludes, import_ctx, ctx, subpool));
+          SVN_ERR (import_dir (editor, this_dir_baton, this_path, 
+                               this_edit_path, FALSE, excludes, 
+                               no_ignore, import_ctx, ctx, 
+                               subpool));
 
           /* Finally, close the sub-directory. */
           SVN_ERR (editor->close_directory (this_dir_baton, subpool));
@@ -443,7 +449,7 @@
  *
  * EXCLUDES is a hash whose keys are absolute paths to exclude from
  * the import (values are unused).
- * 
+ *
  * Use POOL for any temporary allocation.
  *
  * Note: the repository directory receiving the import was specified
@@ -458,6 +464,7 @@
         void *edit_baton,
         svn_boolean_t nonrecursive,
         apr_hash_t *excludes,
+        svn_boolean_t no_ignore,
         svn_client_ctx_t *ctx,
         apr_pool_t *pool)
 {
@@ -522,15 +529,22 @@
 
   if (kind == svn_node_file)
     {
-      SVN_ERR (svn_wc_get_default_ignores (&ignores, ctx->config, pool));
-      if (! svn_cstring_match_glob_list (path, ignores))
+      svn_boolean_t ignores_match;
+
+      if (!no_ignore)
+        {
+          SVN_ERR (svn_wc_get_default_ignores (&ignores, ctx->config, pool));
+          ignores_match = svn_cstring_match_glob_list (path, ignores);
+        }
+      if ((no_ignore) || (!ignores_match)) 
         SVN_ERR (import_file (editor, root_baton, path, edit_path,
                               import_ctx, ctx, pool));
     }
   else if (kind == svn_node_dir)
     {
       SVN_ERR (import_dir (editor, root_baton, path, edit_path,
-                           nonrecursive, excludes, import_ctx, ctx, pool));
+                           nonrecursive, excludes, no_ignore, import_ctx, 
+                           ctx, pool));
 
     }
   else if (kind == svn_node_none)
@@ -616,12 +630,13 @@
 /*** Public Interfaces. ***/
 
 svn_error_t *
-svn_client_import (svn_client_commit_info_t **commit_info,
-                   const char *path,
-                   const char *url,
-                   svn_boolean_t nonrecursive,
-                   svn_client_ctx_t *ctx,
-                   apr_pool_t *pool)
+svn_client_import2 (svn_client_commit_info_t **commit_info,
+                    const char *path,
+                    const char *url,
+                    svn_boolean_t nonrecursive,
+                    svn_boolean_t no_ignore,
+                    svn_client_ctx_t *ctx,
+                    apr_pool_t *pool)
 {
   svn_error_t *err = SVN_NO_ERROR;
   const char *log_msg = "";
@@ -743,7 +758,7 @@
   /* If an error occurred during the commit, abort the edit and return
      the error.  We don't even care if the abort itself fails.  */
   if ((err = import (path, new_entries, editor, edit_baton, 
-                     nonrecursive, excludes, ctx, subpool)))
+                     nonrecursive, excludes, no_ignore, ctx, subpool)))
     {
       svn_error_clear (editor->abort_edit (edit_baton, subpool));
       return err;
@@ -768,7 +783,19 @@
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_client_import (svn_client_commit_info_t **commit_info,
+                    const char *path,
+                    const char *url,
+                    svn_boolean_t nonrecursive,
+                    svn_client_ctx_t *ctx,
+                    apr_pool_t *pool)
+{
+  return svn_client_import2 (commit_info, path, url, nonrecursive,
+                             FALSE, ctx, pool);
+}
 
+
 static svn_error_t *
 remove_tmpfiles (apr_hash_t *tempfiles,
                  apr_pool_t *pool)
Index: subversion/clients/cmdline/add-cmd.c
===================================================================
--- subversion/clients/cmdline/add-cmd.c	(revision 14784)
+++ subversion/clients/cmdline/add-cmd.c	(working copy)
@@ -63,8 +63,9 @@
 
       svn_pool_clear (subpool);
       SVN_ERR (svn_cl__check_cancel (ctx->cancel_baton));
-      err = svn_client_add2 (target, (! opt_state->nonrecursive), 
-                             opt_state->force, ctx, subpool);
+      err = svn_client_add3 (target, (! opt_state->nonrecursive), 
+                             opt_state->force, opt_state->no_ignore,
+                             ctx, subpool);
       if (err)
         {
           if (err->apr_err == SVN_ERR_ENTRY_EXISTS)
Index: subversion/clients/cmdline/import-cmd.c
===================================================================
--- subversion/clients/cmdline/import-cmd.c	(revision 14784)
+++ subversion/clients/cmdline/import-cmd.c	(working copy)
@@ -107,12 +107,13 @@
   SVN_ERR (svn_cl__make_log_msg_baton (&(ctx->log_msg_baton), opt_state, 
                                        NULL, ctx->config, pool));
   SVN_ERR (svn_cl__cleanup_log_msg 
-           (ctx->log_msg_baton, svn_client_import (&commit_info,
-                                                   path,
-                                                   url,
-                                                   opt_state->nonrecursive,
-                                                   ctx,
-                                                   pool)));
+           (ctx->log_msg_baton, svn_client_import2 (&commit_info,
+                                                    path,
+                                                    url,
+                                                    opt_state->nonrecursive,
+                                                    opt_state->no_ignore,
+                                                    ctx,
+                                                    pool)));
 
   if (commit_info && ! opt_state->quiet)
     SVN_ERR (svn_cl__print_commit_info (commit_info, pool));
Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c	(revision 14784)
+++ subversion/clients/cmdline/main.c	(working copy)
@@ -183,7 +183,8 @@
        "them for addition to repository.  They will be added in next commit.\n"
        "usage: add PATH...\n"),
     {svn_cl__targets_opt, 'N', 'q', svn_cl__config_dir_opt,
-     svn_cl__force_opt, svn_cl__autoprops_opt, svn_cl__no_autoprops_opt} },
+     svn_cl__force_opt, svn_cl__no_ignore_opt, svn_cl__autoprops_opt, 
+     svn_cl__no_autoprops_opt} },
 
   { "blame", svn_cl__blame, {"praise", "annotate", "ann"},
     N_("Output the content of specified files or\n"
@@ -351,7 +352,8 @@
        "  If PATH is a directory, the contents of the directory are added\n"
        "  directly under URL.\n"),
     {'q', 'N', svn_cl__autoprops_opt, svn_cl__no_autoprops_opt,
-     SVN_CL__LOG_MSG_OPTIONS, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt} },
+     SVN_CL__LOG_MSG_OPTIONS, svn_cl__no_ignore_opt, SVN_CL__AUTH_OPTIONS, 
+     svn_cl__config_dir_opt} },
  
   { "info", svn_cl__info, {0},
     N_("Display information about a local or remote item.\n"
Index: subversion/tests/clients/cmdline/import_tests.py
===================================================================
--- subversion/tests/clients/cmdline/import_tests.py	(revision 14784)
+++ subversion/tests/clients/cmdline/import_tests.py	(working copy)
@@ -189,6 +189,83 @@
                                         None, None, 1)
 
 #----------------------------------------------------------------------
+def import_no_ignores(sbox):
+  'import ignored files in imported dirs'
+
+  # import ignored files using the "--no-ignore" option
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  dir_path = os.path.join(wc_dir, 'dir')
+  foo_c_path = os.path.join(dir_path, 'foo.c')
+  foo_o_path = os.path.join(dir_path, 'foo.o')
+  foo_lo_path = os.path.join(dir_path, 'foo.lo')
+  foo_rej_path = os.path.join(dir_path, 'foo.rej')
+
+  os.mkdir(dir_path, 0755)
+  open(foo_c_path, 'w')
+  open(foo_o_path, 'w')
+  open(foo_lo_path, 'w')
+  open(foo_rej_path, 'w')
+
+  # import new dir into repository
+  url = svntest.main.current_repo_url + '/dir'
+
+  output, errput = svntest.actions.run_and_verify_svn(
+    None, None, [], 'import',
+    '--username', svntest.main.wc_author,
+    '--password', svntest.main.wc_passwd,
+    '-m', 'Log message for new import', '--no-ignore', 
+    dir_path, url)
+
+  lastline = string.strip(output.pop())
+  cm = re.compile ("(Committed|Imported) revision [0-9]+.")
+  match = cm.search (lastline)
+  if not match:
+    ### we should raise a less generic error here. which?
+    raise svntest.actions.SVNUnexpectedOutput
+
+  # remove (uncontrolled) local dir
+  svntest.main.safe_rmtree(dir_path)
+
+  # Create expected disk tree for the update (disregarding props)
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({
+    'dir/foo.c' : Item(''),
+    'dir/foo.o' : Item(''),
+    'dir/foo.lo' : Item(''),
+    'dir/foo.rej' : Item(''),
+    })
+
+  # Create expected status tree for the update (disregarding props).
+  # Newly imported file should be at revision 2.
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+  expected_status.add({
+    'dir' : Item(status='  ', wc_rev=2),
+    'dir/foo.c' : Item(status='  ', wc_rev=2),
+    'dir/foo.o' : Item(status='  ', wc_rev=2),
+    'dir/foo.lo' : Item(status='  ', wc_rev=2),
+    'dir/foo.rej' : Item(status='  ', wc_rev=2),
+    })
+
+  # Create expected output tree for the update.
+  expected_output = svntest.wc.State(wc_dir, {
+    'dir' : Item(status='A '),
+    'dir/foo.c' : Item(status='A '),
+    'dir/foo.o' : Item(status='A '),
+    'dir/foo.lo' : Item(status='A '),
+    'dir/foo.rej' : Item(status='A '),
+    })
+
+  # do update and check three ways
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None, None,
+                                        None, None, 1)
+#----------------------------------------------------------------------
 def import_avoid_empty_revision(sbox):
   "avoid creating empty revisions with import"
   
@@ -224,6 +301,7 @@
 test_list = [ None,
               Skip(import_executable, (os.name != 'posix')),
               import_ignores,
+              import_no_ignores,
               import_avoid_empty_revision,
              ]
 
Index: subversion/tests/clients/cmdline/basic_tests.py
===================================================================
--- subversion/tests/clients/cmdline/basic_tests.py	(revision 14784)
+++ subversion/tests/clients/cmdline/basic_tests.py	(working copy)
@@ -1440,6 +1440,35 @@
 
 
 #----------------------------------------------------------------------
+def basic_add_no_ignores(sbox):
+  'add ignored files in added dirs'
+
+  # add ignored files using the '--no-ignore' option
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  dir_path = os.path.join(wc_dir, 'dir')
+  foo_c_path = os.path.join(dir_path, 'foo.c')
+  # add a few files that match typical ignore patterns
+  foo_o_path = os.path.join(dir_path, 'foo.o')
+  foo_lo_path = os.path.join(dir_path, 'foo.lo')
+  foo_rej_path = os.path.join(dir_path, 'foo.rej')
+
+  os.mkdir(dir_path, 0755)
+  open(foo_c_path, 'w')
+  open(foo_o_path, 'w')
+  open(foo_lo_path, 'w')
+  open(foo_rej_path, 'w')
+
+  output, err = svntest.actions.run_and_verify_svn(
+    "No output where some expected", SVNAnyOutput, None,
+    'add', '--no-ignore', dir_path)
+
+  for line in output:
+    # If we don't see ignores in the add output, fail the test.
+    if not re.match(r'^A\s+.*(foo.(o|rej|lo|c)|dir)$', line):
+      raise svntest.actions.SVNUnexpectedOutput
+#----------------------------------------------------------------------
 def uri_syntax(sbox):
   'make sure URI syntaxes are parsed correctly'
 
@@ -1534,6 +1563,7 @@
               nonexistent_repository,
               basic_auth_cache,
               basic_add_ignores,
+              basic_add_no_ignores,
               uri_syntax,
               basic_checkout_file,
               basic_info,


