Hello,
Please find attached the patch for review.
As of today, we have defined the functions both in libsvn_fs_fs and
libsvn_fs_base libraries even though they are functionally identical.
This patch creates the initial framework to re-use the utility functions
used by FSFS and BDB file systems to avoid duplicate code lying in
libraries related to FSFS and BDB file systems.
For now, this patch defines a new function
svn_fs__canonicalize_abspath() to canonicalize the absolute path. This
function is a replacement for svn_fs_fs__canonicalize_abspath() and
svn_fs_base__canonicalize_abspath() functions used internally by FSFS
and BDB file systems respectively. The new function is also identical to
the older counterpart.
If this approach is right, we can define and re-use other possible
functions to avoid duplicate code lying in libraries related to FSFS and
BDB file systems. FWIW, I have run 'make check' with this patch and I
have not noticed any issues.
[[
Initial framework to re-use the utility functions used by FSFS and BDB
file systems to avoid duplicate code lying in libraries related to FSFS
and BDB file systems.
It includes a new libsvn_fs_util library to define the functions used by
both FSFS and BDB file systems. For now, svn_fs__canonicalize_abspath()
function, a replacement for svn_fs_fs__canonicalize_abspath() and
svn_fs_base__canonicalize_abspath() functions is defined here. But it
could be extended for other possible functions as well.
* subversion/libsvn_fs_base/tree.c
Include the private/svn_fs_util.h header file and bump copyright year
to 2007.
(open_path, get_dag, add_change, change_txn_merge_info,
base_node_history): Rename svn_fs_base__canonicalize_abspath() function
as svn_fs__canonicalize_abspath() function.
* subversion/libsvn_fs_base/fs.c
Remove the definition for old function
svn_fs_base__canonicalize_abspath().
* subversion/libsvn_fs_base/fs.h
Bump copyright year to 2007 and remove the declaration for old
function svn_fs_base__canonicalize_abspath().
* subversion/libsvn_fs_base/lock.c
Include the private/svn_fs_util.h header file and bump copyright year
to 2007.
(svn_fs_base__lock, svn_fs_base__unlock, svn_fs_base__get_lock,
svn_fs_base__get_locks): Rename svn_fs_base__canonicalize_abspath()
function as svn_fs__canonicalize_abspath() function.
* subversion/libsvn_fs_base/dag.c
Include the private/svn_fs_util.h header file and bump copyright year
to 2007.
(svn_fs_base__dag_copy): Rename svn_fs_base__canonicalize_abspath()
function as svn_fs__canonicalize_abspath() function.
* subversion/libsvn_fs_util/fs-util.c
New library for defining the functions which could be used by FSFS and
BDB libraries. For now, we have defined svn_fs__canonicalize_abspath()
function.
* subversion/include/private/svn_fs_util.h
New header file for declaring the functions which could be used by
FSFS and BDB file systems. For now, we have declared
svn_fs__canonicalize_abspath() function used to canonicalize the
absolute path.
* subversion/tests/libsvn_fs_base/fs-base-test.c
Include the private/svn_fs_util.h header file and bump copyright year
to 2007.
(canonicalize_abspath): Rename svn_fs_base__canonicalize_abspath()
function as svn_fs__canonicalize_abspath() function and correct the
msg appropriately.
* subversion/libsvn_fs_fs/tree.c
Include the private/svn_fs_util.h header file and bump copyright year
to 2007.
(open_path, get_dag, add_change, fs_change_node_prop, copy_helper,
fs_node_history): Rename svn_fs_fs__canonicalize_abspath() function as
svn_fs__canonicalize_abspath() function.
* subversion/libsvn_fs_fs/fs.c
Include the private/svn_fs_util.h header file and bump copyright year
to 2007.
svn_fs_fs__canonicalize_abspath().
* subversion/libsvn_fs_fs/fs.h
Include the private/svn_fs_util.h header file and bump copyright year
to 2007.
svn_fs_fs__canonicalize_abspath().
* subversion/libsvn_fs_fs/lock.c
Include the private/svn_fs_util.h header file and bump copyright year
to 2007.
(svn_fs_fs__allow_locked_operation, svn_fs_fs__lock,
svn_fs_fs__unlock, svn_fs_fs__get_lock, svn_fs_fs__get_locks): Rename
svn_fs_fs__canonicalize_abspath() function as
svn_fs__canonicalize_abspath() function.
Patch by: bhuvan
Suggested by: kameshj
]]
P.S: This is my first major patch for C API and I'm attempting to learn
them. I may have done some obvious mistakes, but I would appreciate if
you point them in a way I could understand. Thank you!
--
Regards,
Bhuvaneswaran
Received on Sat Mar 31 20:18:32 2007