You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by fu...@apache.org on 2021/02/24 04:36:19 UTC
svn commit: r1886872 -
/subversion/trunk/subversion/bindings/swig/python/tests/fs.py
Author: futatuki
Date: Wed Feb 24 04:36:19 2021
New Revision: 1886872
URL: http://svn.apache.org/viewvc?rev=1886872&view=rev
Log:
swig-py: tests: Follow up to r1886858: Use svn.core.svn_dirent_join.
* subversion/bindings/swig/python/tests/fs.py
(_svn_path_join_internal): Remove.
(_get_dir_entries): Use svn.core.svn_dirent_join as it is prepared for this
purpose.
Modified:
subversion/trunk/subversion/bindings/swig/python/tests/fs.py
Modified: subversion/trunk/subversion/bindings/swig/python/tests/fs.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/python/tests/fs.py?rev=1886872&r1=1886871&r2=1886872&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/python/tests/fs.py (original)
+++ subversion/trunk/subversion/bindings/swig/python/tests/fs.py Wed Feb 24 04:36:19 2021
@@ -61,27 +61,6 @@ def svn_test__set_file_contents(root, pa
def svn_test__get_file_contents(root, path):
return svn_test__stream_to_string(fs.file_contents(root, path))
-
-def _svn_path_join_internal(base, component):
- """Join a base path (base) with a component (component), in str"""
-
- # If the component is absolute, then return it.
- if component[0:1] == '/':
- return component
- # If either is empty return the other
- if base == '':
- return component
- if component == '':
- return base
-
- if base == '/':
- # Ignore base, just return separator + component
- return '/' + component
-
- # Construnct the new, combined path.
- return base + '/' + component
-
-
def _get_dir_entries(root, path, tree_entries=None):
if tree_entries is None:
tree_entries = {}
@@ -95,10 +74,9 @@ def _get_dir_entries(root, path, tree_en
# Calculate the full path of this entry (by appending the name
# to the path thus far)
- name = dirent.name
- if not isinstance(name, str):
- name = name.decode('utf-8')
- full_path = _svn_path_join_internal(path, name)
+ full_path = core.svn_dirent_join(bpath, dirent.name)
+ if not isinstance(full_path, str):
+ full_path = full_path.decode('utf-8')
# Now, copy this dirent to the master hash, but this time, use
# the full path for the key