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 2010/11/09 18:00:38 UTC
svn commit: r1033099 [1/2] - in /subversion/branches/issue-3668-3669: ./
build/ subversion/include/ subversion/libsvn_client/
subversion/libsvn_repos/ subversion/libsvn_wc/ subversion/svn/
subversion/tests/cmdline/ subversion/tests/cmdline/svntest/ sub...
Author: pburba
Date: Tue Nov 9 17:00:37 2010
New Revision: 1033099
URL: http://svn.apache.org/viewvc?rev=1033099&view=rev
Log:
On the issue-3668-3669 branch: Sync with subversion/trunk.
Modified:
subversion/branches/issue-3668-3669/ (props changed)
subversion/branches/issue-3668-3669/COMMITTERS
subversion/branches/issue-3668-3669/build/run_tests.py
subversion/branches/issue-3668-3669/subversion/include/svn_path.h
subversion/branches/issue-3668-3669/subversion/include/svn_types.h
subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c
subversion/branches/issue-3668-3669/subversion/libsvn_repos/rev_hunt.c
subversion/branches/issue-3668-3669/subversion/libsvn_wc/copy.c
subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.c
subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.h
subversion/branches/issue-3668-3669/subversion/svn/cat-cmd.c
subversion/branches/issue-3668-3669/subversion/svn/list-cmd.c
subversion/branches/issue-3668-3669/subversion/tests/cmdline/basic_tests.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/cat_tests.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/copy_tests.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/diff_tests.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/info_tests.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/lock_tests.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/merge_tests.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/prop_tests.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/schedule_tests.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/svntest/main.py
subversion/branches/issue-3668-3669/subversion/tests/cmdline/svntest/sandbox.py
subversion/branches/issue-3668-3669/subversion/tests/libsvn_wc/op-depth-test.c
subversion/branches/issue-3668-3669/tools/hook-scripts/mailer/mailer.py
Propchange: subversion/branches/issue-3668-3669/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 9 17:00:37 2010
@@ -24,6 +24,7 @@
/subversion/branches/merge-skips-obstructions:874525-874615
/subversion/branches/nfc-nfd-aware-client:870276,870376
/subversion/branches/performance:982355,983764,983766,984927,984984,985014,985037,985046,985472,985477,985482,985500,985606,985669,986453,987888,987893,995507,995603,1001413,1025660,1028092,1028094,1028104,1029038,1029042,1029090,1029092,1029335,1030763
+/subversion/branches/py-tests-as-modules:956579-1033052
/subversion/branches/ra_serf-digest-authn:875693-876404
/subversion/branches/reintegrate-improvements:873853-874164
/subversion/branches/subtree-mergeinfo:876734-878766
@@ -38,4 +39,4 @@
/subversion/branches/tc_url_rev:874351-874483
/subversion/branches/tree-conflicts:868291-873154
/subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:1031000-1031553
+/subversion/trunk:1031000-1033087
Modified: subversion/branches/issue-3668-3669/COMMITTERS
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/COMMITTERS?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/COMMITTERS [UTF-8] (original)
+++ subversion/branches/issue-3668-3669/COMMITTERS [UTF-8] Tue Nov 9 17:00:37 2010
@@ -14,7 +14,7 @@ Blanket commit access:
kfogel Karl Fogel <kf...@red-bean.com>
gstein Greg Stein <gs...@gmail.com>
brane Branko Čibej <br...@xbc.nu>
- joe Joe Orton <jo...@manyfish.co.uk>
+ jorton Joe Orton <jo...@manyfish.co.uk>
ghudson Greg Hudson <gh...@mit.edu>
fitz Brian W. Fitzpatrick <fi...@red-bean.com>
daniel Daniel Stenberg <da...@haxx.se>
@@ -55,6 +55,7 @@ Blanket commit access:
jwhitlock Jeremy Whitlock <jc...@gmail.com>
sbutler Stephen Butler <sb...@elego.de>
dannas Daniel Näslund <da...@elego.de>
+ stefan2 Stefan Fuhrmann <st...@alice-dsl.de>
[[END ACTIVE FULL COMMITTERS. LEAVE THIS LINE HERE; SCRIPTS LOOK FOR IT.]]
@@ -179,7 +180,6 @@ giorgio_valoti Giorgio Valoti <giorgio
cacknin Charles Acknin <ch...@gmail.com> (svnpatch-diff
br.)
holden Holden Karau <ho...@pigscanfly.ca> (scheme-bindings br.)
- stefan2 Stefan Fuhrmann <st...@alice-dsl.de> (performance br.)
jcorvel Johan Corveleyn <jc...@gmail.com> (diff-
optimizations br.)
Modified: subversion/branches/issue-3668-3669/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/build/run_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/build/run_tests.py (original)
+++ subversion/branches/issue-3668-3669/build/run_tests.py Tue Nov 9 17:00:37 2010
@@ -42,9 +42,9 @@ separated list of test numbers; the defa
'''
# A few useful constants
-LINE_LENGTH = 40
+LINE_LENGTH = 45
-import os, re, subprocess, sys
+import os, re, subprocess, sys, imp
from datetime import datetime
import getopt
@@ -237,43 +237,14 @@ class TestHarness:
self.log.close()
self.log = None
- def _run_test(self, prog, test_nr, total_tests):
- "Run a single test. Return the test's exit code."
-
- if self.log:
- log = self.log
- else:
- log = sys.stdout
-
- test_nums = None
- if '#' in prog:
- prog, test_nums = prog.split('#')
-
+ def _run_c_test(self, prog, test_nums, dot_count):
+ 'Run a c test, escaping parameters as required.'
progdir, progbase = os.path.split(prog)
- if self.log:
- # Using write here because we don't want even a trailing space
- test_info = '%s [%d/%d]' % (progbase, test_nr + 1, total_tests)
- sys.stdout.write('Running tests in %s' % (test_info, ))
- sys.stdout.write('.'*(LINE_LENGTH - len(test_info)))
- sys.stdout.flush()
- log.write('START: %s\n' % progbase)
- log.flush()
+ sys.stdout.write('.' * dot_count)
+ sys.stdout.flush()
- start_time = datetime.now()
- if progbase[-3:] == '.py':
- progname = sys.executable
- cmdline = [progname,
- os.path.join(self.srcdir, prog)]
- if self.base_url is not None:
- cmdline.append('--url=' + self.base_url)
- if self.enable_sasl is not None:
- cmdline.append('--enable-sasl')
- if self.parallel is not None:
- cmdline.append('--parallel')
- if self.config_file is not None:
- cmdline.append('--config-file=' + self.config_file)
- elif os.access(prog, os.X_OK):
+ if os.access(progbase, os.X_OK):
progname = './' + progbase
cmdline = [progname,
'--srcdir=' + os.path.join(self.srcdir, progdir)]
@@ -307,10 +278,129 @@ class TestHarness:
test_nums = test_nums.split(',')
cmdline.extend(test_nums)
+ return self._run_prog(progname, cmdline)
+
+ def _run_py_test(self, prog, test_nums, dot_count):
+ 'Run a python test, passing parameters as needed.'
+ progdir, progbase = os.path.split(prog)
+
+ old_path = sys.path[:]
+ sys.path = [progdir] + sys.path
+
+ try:
+ prog_mod = imp.load_module(progbase[:-3], open(prog, 'r'), prog,
+ ('.py', 'U', imp.PY_SOURCE))
+ except:
+ print('Don\'t know what to do about ' + progbase)
+ raise
+
+ import svntest.main
+
+ # set up our options
+ svntest.main.create_default_options()
+ if self.base_url is not None:
+ svntest.main.options.test_area_url = self.base_url
+ if self.enable_sasl is not None:
+ svntest.main.options.enable_sasl = True
+ if self.parallel is not None:
+ svntest.main.options.parallel = True
+ if self.config_file is not None:
+ svntest.main.options.config_file = self.config_file
+ if self.verbose is not None:
+ svntest.main.options.verbose = True
+ if self.cleanup is not None:
+ svntest.main.options.cleanup = True
+ if self.fs_type is not None:
+ svntest.main.options.fs_type = self.fs_type
+ if self.http_library is not None:
+ svntest.main.options.http_library = self.http_library
+ if self.server_minor_version is not None:
+ svntest.main.options.server_minor_version = self.server_minor_version
+ if self.list_tests is not None:
+ svntest.main.options.list_tests = True
+ if self.svn_bin is not None:
+ svntest.main.options.svn_bin = self.svn_bin
+ if self.fsfs_sharding is not None:
+ svntest.main.options.fsfs_sharding = self.fsfs_sharding
+ if self.fsfs_packing is not None:
+ svntest.main.options.fsfs_packing = self.fsfs_packing
+
+ svntest.main.options.srcdir = self.srcdir
+
+ # setup the output pipes
+ if self.log:
+ sys.stdout.flush()
+ sys.stderr.flush()
+ self.log.flush()
+ old_stdout = os.dup(1)
+ old_stderr = os.dup(2)
+ os.dup2(self.log.fileno(), 1)
+ os.dup2(self.log.fileno(), 2)
+
+ # This has to be class-scoped for use in the progress_func()
+ self.dots_written = 0
+ def progress_func(completed, total):
+ dots = (completed * dot_count) / total
+
+ dots_to_write = dots - self.dots_written
+ if self.log:
+ os.write(old_stdout, '.' * dots_to_write)
+ else:
+ sys.stdout.write(old_stdout, '.' * dots_to_write)
+ sys.stdout.flush()
+
+ self.dots_written = dots
+
+ # run the tests
+ svntest.testcase.TextColors.disable()
+ failed = svntest.main.execute_tests(prog_mod.test_list,
+ test_name=progbase,
+ progress_func=progress_func)
+
+ # restore some values
+ sys.path = old_path
+ if self.log:
+ os.dup2(old_stdout, 1)
+ os.dup2(old_stderr, 2)
+ os.close(old_stdout)
+ os.close(old_stderr)
+
+ return failed
+
+ def _run_test(self, prog, test_nr, total_tests):
+ "Run a single test. Return the test's exit code."
+
+ if self.log:
+ log = self.log
+ else:
+ log = sys.stdout
+
+ test_nums = None
+ if '#' in prog:
+ prog, test_nums = prog.split('#')
+
+ progdir, progbase = os.path.split(prog)
+ if self.log:
+ # Using write here because we don't want even a trailing space
+ test_info = '%s [%d/%d]' % (progbase, test_nr + 1, total_tests)
+ sys.stdout.write('Running tests in %s' % (test_info, ))
+ sys.stdout.flush()
+
+ log.write('START: %s\n' % progbase)
+ log.flush()
+
+ start_time = datetime.now()
+
+ progabs = os.path.abspath(os.path.join(self.srcdir, prog))
old_cwd = os.getcwd()
try:
os.chdir(progdir)
- failed = self._run_prog(progname, cmdline)
+ if progbase[-3:] == '.py':
+ failed = self._run_py_test(progabs, test_nums,
+ (LINE_LENGTH - len(test_info)))
+ else:
+ failed = self._run_c_test(prog, test_nums,
+ (LINE_LENGTH - len(test_info)))
except:
os.chdir(old_cwd)
raise
Modified: subversion/branches/issue-3668-3669/subversion/include/svn_path.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/include/svn_path.h?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/include/svn_path.h (original)
+++ subversion/branches/issue-3668-3669/subversion/include/svn_path.h Tue Nov 9 17:00:37 2010
@@ -64,6 +64,10 @@ extern "C" {
/** Convert @a path from the local style to the canonical internal style.
+ *
+ * New code should use either svn_dirent_internal_style() (for local paths) or
+ * svn_relpath_internal_style() (for relative paths).
+ *
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -71,6 +75,10 @@ const char *
svn_path_internal_style(const char *path, apr_pool_t *pool);
/** Convert @a path from the canonical internal style to the local style.
+ *
+ * New code should use either svn_dirent_local_style() (for local paths) or
+ * svn_relpath_local_style() (for relative paths).
+ *
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -101,6 +109,9 @@ svn_path_local_style(const char *path, a
* @a component won't be detected. An absolute URI can only be used
* for the base.
*
+ * New code should use either svn_dirent_join() (for local paths) or
+ * svn_uri_join() (for urls) or svn_relpath_join() (for relative paths).
+ *
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -118,7 +129,9 @@ svn_path_join(const char *base, const ch
* This function does not support URLs.
*
* See svn_path_join() for further notes about joining paths.
- *
+ *
+ * New code should use svn_dirent_join_many() instead.
+ *
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -139,7 +152,7 @@ svn_path_join_many(apr_pool_t *pool, con
* @note If an empty string is passed, then an empty string will be returned.
*
* New code should use either svn_dirent_basename() (for local paths) or
- * svn_uri_basename() (for urls and repository paths).
+ * svn_uri_basename() (for urls) or svn_relpath_basename (for relative paths).
*
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
@@ -154,7 +167,7 @@ svn_path_basename(const char *path, apr_
* The returned dirname will be allocated in @a pool.
*
* New code should use either svn_dirent_dirname() (for local paths) or
- * svn_uri_dirname() (for urls and repository paths).
+ * svn_uri_dirname() (for urls) or svn_relpath_dirname() (for relative paths).
*
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
@@ -227,7 +240,7 @@ svn_path_remove_components(svn_stringbuf
* - <pre>"" ==> "" and ""</pre>
*
* New code should use either svn_dirent_split() (for local paths) or
- * svn_uri_split() (for urls and repository paths).
+ * svn_uri_split() (for urls) or svn_relpath_split() (for relative paths).
*
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
@@ -266,6 +279,10 @@ svn_dirent_is_root(const char *dirent, a
* The returned path may be statically allocated, equal to @a path, or
* allocated from @a pool.
*
+ * New code should use either svn_dirent_canonicalize() (for local paths) or
+ * svn_uri_canonicalize() (for urls) or svn_relpath_canonicalize() (for
+ * relative paths).
+ *
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -275,6 +292,10 @@ svn_path_canonicalize(const char *path,
/** Return @c TRUE iff path is canonical. Use @a pool for temporary
* allocations.
*
+ * New code should use either svn_dirent_is_canonical() (for local paths) or
+ * svn_uri_is_canonical() (for urls) or svn_relpath_is_canonical() (for
+ * relative paths).
+ *
* @since New in 1.5.
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
@@ -300,6 +321,10 @@ svn_path_compare_paths(const char *path1
* different resources), and (b) share a common ancestor in their path
* component, i.e. 'protocol://' is not a sufficient ancestor.
*
+ * New code should use either svn_dirent_get_longest_ancestor()
+ * (for local paths) or svn_uri_get_longest_ancestor() (for urls)
+ * or svn_relpath_get_longest_ancestor() (for relative paths).
+ *
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -314,6 +339,8 @@ svn_path_get_longest_ancestor(const char
* @a relative may be a URL, in which case no attempt is made to convert it,
* and a copy of the URL is returned.
*
+ * New code should use svn_dirent_get_absolute() instead.
+ *
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -365,6 +392,9 @@ svn_path_split_if_file(const char *path,
* If there are no items in @a targets, set @a *pcommon and (if
* applicable) @a *pcondensed_targets to @c NULL.
*
+ * New code should use either svn_dirent_condense_targets() (for local paths)
+ * or svn_uri_condense_targets() (for urls).
+ *
* @note There is no guarantee that @a *pcommon is within a working
* copy.
*
@@ -489,6 +519,10 @@ svn_path_is_dotpath_present(const char *
* in which case a pointer into @a path2 will be returned to
* identify the remainder path.
*
+ * New code should use either svn_dirent_is_child() (for local paths) or
+ * svn_uri_is_child() (for urls) or svn_relpath_is_child()
+ * (for relative paths).
+ *
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -499,6 +533,11 @@ svn_path_is_child(const char *path1, con
* and FALSE otherwise.
*
* @since New in 1.3.
+ *
+ * New code should use either svn_dirent_is_ancestor() (for local paths) or
+ * svn_uri_is_ancestor() (for urls) or svn_relpath_is_ancestor() (for relative
+ * paths).
+ *
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -584,7 +623,7 @@ svn_path_url_add_component2(const char *
const char *component,
apr_pool_t *pool);
-/** Like svn_path_url_add_component2, but allows path components that
+/** Like svn_path_url_add_component2(), but allows path components that
* end with a trailing '/'
*
* @deprecated Provided for backward compatibility with the 1.5 API.
Modified: subversion/branches/issue-3668-3669/subversion/include/svn_types.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/include/svn_types.h?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/include/svn_types.h (original)
+++ subversion/branches/issue-3668-3669/subversion/include/svn_types.h Tue Nov 9 17:00:37 2010
@@ -183,13 +183,13 @@ svn_node_kind_from_word(const char *word
/** Generic three-state property to represent an unknown value for values
* that are just like booleans. The values have been set deliberately to
- * make tristates mainly compatible with #svn_boolean_t.
+ * make tristates disjoint from #svn_boolean_t.
*
* @since New in 1.7. */
typedef enum
{
- svn_tristate_false = FALSE,
- svn_tristate_true = TRUE,
+ svn_tristate_false = 2,
+ svn_tristate_true,
svn_tristate_unknown
} svn_tristate_t;
Modified: subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c Tue Nov 9 17:00:37 2010
@@ -1795,11 +1795,8 @@ repos_to_wc_copy(const apr_array_header_
lock_abspath = top_dst_path;
if (copy_pairs->nelts == 1)
{
- svn_node_kind_t kind;
top_src_url = svn_uri_dirname(top_src_url, pool);
- SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, top_dst_path, FALSE, pool));
- if (kind != svn_node_dir)
- lock_abspath = svn_dirent_dirname(top_dst_path, pool);
+ lock_abspath = svn_dirent_dirname(top_dst_path, pool);
}
/* Open a repository session to the longest common src ancestor. We do not
Modified: subversion/branches/issue-3668-3669/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_repos/rev_hunt.c?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_repos/rev_hunt.c Tue Nov 9 17:00:37 2010
@@ -1085,47 +1085,49 @@ find_interesting_revisions(apr_array_hea
apr_hash_t *duplicate_path_revs,
svn_repos_authz_func_t authz_read_func,
void *authz_read_baton,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- apr_pool_t *iter_pool, *last_pool;
+ apr_pool_t *iterpool, *last_pool;
svn_fs_history_t *history;
svn_fs_root_t *root;
svn_node_kind_t kind;
/* We switch between two pools while looping, since we need information from
the last iteration to be available. */
- iter_pool = svn_pool_create(pool);
- last_pool = svn_pool_create(pool);
+ iterpool = svn_pool_create(result_pool);
+ last_pool = svn_pool_create(result_pool);
/* The path had better be a file in this revision. */
- SVN_ERR(svn_fs_revision_root(&root, repos->fs, end, last_pool));
- SVN_ERR(svn_fs_check_path(&kind, root, path, pool));
+ SVN_ERR(svn_fs_revision_root(&root, repos->fs, end, scratch_pool));
+ SVN_ERR(svn_fs_check_path(&kind, root, path, scratch_pool));
if (kind != svn_node_file)
return svn_error_createf
(SVN_ERR_FS_NOT_FILE, NULL, _("'%s' is not a file in revision %ld"),
path, end);
/* Open a history object. */
- SVN_ERR(svn_fs_node_history(&history, root, path, last_pool));
-
+ SVN_ERR(svn_fs_node_history(&history, root, path, scratch_pool));
while (1)
{
- struct path_revision *path_rev = apr_palloc(pool, sizeof(*path_rev));
+ struct path_revision *path_rev;
+ svn_revnum_t tmp_revnum;
+ const char *tmp_path;
apr_pool_t *tmp_pool;
- svn_pool_clear(iter_pool);
+ svn_pool_clear(iterpool);
/* Fetch the history object to walk through. */
- SVN_ERR(svn_fs_history_prev(&history, history, TRUE, iter_pool));
+ SVN_ERR(svn_fs_history_prev(&history, history, TRUE, iterpool));
if (!history)
break;
- SVN_ERR(svn_fs_history_location(&path_rev->path, &path_rev->revnum,
- history, iter_pool));
+ SVN_ERR(svn_fs_history_location(&tmp_path, &tmp_revnum,
+ history, iterpool));
/* Check to see if we already saw this path (and it's ancestors) */
if (include_merged_revisions
- && is_path_in_hash(duplicate_path_revs, path_rev->path,
- path_rev->revnum, iter_pool))
+ && is_path_in_hash(duplicate_path_revs, tmp_path,
+ tmp_revnum, iterpool))
break;
/* Check authorization. */
@@ -1134,21 +1136,24 @@ find_interesting_revisions(apr_array_hea
svn_boolean_t readable;
svn_fs_root_t *tmp_root;
- SVN_ERR(svn_fs_revision_root(&tmp_root, repos->fs, path_rev->revnum,
- iter_pool));
- SVN_ERR(authz_read_func(&readable, tmp_root, path_rev->path,
- authz_read_baton, iter_pool));
+ SVN_ERR(svn_fs_revision_root(&tmp_root, repos->fs, tmp_revnum,
+ iterpool));
+ SVN_ERR(authz_read_func(&readable, tmp_root, tmp_path,
+ authz_read_baton, iterpool));
if (! readable)
break;
}
- path_rev->path = apr_pstrdup(pool, path_rev->path);
+ /* We didn't break, so we must really want this path-rev. */
+ path_rev = apr_palloc(result_pool, sizeof(*path_rev));
+ path_rev->path = apr_pstrdup(result_pool, tmp_path);
+ path_rev->revnum = tmp_revnum;
path_rev->merged = mark_as_merged;
APR_ARRAY_PUSH(path_revisions, struct path_revision *) = path_rev;
if (include_merged_revisions)
SVN_ERR(get_merged_mergeinfo(&path_rev->merged_mergeinfo, repos,
- path_rev, pool));
+ path_rev, result_pool));
else
path_rev->merged_mergeinfo = NULL;
@@ -1156,7 +1161,7 @@ find_interesting_revisions(apr_array_hea
occurrences of it. We only care about this if including merged
revisions, 'cause that's the only time we can have duplicates. */
apr_hash_set(duplicate_path_revs,
- apr_psprintf(pool, "%s:%ld", path_rev->path,
+ apr_psprintf(result_pool, "%s:%ld", path_rev->path,
path_rev->revnum),
APR_HASH_KEY_STRING, (void *)0xdeadbeef);
@@ -1164,12 +1169,12 @@ find_interesting_revisions(apr_array_hea
break;
/* Swap pools. */
- tmp_pool = iter_pool;
- iter_pool = last_pool;
+ tmp_pool = iterpool;
+ iterpool = last_pool;
last_pool = tmp_pool;
}
- svn_pool_destroy(iter_pool);
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -1198,12 +1203,12 @@ find_merged_revisions(apr_array_header_t
{
const apr_array_header_t *old;
apr_array_header_t *new;
- apr_pool_t *iter_pool, *last_pool;
+ apr_pool_t *iterpool, *last_pool;
apr_array_header_t *merged_path_revisions = apr_array_make(pool, 0,
sizeof(struct path_revision *));
old = mainline_path_revisions;
- iter_pool = svn_pool_create(pool);
+ iterpool = svn_pool_create(pool);
last_pool = svn_pool_create(pool);
do
@@ -1211,27 +1216,34 @@ find_merged_revisions(apr_array_header_t
int i;
apr_pool_t *temp_pool;
- svn_pool_clear(iter_pool);
- new = apr_array_make(iter_pool, 0, sizeof(struct path_revision *));
+ svn_pool_clear(iterpool);
+ new = apr_array_make(iterpool, 0, sizeof(struct path_revision *));
/* Iterate over OLD, checking for non-empty mergeinfo. If found, gather
path_revisions for any merged revisions, and store those in NEW. */
for (i = 0; i < old->nelts; i++)
{
+ apr_pool_t *iterpool2;
apr_hash_index_t *hi;
struct path_revision *old_pr = APR_ARRAY_IDX(old, i,
struct path_revision *);
if (!old_pr->merged_mergeinfo)
continue;
+ iterpool2 = svn_pool_create(iterpool);
+
/* Determine and trace the merge sources. */
- for (hi = apr_hash_first(iter_pool, old_pr->merged_mergeinfo); hi;
+ for (hi = apr_hash_first(iterpool, old_pr->merged_mergeinfo); hi;
hi = apr_hash_next(hi))
{
+ apr_pool_t *iterpool3;
apr_array_header_t *rangelist;
const char *path;
int j;
+ svn_pool_clear(iterpool2);
+ iterpool3 = svn_pool_create(iterpool2);
+
apr_hash_this(hi, (void *) &path, NULL, (void *) &rangelist);
for (j = 0; j < rangelist->nelts; j++)
@@ -1241,9 +1253,10 @@ find_merged_revisions(apr_array_header_t
svn_node_kind_t kind;
svn_fs_root_t *root;
+ svn_pool_clear(iterpool3);
SVN_ERR(svn_fs_revision_root(&root, repos->fs, range->end,
- iter_pool));
- SVN_ERR(svn_fs_check_path(&kind, root, path, iter_pool));
+ iterpool3));
+ SVN_ERR(svn_fs_check_path(&kind, root, path, iterpool3));
if (kind != svn_node_file)
continue;
@@ -1253,20 +1266,23 @@ find_merged_revisions(apr_array_header_t
TRUE, TRUE,
duplicate_path_revs,
authz_read_func,
- authz_read_baton, pool));
+ authz_read_baton, pool,
+ iterpool3));
}
+ svn_pool_destroy(iterpool3);
}
+ svn_pool_destroy(iterpool2);
}
/* Append the newly found path revisions with the old ones. */
- merged_path_revisions = apr_array_append(iter_pool, merged_path_revisions,
+ merged_path_revisions = apr_array_append(iterpool, merged_path_revisions,
new);
/* Swap data structures */
old = new;
temp_pool = last_pool;
- last_pool = iter_pool;
- iter_pool = temp_pool;
+ last_pool = iterpool;
+ iterpool = temp_pool;
}
while (new->nelts > 0);
@@ -1277,7 +1293,7 @@ find_merged_revisions(apr_array_header_t
/* Copy to the output array. */
*merged_path_revisions_out = apr_array_copy(pool, merged_path_revisions);
- svn_pool_destroy(iter_pool);
+ svn_pool_destroy(iterpool);
svn_pool_destroy(last_pool);
return SVN_NO_ERROR;
@@ -1413,7 +1429,8 @@ svn_repos_get_file_revs2(svn_repos_t *re
SVN_ERR(find_interesting_revisions(mainline_path_revisions, repos, path,
start, end, include_merged_revisions,
FALSE, duplicate_path_revs,
- authz_read_func, authz_read_baton, pool));
+ authz_read_func, authz_read_baton, pool,
+ pool));
/* If we are including merged revisions, go get those, too. */
if (include_merged_revisions)
Modified: subversion/branches/issue-3668-3669/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_wc/copy.c?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_wc/copy.c Tue Nov 9 17:00:37 2010
@@ -203,6 +203,7 @@ static svn_error_t *
copy_versioned_file(svn_wc__db_t *db,
const char *src_abspath,
const char *dst_abspath,
+ const char *dst_op_root_abspath,
svn_boolean_t metadata_only,
svn_cancel_func_t cancel_func,
void *cancel_baton,
@@ -258,7 +259,7 @@ copy_versioned_file(svn_wc__db_t *db,
/* Copy the (single) node's metadata, and move the new filesystem node
into place. */
- SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
+ SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath, dst_op_root_abspath,
work_items, scratch_pool));
SVN_ERR(svn_wc__wq_run(db, dir_abspath,
cancel_func, cancel_baton, scratch_pool));
@@ -282,6 +283,7 @@ static svn_error_t *
copy_versioned_dir(svn_wc__db_t *db,
const char *src_abspath,
const char *dst_abspath,
+ const char *dst_op_root_abspath,
svn_boolean_t metadata_only,
svn_cancel_func_t cancel_func,
void *cancel_baton,
@@ -322,7 +324,7 @@ copy_versioned_dir(svn_wc__db_t *db,
/* Copy the (single) node's metadata, and move the new filesystem node
into place. */
- SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
+ SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath, dst_op_root_abspath,
work_items, scratch_pool));
SVN_ERR(svn_wc__wq_run(db, dir_abspath,
cancel_func, cancel_baton, scratch_pool));
@@ -366,12 +368,14 @@ copy_versioned_dir(svn_wc__db_t *db,
if (child_kind == svn_wc__db_kind_file)
SVN_ERR(copy_versioned_file(db,
child_src_abspath, child_dst_abspath,
+ dst_op_root_abspath,
metadata_only,
cancel_func, cancel_baton, NULL, NULL,
iterpool));
else if (child_kind == svn_wc__db_kind_dir)
SVN_ERR(copy_versioned_dir(db,
child_src_abspath, child_dst_abspath,
+ dst_op_root_abspath,
metadata_only,
cancel_func, cancel_baton, NULL, NULL,
iterpool));
@@ -728,14 +732,16 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
if (src_db_kind == svn_wc__db_kind_file
|| src_db_kind == svn_wc__db_kind_symlink)
{
- SVN_ERR(copy_versioned_file(db, src_abspath, dst_abspath, metadata_only,
+ SVN_ERR(copy_versioned_file(db, src_abspath, dst_abspath, dst_abspath,
+ metadata_only,
cancel_func, cancel_baton,
notify_func, notify_baton,
scratch_pool));
}
else
{
- SVN_ERR(copy_versioned_dir(db, src_abspath, dst_abspath, metadata_only,
+ SVN_ERR(copy_versioned_dir(db, src_abspath, dst_abspath, dst_abspath,
+ metadata_only,
cancel_func, cancel_baton,
notify_func, notify_baton,
scratch_pool));
Modified: subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.c?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.c Tue Nov 9 17:00:37 2010
@@ -2671,6 +2671,7 @@ cross_db_copy(svn_wc__db_pdh_t *src_pdh,
svn_wc__db_pdh_t *dst_pdh,
const char *dst_relpath,
svn_wc__db_status_t dst_status,
+ apr_int64_t dst_op_depth,
svn_wc__db_kind_t kind,
const apr_array_header_t *children,
apr_int64_t copyfrom_id,
@@ -2734,7 +2735,7 @@ cross_db_copy(svn_wc__db_pdh_t *src_pdh,
iwb.original_revnum = copyfrom_rev;
iwb.moved_here = FALSE;
- iwb.op_depth = 2; /* ### temporary op_depth */
+ iwb.op_depth = dst_op_depth;
iwb.checksum = checksum;
iwb.children = children;
@@ -2933,6 +2934,7 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
const char *src_relpath,
svn_wc__db_pdh_t *dst_pdh,
const char *dst_relpath,
+ apr_int64_t dst_op_depth,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool)
{
@@ -2943,7 +2945,6 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
apr_int64_t copyfrom_id;
svn_wc__db_kind_t kind;
const apr_array_header_t *children;
- apr_int64_t op_depth;
SVN_ERR(get_info_for_copy(©from_id, ©from_relpath, ©from_rev,
&status, &kind, &have_work,
@@ -2987,8 +2988,6 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
else
children = NULL;
- op_depth = 2; /* ### temporary op_depth */
-
if (src_pdh->wcroot == dst_pdh->wcroot)
{
svn_sqlite__stmt_t *stmt;
@@ -3005,7 +3004,7 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
SVN_ERR(svn_sqlite__bindf(stmt, "issisnnnt",
src_pdh->wcroot->wc_id, src_relpath,
dst_relpath,
- op_depth,
+ dst_op_depth,
dst_parent_relpath,
presence_map, dst_status));
@@ -3033,13 +3032,13 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
NULL /* inherit repos_path */,
copyfrom_rev,
children,
- op_depth,
+ dst_op_depth,
scratch_pool));
}
else
{
SVN_ERR(cross_db_copy(src_pdh, src_relpath,
- dst_pdh, dst_relpath, dst_status,
+ dst_pdh, dst_relpath, dst_status, dst_op_depth,
kind, children,
copyfrom_id, copyfrom_relpath, copyfrom_rev,
scratch_pool));
@@ -3057,11 +3056,13 @@ svn_error_t *
svn_wc__db_op_copy(svn_wc__db_t *db,
const char *src_abspath,
const char *dst_abspath,
+ const char *dst_op_root_abspath,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool)
{
svn_wc__db_pdh_t *src_pdh, *dst_pdh;
- const char *src_relpath, *dst_relpath;
+ const char *src_relpath, *dst_relpath, *dst_op_root_relpath;
+ apr_int64_t dst_op_depth;
SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
@@ -3078,9 +3079,19 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(dst_pdh);
+#ifdef SVN_WC__OP_DEPTH
+ SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&dst_pdh, &dst_op_root_relpath,
+ db, dst_op_root_abspath,
+ svn_sqlite__mode_readwrite,
+ scratch_pool, scratch_pool));
+ dst_op_depth = relpath_depth(dst_op_root_relpath);
+#else
+ dst_op_depth = 2; /* ### temporary op_depth */
+#endif
+
/* ### This should all happen in one transaction. */
SVN_ERR(db_op_copy(src_pdh, src_relpath, dst_pdh, dst_relpath,
- work_items, scratch_pool));
+ dst_op_depth, work_items, scratch_pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.h?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_wc/wc_db.h Tue Nov 9 17:00:37 2010
@@ -1051,6 +1051,7 @@ svn_error_t *
svn_wc__db_op_copy(svn_wc__db_t *db,
const char *src_abspath,
const char *dst_abspath,
+ const char *dst_op_root_abspath,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
Modified: subversion/branches/issue-3668-3669/subversion/svn/cat-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/svn/cat-cmd.c?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/svn/cat-cmd.c (original)
+++ subversion/branches/issue-3668-3669/subversion/svn/cat-cmd.c Tue Nov 9 17:00:37 2010
@@ -27,6 +27,7 @@
/*** Includes. ***/
+#include "svn_path.h"
#include "svn_pools.h"
#include "svn_client.h"
#include "svn_error.h"
@@ -71,6 +72,11 @@ svn_cl__cat(apr_getopt_t *os,
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);
+
SVN_ERR(svn_cl__try(svn_client_cat2(out, truepath, &peg_revision,
&(opt_state->start_revision),
ctx, subpool),
Modified: subversion/branches/issue-3668-3669/subversion/svn/list-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/svn/list-cmd.c?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/svn/list-cmd.c (original)
+++ subversion/branches/issue-3668-3669/subversion/svn/list-cmd.c Tue Nov 9 17:00:37 2010
@@ -271,6 +271,11 @@ svn_cl__list(apr_getopt_t *os,
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);
Modified: subversion/branches/issue-3668-3669/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/tests/cmdline/basic_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/issue-3668-3669/subversion/tests/cmdline/basic_tests.py Tue Nov 9 17:00:37 2010
@@ -2500,9 +2500,9 @@ def delete_from_url_with_spaces(sbox):
"delete a directory with ' ' using its url"
sbox.build()
- sbox.simple_mkdir(os.path.join(sbox.wc_dir, 'Dir With Spaces'))
- sbox.simple_mkdir(os.path.join(sbox.wc_dir, 'Dir With'))
- sbox.simple_mkdir(os.path.join(sbox.wc_dir, 'Dir With/Spaces'))
+ sbox.simple_mkdir('Dir With Spaces')
+ sbox.simple_mkdir('Dir With')
+ sbox.simple_mkdir('Dir With/Spaces')
svntest.actions.run_and_verify_svn(None, None, [],
'ci', sbox.wc_dir, '-m', 'Added dir')
@@ -2671,6 +2671,19 @@ def delete_urls_with_spaces(sbox):
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 @@ test_list = [ None,
delete_child_parent_update,
basic_relocate,
delete_urls_with_spaces,
+ ls_url_special_characters,
]
if __name__ == '__main__':
Modified: subversion/branches/issue-3668-3669/subversion/tests/cmdline/cat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/tests/cmdline/cat_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/tests/cmdline/cat_tests.py (original)
+++ subversion/branches/issue-3668-3669/subversion/tests/cmdline/cat_tests.py Tue Nov 9 17:00:37 2010
@@ -196,6 +196,20 @@ def cat_keywords(sbox):
["This is the file 'iota'.\n", "$Revision: 2 $\n"],
[], 'cat', iota_path)
+def cat_url_special_characters(sbox):
+ """special characters in svn cat URL"""
+ sbox.build(create_wc = False)
+ wc_dir = sbox.wc_dir
+
+ special_urls = [sbox.repo_url + '/A' + '/%2E',
+ sbox.repo_url + '%2F' + 'A']
+
+ expected_err = ["svn: warning: URL '" + sbox.repo_url + '/A' + "'"
+ + " refers to a directory\n"]
+
+ for url in special_urls:
+ svntest.actions.run_and_verify_svn2(None, None, expected_err, 0,
+ 'cat', url)
########################################################################
# Run the tests
@@ -210,6 +224,7 @@ test_list = [ None,
cat_skip_uncattable,
cat_unversioned_file,
cat_keywords,
+ cat_url_special_characters,
]
if __name__ == '__main__':
Modified: subversion/branches/issue-3668-3669/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/tests/cmdline/copy_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/issue-3668-3669/subversion/tests/cmdline/copy_tests.py Tue Nov 9 17:00:37 2010
@@ -4588,7 +4588,7 @@ def changed_data_should_match_checkout(s
svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B_E, E_new)
- sbox.simple_commit(wc_dir)
+ sbox.simple_commit()
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
@@ -4618,7 +4618,7 @@ def changed_dir_data_should_match_checko
svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B, B_new)
- sbox.simple_commit(wc_dir)
+ sbox.simple_commit()
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
@@ -4842,17 +4842,17 @@ A_D_children = ['A/D/gamma', 'A/D/G', 'A
def copy_repos_over_deleted_same_kind(sbox):
"copy repos node over deleted node, same kind"
sbox.build(read_only = True)
-
expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
- main.run_svn(None, 'rm', os.path.join(sbox.wc_dir, 'iota'),
- os.path.join(sbox.wc_dir, 'A/B'))
+
+ # Set up some deleted paths
+ sbox.simple_rm('iota', 'A/B')
for path in ['iota', 'A/B'] + A_B_children:
expected_status.tweak(path, status='D ')
- main.run_svn(None, 'cp', sbox.repo_url + '/A/mu',
- os.path.join(sbox.wc_dir, 'iota'))
+
+ # Test copying
+ main.run_svn(None, 'cp', sbox.repo_url + '/A/mu', sbox.ospath('iota'))
expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
- main.run_svn(None, 'cp', sbox.repo_url + '/A/D',
- os.path.join(sbox.wc_dir, 'A/B'))
+ main.run_svn(None, 'cp', sbox.repo_url + '/A/D', sbox.ospath('A/B'))
expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
for child in A_D_children:
expected_status.add({ child.replace('A/D', 'A/B'):
@@ -4862,18 +4862,18 @@ def copy_repos_over_deleted_same_kind(sb
def copy_repos_over_deleted_other_kind(sbox):
"copy repos node over deleted node, other kind"
sbox.build(read_only = True)
-
expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
- main.run_svn(None, 'rm', os.path.join(sbox.wc_dir, 'iota'),
- os.path.join(sbox.wc_dir, 'A/B'))
+
+ # Set up some deleted paths
+ sbox.simple_rm('iota', 'A/B')
for path in ['iota', 'A/B'] + A_B_children:
expected_status.tweak(path, status='D ')
- main.run_svn(None, 'cp', sbox.repo_url + '/iota',
- os.path.join(sbox.wc_dir, 'A/B'))
+
+ # Test copying
+ main.run_svn(None, 'cp', sbox.repo_url + '/iota', sbox.ospath('A/B'))
expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
expected_status.remove(*A_B_children)
- main.run_svn(None, 'cp', sbox.repo_url + '/A/B',
- os.path.join(sbox.wc_dir, 'iota'))
+ main.run_svn(None, 'cp', sbox.repo_url + '/A/B', sbox.ospath('iota'))
expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
for child in A_B_children:
expected_status.add({ child.replace('A/B', 'iota'):
@@ -4883,17 +4883,17 @@ def copy_repos_over_deleted_other_kind(s
def copy_wc_over_deleted_same_kind(sbox):
"copy WC node over a deleted node, same kind"
sbox.build(read_only = True)
-
expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
- main.run_svn(None, 'rm', os.path.join(sbox.wc_dir, 'iota'),
- os.path.join(sbox.wc_dir, 'A/B'))
+
+ # Set up some deleted paths
+ sbox.simple_rm('iota', 'A/B')
for path in ['iota', 'A/B'] + A_B_children:
expected_status.tweak(path, status='D ')
- main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/mu'),
- os.path.join(sbox.wc_dir, 'iota'))
+
+ # Test copying
+ main.run_svn(None, 'cp', sbox.ospath('A/mu'), sbox.ospath('iota'))
expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
- main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/D'),
- os.path.join(sbox.wc_dir, 'A/B'))
+ main.run_svn(None, 'cp', sbox.ospath('A/D'), sbox.ospath('A/B'))
expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
for child in A_D_children:
expected_status.add({ child.replace('A/D', 'A/B'):
@@ -4903,18 +4903,18 @@ def copy_wc_over_deleted_same_kind(sbox)
def copy_wc_over_deleted_other_kind(sbox):
"copy WC node over deleted node, other kind"
sbox.build(read_only = True)
-
expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
- main.run_svn(None, 'rm', os.path.join(sbox.wc_dir, 'iota'),
- os.path.join(sbox.wc_dir, 'A/B'))
+
+ # Set up some deleted paths
+ sbox.simple_rm('iota', 'A/B')
for path in ['iota', 'A/B'] + A_B_children:
expected_status.tweak(path, status='D ')
- main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/mu'),
- os.path.join(sbox.wc_dir, 'A/B'))
+
+ # Test copying
+ main.run_svn(None, 'cp', sbox.ospath('A/mu'), sbox.ospath('A/B'))
expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
expected_status.remove(*A_B_children)
- main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/D'),
- os.path.join(sbox.wc_dir, 'iota'))
+ main.run_svn(None, 'cp', sbox.ospath('A/D'), sbox.ospath('iota'))
expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
for child in A_D_children:
expected_status.add({ child.replace('A/D', 'iota'):
@@ -5021,7 +5021,7 @@ test_list = [ None,
XFail(copy_delete_revert),
delete_replace_delete,
copy_repos_over_deleted_same_kind,
- XFail(copy_repos_over_deleted_other_kind),
+ copy_repos_over_deleted_other_kind,
copy_wc_over_deleted_same_kind,
copy_wc_over_deleted_other_kind,
]
Modified: subversion/branches/issue-3668-3669/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/tests/cmdline/diff_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/issue-3668-3669/subversion/tests/cmdline/diff_tests.py Tue Nov 9 17:00:37 2010
@@ -2585,9 +2585,9 @@ def basic_diff_summarize(sbox):
# Add props to some items that will be deleted, and commit.
sbox.simple_propset('prop', 'val',
- p('A/C'),
- p('A/D/gamma'),
- p('A/D/H/chi'))
+ 'A/C',
+ 'A/D/gamma',
+ 'A/D/H/chi')
sbox.simple_commit() # r2
sbox.simple_update()
@@ -2595,37 +2595,37 @@ def basic_diff_summarize(sbox):
svntest.main.file_append(p('A/mu'), 'new text\n')
# Prop modification.
- sbox.simple_propset('prop', 'val', p('iota'))
+ sbox.simple_propset('prop', 'val', 'iota')
# Both content and prop mods.
svntest.main.file_append(p('A/D/G/tau'), 'new text\n')
- sbox.simple_propset('prop', 'val', p('A/D/G/tau'))
+ sbox.simple_propset('prop', 'val', 'A/D/G/tau')
# File addition.
svntest.main.file_append(p('newfile'), 'new text\n')
svntest.main.file_append(p('newfile2'), 'new text\n')
- sbox.simple_add(p('newfile'),
- p('newfile2'))
- sbox.simple_propset('prop', 'val', p('newfile'))
+ sbox.simple_add('newfile',
+ 'newfile2')
+ sbox.simple_propset('prop', 'val', 'newfile')
# File deletion.
- sbox.simple_rm(p('A/B/lambda'),
- p('A/D/gamma'))
-
+ sbox.simple_rm('A/B/lambda',
+ 'A/D/gamma')
+
# Directory addition.
os.makedirs(p('P'))
os.makedirs(p('Q/R'))
svntest.main.file_append(p('Q/newfile'), 'new text\n')
svntest.main.file_append(p('Q/R/newfile'), 'new text\n')
- sbox.simple_add(p('P'),
- p('Q'))
+ sbox.simple_add('P',
+ 'Q')
sbox.simple_propset('prop', 'val',
- p('P'),
- p('Q/newfile'))
+ 'P',
+ 'Q/newfile')
# Directory deletion.
- sbox.simple_rm(p('A/D/H'),
- p('A/C'))
+ sbox.simple_rm('A/D/H',
+ 'A/C')
# Commit, because diff-summarize handles repos-repos only.
#svntest.main.run_svn(False, 'st', wc_dir)
Modified: subversion/branches/issue-3668-3669/subversion/tests/cmdline/info_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/tests/cmdline/info_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/branches/issue-3668-3669/subversion/tests/cmdline/info_tests.py Tue Nov 9 17:00:37 2010
@@ -317,7 +317,23 @@ def info_wcroot_abspaths(sbox):
exit_code, output, errput = svntest.main.run_svn(None, 'info', '-R', sbox.wc_dir)
check_wcroot_paths(output, os.path.abspath(sbox.wc_dir))
-
+def info_url_special_characters(sbox):
+ """special characters in svn info URL"""
+ sbox.build(create_wc = False)
+ wc_dir = sbox.wc_dir
+
+ special_urls = [sbox.repo_url + '/A' + '/%2E',
+ sbox.repo_url + '%2F' + 'A']
+
+ expected = {'Path' : 'A',
+ 'Repository Root' : '.*',
+ 'Revision' : '1',
+ 'Node Kind' : 'dir',
+ }
+
+ for url in special_urls:
+ svntest.actions.run_and_verify_info([expected], url)
+
########################################################################
# Run the tests
@@ -327,6 +343,7 @@ test_list = [ None,
info_on_added_file,
info_on_mkdir,
info_wcroot_abspaths,
+ info_url_special_characters,
]
if __name__ == '__main__':
Modified: subversion/branches/issue-3668-3669/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/tests/cmdline/lock_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/issue-3668-3669/subversion/tests/cmdline/lock_tests.py Tue Nov 9 17:00:37 2010
@@ -1606,16 +1606,16 @@ def cp_isnt_ro(sbox):
open(kappa_path, 'w').write("This is the file 'kappa'.\n")
## added file
- sbox.simple_add(kappa_path)
+ sbox.simple_add('kappa')
svntest.actions.set_prop('svn:needs-lock', 'yes', kappa_path)
is_writable(kappa_path)
- sbox.simple_commit(kappa_path)
+ sbox.simple_commit('kappa')
is_readonly(kappa_path)
## versioned file
svntest.actions.set_prop('svn:needs-lock', 'yes', mu_path)
is_writable(mu_path)
- sbox.simple_commit(mu_path)
+ sbox.simple_commit('A/mu')
is_readonly(mu_path)
# At this point, mu has 'svn:needs-lock' set
@@ -1623,13 +1623,13 @@ def cp_isnt_ro(sbox):
## wc->wc copied file
svntest.main.run_svn(None, 'copy', mu_path, mu2_path)
is_writable(mu2_path)
- sbox.simple_commit(mu2_path)
+ sbox.simple_commit('A/mu2')
is_readonly(mu2_path)
## URL->wc copied file
svntest.main.run_svn(None, 'copy', mu_URL, mu3_path)
is_writable(mu3_path)
- sbox.simple_commit(mu3_path)
+ sbox.simple_commit('A/mu3')
is_readonly(mu3_path)
Modified: subversion/branches/issue-3668-3669/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/tests/cmdline/merge_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/issue-3668-3669/subversion/tests/cmdline/merge_tests.py Tue Nov 9 17:00:37 2010
@@ -15921,7 +15921,7 @@ def merge_into_locally_added_file(sbox):
svntest.main.file_append(pi_path, "foo\n")
sbox.simple_commit(); # r2
- sbox.simple_add(new_path)
+ sbox.simple_add('A/D/G/new')
expected_output = wc.State(wc_dir, {
'A/D/G/new' : Item(status='G '),
@@ -15973,7 +15973,7 @@ def merge_into_locally_added_directory(s
"This is the file 'rho'.\n")
svntest.main.file_append_binary(os.path.join(new_dir_path, 'tau'),
"This is the file 'tau'.\n")
- sbox.simple_add(new_dir_path)
+ sbox.simple_add('A/D/new_dir')
expected_output = wc.State(wc_dir, {
'A/D/new_dir/pi' : Item(status='G '),
Modified: subversion/branches/issue-3668-3669/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/tests/cmdline/prop_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/issue-3668-3669/subversion/tests/cmdline/prop_tests.py Tue Nov 9 17:00:37 2010
@@ -55,11 +55,11 @@ def make_local_props(sbox):
wc_dir = sbox.wc_dir
# Add properties to one file and one directory
- sbox.simple_propset('blue', 'azul', sbox.ospath('A/mu'))
- sbox.simple_propset('green', 'verde', sbox.ospath('A/mu'))
- sbox.simple_propset('editme', 'the foo fighters', sbox.ospath('A/mu'))
- sbox.simple_propset('red', 'rojo', sbox.ospath('A/D/G'))
- sbox.simple_propset('yellow', 'amarillo', sbox.ospath('A/D/G'))
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_propset('green', 'verde', 'A/mu')
+ sbox.simple_propset('editme', 'the foo fighters', 'A/mu')
+ sbox.simple_propset('red', 'rojo', 'A/D/G')
+ sbox.simple_propset('yellow', 'amarillo', 'A/D/G')
# Make sure they show up as local mods in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -69,7 +69,7 @@ def make_local_props(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Remove one property
- sbox.simple_propdel('yellow', sbox.ospath('A/D/G'))
+ sbox.simple_propdel('yellow', 'A/D/G')
svntest.main.use_editor('foo_to_bar')
# Edit one property
@@ -111,10 +111,8 @@ def commit_props(sbox):
wc_dir = sbox.wc_dir
# Add a property to a file and a directory
- mu_path = sbox.ospath('A/mu')
- H_path = sbox.ospath('A/D/H')
- sbox.simple_propset('blue', 'azul', mu_path)
- sbox.simple_propset('red', 'rojo', H_path)
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_propset('red', 'rojo', 'A/D/H')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -149,10 +147,8 @@ def update_props(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Add a property to a file and a directory
- mu_path = sbox.ospath('A/mu')
- H_path = sbox.ospath('A/D/H')
- sbox.simple_propset('blue', 'azul', mu_path)
- sbox.simple_propset('red', 'rojo', H_path)
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_propset('red', 'rojo', 'A/D/H')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -170,18 +166,13 @@ def update_props(sbox):
None, wc_dir)
# Add more properties
- sbox.simple_propset('blue2', 'azul2', mu_path)
- sbox.simple_propset('red2', 'rojo2', H_path)
+ sbox.simple_propset('blue2', 'azul2', 'A/mu')
+ sbox.simple_propset('red2', 'rojo2', 'A/D/H')
expected_status.tweak('A/mu', 'A/D/H', wc_rev=3, status=' ')
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status,
None, wc_dir)
- # Overwrite mu_path and H_path to refer to the backup copies from
- # here on out.
- mu_path = sbox.ospath('A/mu', wc_dir=wc_backup)
- H_path = sbox.ospath('A/D/H', wc_dir=wc_backup)
-
# Create expected output tree for an update of the wc_backup.
expected_output = svntest.wc.State(wc_backup, {
'A/mu' : Item(status=' U'),
@@ -229,11 +220,10 @@ def downdate_props(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = sbox.ospath('iota')
mu_path = sbox.ospath('A/mu')
# Add a property to a file
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -297,14 +287,13 @@ def remove_props(sbox):
wc_dir = sbox.wc_dir
# Add a property to a file
- iota_path = sbox.ospath('iota')
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
# Commit the file
- sbox.simple_commit(iota_path)
+ sbox.simple_commit('iota')
# Now, remove the property
- sbox.simple_propdel('cash-sound', iota_path)
+ sbox.simple_propdel('cash-sound', 'iota')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -331,9 +320,9 @@ def update_conflict_props(sbox):
# Add a property to a file and a directory
mu_path = sbox.ospath('A/mu')
- sbox.simple_propset('cash-sound', 'cha-ching!', mu_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'A/mu')
A_path = sbox.ospath('A')
- sbox.simple_propset('foo', 'bar', A_path)
+ sbox.simple_propset('foo', 'bar', 'A')
# Commit the file and directory
sbox.simple_commit()
@@ -342,8 +331,8 @@ def update_conflict_props(sbox):
svntest.main.run_svn(None, 'up', '-r', '1', wc_dir)
# Add conflicting properties
- sbox.simple_propset('cash-sound', 'beep!', mu_path)
- sbox.simple_propset('foo', 'baz', A_path)
+ sbox.simple_propset('cash-sound', 'beep!', 'A/mu')
+ sbox.simple_propset('foo', 'baz', 'A')
# Create expected output tree for an update of the wc_backup.
expected_output = svntest.wc.State(wc_dir, {
@@ -394,7 +383,7 @@ def commit_conflict_dirprops(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- sbox.simple_propset('foo', 'bar', wc_dir)
+ sbox.simple_propset('foo', 'bar', '')
# Commit the file and directory
sbox.simple_commit()
@@ -404,7 +393,7 @@ def commit_conflict_dirprops(sbox):
'up', '-r', '1', wc_dir)
# Add conflicting properties
- sbox.simple_propset('foo', 'eek', wc_dir)
+ sbox.simple_propset('foo', 'eek', '')
svntest.actions.run_and_verify_commit(wc_dir, None, None,
"[oO]ut[- ]of[- ]date",
@@ -428,20 +417,20 @@ def commit_replacement_props(sbox):
# Add a property to two files
iota_path = sbox.ospath('iota')
lambda_path = sbox.ospath('A/B/lambda')
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
- sbox.simple_propset('boson', 'W', lambda_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
+ sbox.simple_propset('boson', 'W', 'A/B/lambda')
# Commit (### someday use run_and_verify_commit for better coverage)
sbox.simple_commit()
# Schedule both files for deletion
- sbox.simple_rm(iota_path, lambda_path)
+ sbox.simple_rm('iota', 'A/B/lambda')
# Now recreate the files, and schedule them for addition.
# Poof, the 'new' files don't have any properties at birth.
svntest.main.file_append(iota_path, 'iota TNG')
svntest.main.file_append(lambda_path, 'lambda TNG')
- sbox.simple_add(iota_path, lambda_path)
+ sbox.simple_add('iota', 'A/B/lambda')
# Sanity check: the two files should be scheduled for (R)eplacement.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -451,7 +440,7 @@ def commit_replacement_props(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Now add a property to lambda. Iota still doesn't have any.
- sbox.simple_propset('capacitor', 'flux', lambda_path)
+ sbox.simple_propset('capacitor', 'flux', 'A/B/lambda')
# Commit, with careful output checking. We're actually going to
# scan the working copy for props after the commit.
@@ -482,20 +471,20 @@ def revert_replacement_props(sbox):
# Add a property to two files
iota_path = sbox.ospath('iota')
lambda_path = sbox.ospath('A/B/lambda')
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
- sbox.simple_propset('boson', 'W', lambda_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
+ sbox.simple_propset('boson', 'W', 'A/B/lambda')
# Commit rev 2. (### someday use run_and_verify_commit for better coverage)
sbox.simple_commit()
# Schedule both files for deletion
- sbox.simple_rm(iota_path, lambda_path)
+ sbox.simple_rm('iota', 'A/B/lambda')
# Now recreate the files, and schedule them for addition.
# Poof, the 'new' files don't have any properties at birth.
svntest.main.file_append(iota_path, 'iota TNG')
svntest.main.file_append(lambda_path, 'lambda TNG')
- sbox.simple_add(iota_path, lambda_path)
+ sbox.simple_add('iota', 'A/B/lambda')
# Sanity check: the two files should be scheduled for (R)eplacement.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -505,10 +494,10 @@ def revert_replacement_props(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Now add a property to lambda. Iota still doesn't have any.
- sbox.simple_propset('capacitor', 'flux', lambda_path)
+ sbox.simple_propset('capacitor', 'flux', 'A/B/lambda')
# Now revert both files.
- sbox.simple_revert(iota_path, lambda_path)
+ sbox.simple_revert('iota', 'A/B/lambda')
# Do an update; even though the update is really a no-op,
# run_and_verify_update has the nice feature of scanning disk as
@@ -616,9 +605,9 @@ def inappropriate_props(sbox):
path = sbox.ospath('binary')
svntest.main.file_append(path, "binary")
- sbox.simple_add(path)
+ sbox.simple_add('binary')
- sbox.simple_propset('svn:mime-type', 'application/octet-stream', path)
+ sbox.simple_propset('svn:mime-type', 'application/octet-stream', 'binary')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -627,7 +616,7 @@ def inappropriate_props(sbox):
path = sbox.ospath('multi-eol')
svntest.main.file_append(path, "line1\rline2\n")
- sbox.simple_add(path)
+ sbox.simple_add('multi-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -636,7 +625,7 @@ def inappropriate_props(sbox):
path = sbox.ospath('backwards-eol')
svntest.main.file_append(path, "line1\n\r")
- sbox.simple_add(path)
+ sbox.simple_add('backwards-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -645,7 +634,7 @@ def inappropriate_props(sbox):
path = sbox.ospath('incomplete-eol')
svntest.main.file_append(path, "line1\r\n\r")
- sbox.simple_add(path)
+ sbox.simple_add('incomplete-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -756,10 +745,10 @@ def copy_inherits_special_props(sbox):
# Create the first path as a binary file. To have svn treat the
# file as binary, have a 0x00 in the file.
svntest.main.file_append(new_path1, "binary file\000")
- sbox.simple_add(new_path1)
+ sbox.simple_add('new_file1.bin')
# Add initial svn:mime-type to the file
- sbox.simple_propset('svn:mime-type', orig_mime_type, new_path1)
+ sbox.simple_propset('svn:mime-type', orig_mime_type, 'new_file1.bin')
# Set the svn:executable property on the file if this is a system
# that can handle chmod, in which case svn will turn on the
@@ -767,7 +756,7 @@ def copy_inherits_special_props(sbox):
# manually on the file and see the value of svn:executable in the
# copied file.
if os.name == 'posix':
- sbox.simple_propset('svn:executable', 'on', new_path1)
+ sbox.simple_propset('svn:executable', 'on', 'new_file1.bin')
os.chmod(new_path1, 0644)
# Commit the file
@@ -1063,18 +1052,18 @@ def recursive_base_wc_ops(sbox):
# Files with which to test, in alphabetical order
fp_add = sbox.ospath('A/added')
fp_del = sbox.ospath('A/mu')
- fp_keep= sbox.ospath('iota')
+ #fp_keep= sbox.ospath('iota')
# Set up properties
- sbox.simple_propset('p', 'old-del', fp_del)
- sbox.simple_propset('p', 'old-keep', fp_keep)
+ sbox.simple_propset('p', 'old-del', 'A/mu')
+ sbox.simple_propset('p', 'old-keep', 'iota')
sbox.simple_commit()
svntest.main.file_append(fp_add, 'blah')
- sbox.simple_add(fp_add)
- sbox.simple_propset('p', 'new-add', fp_add)
- sbox.simple_propset('p', 'new-del', fp_del)
- sbox.simple_propset('p', 'new-keep', fp_keep)
+ sbox.simple_add('A/added')
+ sbox.simple_propset('p', 'new-add', 'A/added')
+ sbox.simple_propset('p', 'new-del', 'A/mu')
+ sbox.simple_propset('p', 'new-keep', 'iota')
svntest.main.run_svn(None, 'del', '--force', fp_del)
# Test recursive proplist
@@ -1132,21 +1121,19 @@ def url_props_ops(sbox):
prop2 = 'prop2'
propval2 = 'propval2'
- iota_path = sbox.ospath('iota')
iota_url = sbox.repo_url + '/iota'
- A_path = sbox.ospath('A')
A_url = sbox.repo_url + '/A'
# Add a couple of properties
- sbox.simple_propset(prop1, propval1, iota_path)
- sbox.simple_propset(prop1, propval1, A_path)
+ sbox.simple_propset(prop1, propval1, 'iota')
+ sbox.simple_propset(prop1, propval1, 'A')
# Commit
sbox.simple_commit()
# Add a few more properties
- sbox.simple_propset(prop2, propval2, iota_path)
- sbox.simple_propset(prop2, propval2, A_path)
+ sbox.simple_propset(prop2, propval2, 'iota')
+ sbox.simple_propset(prop2, propval2, 'A')
# Commit again
sbox.simple_commit()
@@ -1256,7 +1243,7 @@ def update_props_on_wc_root(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Add a property to the root folder
- sbox.simple_propset('red', 'rojo', wc_dir)
+ sbox.simple_propset('red', 'rojo', '')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -1301,14 +1288,14 @@ def props_on_replaced_file(sbox):
# Add some properties to iota
iota_path = sbox.ospath("iota")
- sbox.simple_propset('red', 'rojo', iota_path)
- sbox.simple_propset('blue', 'lagoon', iota_path)
+ sbox.simple_propset('red', 'rojo', 'iota')
+ sbox.simple_propset('blue', 'lagoon', 'iota')
sbox.simple_commit()
# replace iota_path
- sbox.simple_rm(iota_path)
+ sbox.simple_rm('iota')
svntest.main.file_append(iota_path, "some mod")
- sbox.simple_add(iota_path)
+ sbox.simple_add('iota')
# check that the replaced file has no properties
expected_disk = svntest.main.greek_state.copy()
@@ -1318,8 +1305,8 @@ def props_on_replaced_file(sbox):
expected_disk.old_tree())
# now add a new property to iota
- sbox.simple_propset('red', 'mojo', iota_path)
- sbox.simple_propset('groovy', 'baby', iota_path)
+ sbox.simple_propset('red', 'mojo', 'iota')
+ sbox.simple_propset('groovy', 'baby', 'iota')
# What we expect the disk tree to look like:
expected_disk.tweak('iota', props={'red' : 'mojo', 'groovy' : 'baby'})
@@ -1335,15 +1322,11 @@ def depthy_wc_proplist(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- A_path = sbox.ospath('A')
- iota_path = sbox.ospath('iota')
- mu_path = sbox.ospath('A/mu')
-
# Set up properties.
- sbox.simple_propset('p', 'prop1', wc_dir)
- sbox.simple_propset('p', 'prop2', iota_path)
- sbox.simple_propset('p', 'prop3', A_path)
- sbox.simple_propset('p', 'prop4', mu_path)
+ sbox.simple_propset('p', 'prop1', '')
+ sbox.simple_propset('p', 'prop2', 'iota')
+ sbox.simple_propset('p', 'prop3', 'A')
+ sbox.simple_propset('p', 'prop4', 'A/mu')
# Commit.
sbox.simple_commit()
@@ -1390,15 +1373,11 @@ def depthy_url_proplist(sbox):
repo_url = sbox.repo_url
wc_dir = sbox.wc_dir
- A_path = sbox.ospath('A')
- iota_path = sbox.ospath('iota')
- mu_path = sbox.ospath('A/mu')
-
# Set up properties.
- sbox.simple_propset('p', 'prop1', wc_dir)
- sbox.simple_propset('p', 'prop2', iota_path)
- sbox.simple_propset('p', 'prop3', A_path)
- sbox.simple_propset('p', 'prop4', mu_path)
+ sbox.simple_propset('p', 'prop1', '')
+ sbox.simple_propset('p', 'prop2', 'iota')
+ sbox.simple_propset('p', 'prop3', 'A')
+ sbox.simple_propset('p', 'prop4', 'A/mu')
# Test depth-empty proplist.
exit_code, output, errput = svntest.main.run_svn(None, 'proplist',
@@ -1512,18 +1491,17 @@ def remove_custom_ns_props(sbox):
wc_dir = sbox.wc_dir
# Add a property to a file
- iota_path = sbox.ospath('iota')
- sbox.simple_propset('ns:cash-sound', 'cha-ching!', iota_path)
+ sbox.simple_propset('ns:cash-sound', 'cha-ching!', 'iota')
# Commit the file
- sbox.simple_commit(iota_path)
+ sbox.simple_commit('iota')
# Now, make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Remove the property
- sbox.simple_propdel('ns:cash-sound', iota_path)
+ sbox.simple_propdel('ns:cash-sound', 'iota')
# Create expected trees.
expected_output = svntest.wc.State(wc_dir, {
@@ -1566,8 +1544,8 @@ def props_over_time(sbox):
# Add/tweak a property 'revision' with value revision-committed to a
# file, commit, and then repeat this a few times.
for rev in range(2, 4):
- sbox.simple_propset('revision', str(rev), iota_path)
- sbox.simple_commit(iota_path)
+ sbox.simple_propset('revision', str(rev), 'iota')
+ sbox.simple_commit('iota')
# Backdate to r2 so the defaults for URL- vs. WC-style queries are
# different.
@@ -1653,18 +1631,18 @@ def same_replacement_props(sbox):
foo_path = sbox.ospath('foo')
open(foo_path, 'w').close()
- sbox.simple_add(foo_path)
- sbox.simple_propset('someprop', 'someval', foo_path)
- sbox.simple_commit(foo_path)
- sbox.simple_rm(foo_path)
+ sbox.simple_add('foo')
+ sbox.simple_propset('someprop', 'someval', 'foo')
+ sbox.simple_commit('foo')
+ sbox.simple_rm('foo')
# Now replace 'foo'.
open(foo_path, 'w').close()
- sbox.simple_add(foo_path)
+ sbox.simple_add('foo')
# Set the same property again, with the same value.
- sbox.simple_propset('someprop', 'someval', foo_path)
- sbox.simple_commit(foo_path)
+ sbox.simple_propset('someprop', 'someval', 'foo')
+ sbox.simple_commit('foo')
# Check if the property made it into the repository.
foo_url = sbox.repo_url + '/foo'
@@ -1688,8 +1666,8 @@ def added_moved_file(sbox):
open(foo_path, 'w').close()
# add it
- sbox.simple_add(foo_path)
- sbox.simple_propset('someprop', 'someval', foo_path)
+ sbox.simple_add('foo')
+ sbox.simple_propset('someprop', 'someval', 'foo')
# move it
svntest.main.run_svn(None, 'mv', foo_path, foo2_path)
@@ -1755,17 +1733,17 @@ def rm_of_replaced_file(sbox):
# Add some properties to iota and mu
iota_path = sbox.ospath('iota')
- sbox.simple_propset('red', 'rojo', iota_path)
- sbox.simple_propset('blue', 'lagoon', iota_path)
+ sbox.simple_propset('red', 'rojo', 'iota')
+ sbox.simple_propset('blue', 'lagoon', 'iota')
mu_path = sbox.ospath('A/mu')
- sbox.simple_propset('yellow', 'submarine', mu_path)
- sbox.simple_propset('orange', 'toothpick', mu_path)
+ sbox.simple_propset('yellow', 'submarine', 'A/mu')
+ sbox.simple_propset('orange', 'toothpick', 'A/mu')
sbox.simple_commit()
# Copy iota over the top of mu
- sbox.simple_rm(mu_path)
+ sbox.simple_rm('A/mu')
svntest.main.run_svn(None, 'cp', iota_path, mu_path)
expected_disk = svntest.main.greek_state.copy()
@@ -1809,7 +1787,6 @@ def prop_reject_grind(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = sbox.ospath('iota')
mu_path = sbox.ospath('A/mu')
mu_prej_path = sbox.ospath('A/mu.prej')
@@ -1817,60 +1794,60 @@ def prop_reject_grind(sbox):
# and as incoming-delete. Also set up our local-edit and local-delete
# properties. We also need some properties that are simply different
# from the incoming properties
- sbox.simple_propset('edit.diff', 'repos', iota_path)
- sbox.simple_propset('edit.edit', 'repos', iota_path)
- sbox.simple_propset('edit.del', 'repos', iota_path)
- sbox.simple_propset('edit.add', 'repos', iota_path)
- sbox.simple_propset('edit.none', 'repos', iota_path)
- sbox.simple_propset('del.edit', 'repos', iota_path)
- sbox.simple_propset('del.edit2', 'repos', iota_path)
- sbox.simple_propset('del.diff', 'repos', iota_path)
- sbox.simple_propset('del.del', 'repos', iota_path)
- sbox.simple_propset('del.add', 'repos', iota_path)
-
- sbox.simple_propset('edit.edit', 'local', mu_path)
- sbox.simple_propset('add.edit', 'local', mu_path)
- sbox.simple_propset('del.edit', 'local', mu_path)
- sbox.simple_propset('del.edit2', 'repos', mu_path)
- sbox.simple_propset('add.del', 'local', mu_path)
- sbox.simple_propset('edit.del', 'local', mu_path)
- sbox.simple_propset('del.del', 'local', mu_path)
- sbox.simple_propset('edit.diff', 'local', mu_path)
- sbox.simple_propset('add.diff', 'local', mu_path)
- sbox.simple_propset('del.diff', 'local', mu_path)
+ sbox.simple_propset('edit.diff', 'repos', 'iota')
+ sbox.simple_propset('edit.edit', 'repos', 'iota')
+ sbox.simple_propset('edit.del', 'repos', 'iota')
+ sbox.simple_propset('edit.add', 'repos', 'iota')
+ sbox.simple_propset('edit.none', 'repos', 'iota')
+ sbox.simple_propset('del.edit', 'repos', 'iota')
+ sbox.simple_propset('del.edit2', 'repos', 'iota')
+ sbox.simple_propset('del.diff', 'repos', 'iota')
+ sbox.simple_propset('del.del', 'repos', 'iota')
+ sbox.simple_propset('del.add', 'repos', 'iota')
+
+ sbox.simple_propset('edit.edit', 'local', 'A/mu')
+ sbox.simple_propset('add.edit', 'local', 'A/mu')
+ sbox.simple_propset('del.edit', 'local', 'A/mu')
+ sbox.simple_propset('del.edit2', 'repos', 'A/mu')
+ sbox.simple_propset('add.del', 'local', 'A/mu')
+ sbox.simple_propset('edit.del', 'local', 'A/mu')
+ sbox.simple_propset('del.del', 'local', 'A/mu')
+ sbox.simple_propset('edit.diff', 'local', 'A/mu')
+ sbox.simple_propset('add.diff', 'local', 'A/mu')
+ sbox.simple_propset('del.diff', 'local', 'A/mu')
sbox.simple_commit()
# Create r3 with all the properties that we intend to use as incoming-add,
# and then perform the incoming-edits and incoming-deletes.
- sbox.simple_propset('add.add', 'repos', iota_path)
- sbox.simple_propset('add.edit', 'repos', iota_path)
- sbox.simple_propset('add.del', 'repos', iota_path)
- sbox.simple_propset('add.diff', 'repos', iota_path)
- sbox.simple_propset('edit.diff', 'repos.changed', iota_path)
- sbox.simple_propset('edit.edit', 'repos.changed', iota_path)
- sbox.simple_propset('edit.del', 'repos.changed', iota_path)
- sbox.simple_propset('edit.add', 'repos.changed', iota_path)
- sbox.simple_propset('edit.none', 'repos.changed', iota_path)
- sbox.simple_propdel('del.edit', iota_path)
- sbox.simple_propdel('del.edit2', iota_path)
- sbox.simple_propdel('del.diff', iota_path)
- sbox.simple_propdel('del.del', iota_path)
- sbox.simple_propdel('del.add', iota_path)
+ sbox.simple_propset('add.add', 'repos', 'iota')
+ sbox.simple_propset('add.edit', 'repos', 'iota')
+ sbox.simple_propset('add.del', 'repos', 'iota')
+ sbox.simple_propset('add.diff', 'repos', 'iota')
+ sbox.simple_propset('edit.diff', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.edit', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.del', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.add', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.none', 'repos.changed', 'iota')
+ sbox.simple_propdel('del.edit', 'iota')
+ sbox.simple_propdel('del.edit2', 'iota')
+ sbox.simple_propdel('del.diff', 'iota')
+ sbox.simple_propdel('del.del', 'iota')
+ sbox.simple_propdel('del.add', 'iota')
sbox.simple_commit()
# Set up our victim for all the right rejects: local-adds, local-edits,
# and local-deletes.
- sbox.simple_propset('edit.add', 'local', mu_path)
- sbox.simple_propset('add.add', 'local', mu_path)
- sbox.simple_propset('del.add', 'local', mu_path)
- sbox.simple_propset('edit.edit', 'local.changed', mu_path)
- sbox.simple_propset('add.edit', 'local.changed', mu_path)
- sbox.simple_propset('del.edit', 'local.changed', mu_path)
- sbox.simple_propset('del.edit2', 'repos.changed', mu_path)
- sbox.simple_propdel('add.del', mu_path)
- sbox.simple_propdel('edit.del', mu_path)
- sbox.simple_propdel('del.del', mu_path)
+ sbox.simple_propset('edit.add', 'local', 'A/mu')
+ sbox.simple_propset('add.add', 'local', 'A/mu')
+ sbox.simple_propset('del.add', 'local', 'A/mu')
+ sbox.simple_propset('edit.edit', 'local.changed', 'A/mu')
+ sbox.simple_propset('add.edit', 'local.changed', 'A/mu')
+ sbox.simple_propset('del.edit', 'local.changed', 'A/mu')
+ sbox.simple_propset('del.edit2', 'repos.changed', 'A/mu')
+ sbox.simple_propdel('add.del', 'A/mu')
+ sbox.simple_propdel('edit.del', 'A/mu')
+ sbox.simple_propdel('del.del', 'A/mu')
# Now merge r2:3 into the victim to create all variants
svntest.main.run_svn(False, 'merge', '-r2:3', sbox.repo_url + '/iota',
@@ -1951,7 +1928,7 @@ def obstructed_subdirs(sbox):
# this test ensures we won't run into that problem again.
C_path = sbox.ospath('A/C')
- sbox.simple_propset('red', 'blue', C_path)
+ sbox.simple_propset('red', 'blue', 'A/C')
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('A/C', props={'red': 'blue'})
Modified: subversion/branches/issue-3668-3669/subversion/tests/cmdline/schedule_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/tests/cmdline/schedule_tests.py?rev=1033099&r1=1033098&r2=1033099&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/tests/cmdline/schedule_tests.py (original)
+++ subversion/branches/issue-3668-3669/subversion/tests/cmdline/schedule_tests.py Tue Nov 9 17:00:37 2010
@@ -71,7 +71,7 @@ def add_files(sbox):
svntest.main.file_append(zeta_path, "This is the file 'zeta'.")
svntest.main.file_append(epsilon_path, "This is the file 'epsilon'.")
- sbox.simple_add(delta_path, zeta_path, epsilon_path)
+ sbox.simple_add('delta', 'A/B/zeta', 'A/D/G/epsilon')
# Make sure the adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -100,7 +100,7 @@ def add_directories(sbox):
os.mkdir(Y_path)
os.mkdir(Z_path)
- sbox.simple_add(X_path, Y_path, Z_path)
+ sbox.simple_add('X', 'A/C/Y', 'A/D/H/Z')
# Make sure the adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -150,7 +150,7 @@ def nested_adds(sbox):
svntest.main.file_append(zeta_path, "This is the file 'zeta'.")
# Finally, let's try adding our new files and directories
- sbox.simple_add(X_path, Y_path, Z_path)
+ sbox.simple_add('X', 'A/C/Y', 'A/D/H/Z')
# Make sure the adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -177,19 +177,19 @@ def add_executable(sbox):
sbox.build(read_only = True)
def runTest(wc_dir, fileName, perm, executable):
- fileName = sbox.ospath(fileName)
+ file_ospath = sbox.ospath(fileName)
if executable:
expected_out = ["*\n"]
else:
expected_out = []
# create an empty file
- open(fileName, "w")
+ open(file_ospath, "w")
- os.chmod(fileName, perm)
+ os.chmod(file_ospath, perm)
sbox.simple_add(fileName)
svntest.actions.run_and_verify_svn(None, expected_out, [],
- 'propget', "svn:executable", fileName)
+ 'propget', "svn:executable", file_ospath)
test_cases = [
("all_exe", 0777, 1),
@@ -210,12 +210,7 @@ def delete_files(sbox):
wc_dir = sbox.wc_dir
# Schedule some files for deletion
- iota_path = sbox.ospath('iota')
- mu_path = sbox.ospath('A/mu')
- rho_path = sbox.ospath('A/D/G/rho')
- omega_path = sbox.ospath('A/D/H/omega')
-
- sbox.simple_rm(iota_path, mu_path, rho_path, omega_path)
+ sbox.simple_rm('iota', 'A/mu', 'A/D/G/rho', 'A/D/H/omega')
# Make sure the deletes show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -233,17 +228,7 @@ def delete_dirs(sbox):
wc_dir = sbox.wc_dir
# Schedule some directories for deletion (this is recursive!)
- E_path = sbox.ospath('A/B/E')
- F_path = sbox.ospath('A/B/F')
- H_path = sbox.ospath('A/D/H')
- alpha_path = sbox.ospath('A/B/E/alpha')
- beta_path = sbox.ospath('A/B/E/beta')
- chi_path = sbox.ospath('A/D/H/chi')
- omega_path = sbox.ospath('A/D/H/omega')
- psi_path = sbox.ospath('A/D/H/psi')
-
- # Now, delete (recursively) the directories.
- sbox.simple_rm(E_path, F_path, H_path)
+ sbox.simple_rm('A/B/E', 'A/B/F', 'A/D/H')
# Make sure the deletes show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -430,8 +415,8 @@ def unschedule_missing_added(sbox):
svntest.main.file_append(file1_path, "This is the file 'file1'.")
svntest.main.file_append(file2_path, "This is the file 'file2'.")
- sbox.simple_add(file1_path, file2_path)
- sbox.simple_mkdir(dir1_path, dir2_path)
+ sbox.simple_add('file1', 'file2')
+ sbox.simple_mkdir('dir1', 'dir2')
# Make sure the 4 adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -456,8 +441,8 @@ def unschedule_missing_added(sbox):
svntest.main.run_svn(svntest.verify.AnyOutput, 'rm', file1_path)
### actually, the stub does not provide enough information to revert
### the addition, so this command will fail. marking as XFail
- sbox.simple_rm(dir1_path)
- sbox.simple_revert(file2_path, dir2_path)
+ sbox.simple_rm('dir1')
+ sbox.simple_revert('file2', 'dir2')
# 'svn st' should now show absolutely zero local mods.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -483,7 +468,7 @@ def delete_missing(sbox):
svntest.main.safe_rmtree(H_path)
# Now schedule them for deletion anyway, and make sure no error is output.
- sbox.simple_rm(mu_path, H_path)
+ sbox.simple_rm('A/mu', 'A/D/H')
# Commit the deletions.
expected_output = svntest.wc.State(wc_dir, {
@@ -511,17 +496,13 @@ def revert_inside_newly_added_dir(sbox):
"revert inside a newly added dir"
sbox.build(read_only = True)
- wc_dir = sbox.wc_dir
-
- os.chdir(wc_dir)
# Schedule a new directory for addition
- os.mkdir('foo')
- sbox.simple_add('foo')
+ sbox.simple_mkdir('foo')
# Now change into the newly added directory, revert and make sure
# no error is output.
- os.chdir('foo')
+ os.chdir(sbox.ospath('foo'))
svntest.main.run_svn(None, 'revert', '.')
#----------------------------------------------------------------------
@@ -546,11 +527,11 @@ def status_add_deleted_directory(sbox):
A_path = sbox.ospath('A')
- sbox.simple_rm(A_path)
+ sbox.simple_rm('A')
svntest.main.safe_rmtree(A_path)
sbox.simple_commit()
- sbox.simple_mkdir(A_path)
+ sbox.simple_mkdir('A')
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
expected_status = svntest.wc.State(wc_dir,