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

Fix for issue 3609 - ls command

From: Noorul Islam K M <noorul_at_collab.net>
Date: Mon, 08 Nov 2010 11:59:11 +0530

Followup to r1030010

Log

[[[

Canonicalize paths before passing them to svn_client_list2.

* subversion/svn/list-cmd.c
  (svn_cl__list): Canonicalize url or dirent before passing over to API.

* subversion/tests/cmdline/basic_tests.py
  (ls_url_special_characters, test_list): New test

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

]]]

Index: subversion/svn/list-cmd.c
===================================================================
--- subversion/svn/list-cmd.c (revision 1032461)
+++ subversion/svn/list-cmd.c (working copy)
@@ -271,6 +271,11 @@
       SVN_ERR(svn_opt_parse_path(&peg_revision, &truepath, target,
                                  subpool));
 
+ if (svn_path_is_url(truepath))
+ truepath = svn_uri_canonicalize(truepath, subpool);
+ else
+ truepath = svn_dirent_canonicalize(truepath, subpool);
+
       if (opt_state->xml)
         {
           svn_stringbuf_t *sb = svn_stringbuf_create("", pool);
Index: subversion/tests/cmdline/basic_tests.py
===================================================================
--- subversion/tests/cmdline/basic_tests.py (revision 1032461)
+++ subversion/tests/cmdline/basic_tests.py (working copy)
@@ -2671,6 +2671,19 @@
                                      sbox.repo_url + '/C spaced',
                                      '-m', 'Deleted B and C')
 
+def ls_url_special_characters(sbox):
+ """special characters in svn ls URL"""
+ sbox.build(create_wc = False)
+
+ special_urls = [sbox.repo_url + '/A' + '/%2E',
+ sbox.repo_url + '%2F' + 'A']
+
+ for url in special_urls:
+ svntest.actions.run_and_verify_svn('ls URL with special characters',
+ ['B/\n', 'C/\n', 'D/\n', 'mu\n'],
+ [], 'ls',
+ url)
+
 ########################################################################
 # Run the tests
 
@@ -2732,6 +2745,7 @@
               delete_child_parent_update,
               basic_relocate,
               delete_urls_with_spaces,
+ ls_url_special_characters,
              ]
 
 if __name__ == '__main__':
Received on 2010-11-08 07:30:14 CET

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