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

[PATCH]Issue #1776 (v2) - Create parent directories with 'svn mkdir'

From: S.Ramaswamy <ramaswamy_at_collab.net>
Date: 2005-03-13 18:58:46 CET

Partial patch for Issue #1776 to make parent directories. The code changes
to introduce a new cmd line option - '-p|--parents', to make parent
directories in the working copy, and the related tests in the test suite
are from Stephen Oberholtzer. I am including it here to make it easier to
review the patch. My changes and test are for directly creating parent
directories in the repository.

Log :

* subversion/libsvn_client/add.c
    (svn_client_mkdir):
      Changed to defer to svn_client_mkdir2.

    (svn_client__mksubdir): New.
      Used by svn_client_mkdir2 to create and add directories.

    (svn_client_mkdir2): New, from svn_client_mkdir.

* subversion/clients/cmdline/mkdir-cmd.c
    (svn_cl__mkdir):
      Changed to call svn_client_mkdir2, passing in
      opt_state->parents.

* subversion/clients/cmdline/cl.h

    (svn_cl__opt_state_t):
      Added 'parents' member.

* subversion/clients/cmdline/main.c
    (svn_cl__options):
      Added 'parents' ('p') option.

    (svn_cl__cmd_table):
      Added 'p' option to "mkdir" command.

    (main):
      Added case for 'p'.

* subversion/tests/clients/cmdline/basic_tests.py
    (basic_mkdir_missing_parent): New.
      Tests 'svn mkdir foo/bar' with no foo,
      expects failure.

    (basic_mkdir_missing_parent_p): New.
      Tests 'svn mkdir -p foo/bar' with no foo,
      expects 'foo' and 'bar' to both be added.

    (basic_mkdir_wcpath): New.
      Tests 'svn mkdir foo foo/bar', like
      basic_mkdir_url but for the WC.

    (test_list): Inserted the three previously
      mention tests after the basic_mkdir_urls
      test.

* subversion/libsvn_client/add.c
  (mkdir_urls): Added boolean parameter - 'make_parents'to determine if
  parent directories should be created directly in the repository.
  'mkdir_urls' calls svn_client__url_paths to find the section of the
  url that exists and and the new path to be created. A common url and
  a list of targets are also determined to drive the delta path driver.

  (svn_client_mkdir2): Call mkdir_urls with new make_parents parameter.

  (svn_client__url_paths): New function to find section of url that exists
  and the path to be created; called by mkdir_urls. Opens ra session to user
  specified url, and finds the existing section of the url and the path to
  be created.

* subversion/tests/clients/cmdline/basic_tests.py
  (basic_mkdir_url_p): New test to check making a parent directory
  directly in the repository.

  (test_list): Added 'basic_mkdir_url_p' to the list of tests.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sun Mar 13 19:00:10 2005

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.