[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r26607 - in trunk/subversion: include libsvn_client libsvn_wc svn tests/cmdline

From: Joe Swatosh <joe.swatosh_at_gmail.com>
Date: 2007-09-16 01:40:51 CEST

Hi Karl,

On 9/15/07, kfogel@tigris.org <kfogel@tigris.org> wrote:
> Author: kfogel
> Date: Sat Sep 15 00:54:39 2007
> New Revision: 26607
>
> Log:
> Add --depth support to 'svn add' and 'svn import', as part of issue #2847.
> This is also part of issue #2284 ("TODO(sd)" cleanup).
>
> * subversion/include/svn_client.h
> (svn_client_add4, svn_client_import3): Take depth argument, instead of
> recursive or nonrecursive.
> (svn_client_add3, svn_client_import2): Doc adjustments for above.
>
> * subversion/libsvn_client/add.c
> (add): Take depth instead of recursive.
> (add_dir_recursive): Take depth instead of recursive, use it to
> descend appropriately for the given depth. Simplify an error message.
> (svn_client_add4): Take depth instead of recursive. Also, clean up
> some code by re-using the path parameter and thereby allowing
> other things to be unduplicated.
> (svn_client_add3): Convert recursive to depth.
> (svn_client__make_local_parents): Pass empty depth to svn_client_add4.
>
> * subversion/libsvn_client/commit.c
> (svn_client_import3): Take depth instead of nonrecursive, pass it along
> to import.
> (import): Take depth, pass it along.
> (import_dir): Take depth instead of nonrecursive, use it to descend
> appropriately for the given depth.
> (svn_client_import2): Convert nonrecursive to depth.
>
> * subversion/svn/add-cmd.c
> (svn_cl__add): Pass depth directly to svn_client_add4.
>
> * subversion/svn/import-cmd.c
> (svn_cl__import): Pass depth directly to svn_client_import3.
>
> * subversion/libsvn_wc/adm_ops.c
> (svn_wc_add2): Convert "TODO(sd)" comment to explanatory comment.
>
> * subversion/tests/cmdline/commit_tests.py
> (nested_dir_replacements, commit_uri_unsafe, commit_nonrecursive):
> Use --depth=empty instead of -N, for adds and imports.
>

> Modified: trunk/subversion/libsvn_client/add.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/add.c?pathrev=26607&r1=26606&r2=26607
> ==============================================================================
> --- trunk/subversion/libsvn_client/add.c (original)
> +++ trunk/subversion/libsvn_client/add.c Sat Sep 15 00:54:39 2007

> @@ -549,7 +555,8 @@
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> {
> - return svn_client_add4(path, recursive, force, no_ignore, FALSE, ctx,
> + return svn_client_add4(path, SVN_DEPTH_FROM_RECURSE(recursive),
> + force, no_ignore, FALSE, ctx,
> pool);
> }
>

I've been trying to catch the Ruby bindings up with HEAD today, but when I
apply r26607 I get two test failures that I can't explain. I think if you can
help me understand this one, the other will fall into place. Or perhaps the
quoted bit above is causing the regression? The Ruby bindings are currently
wrapping svn_client_add3.

  def test_add_not_recurse
    log = "sample log"
    file = "hello.txt"
    src = "Hello"
    dir = "dir"
    dir_path = File.join(@wc_path, dir)
    path = File.join(dir_path, file)
    uri = "#{@repos_uri}/#{dir}/#{file}"

    ctx = make_context(log)
    FileUtils.mkdir(dir_path)
    File.open(path, "w") {|f| f.print(src)}

# Boilerplate up to here. Now add the directory containing a file created
# above, without recursing.

    ctx.add(dir_path, false)
    ctx.commit(@wc_path)

# This assertion fails. We are now finding the path in the repo where we
# before we didn't.

    assert_raise(Svn::Error::FS_NOT_FOUND) do
      ctx.cat(uri)
    end
  end

I checked the definition of SVN_DEPTH_FROM_RECURSE, and since it returns
svn_depth_files, I'm wondering if that is the correct behavior for add?

I hope I'm at least half coherent.

--
Joe
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Sep 16 01:37:14 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.