git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[WIP PATCH 4/7] Replace deprecated svn_path_join

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 23, 2010, 16:22 UTC
Message-ID
<1277310140-16891-5-git-send-email-artagnon@gmail.com>
In-Reply-To
<1277310140-16891-1-git-send-email-artagnon@gmail.com>

Strip the deprecated svn_path_join API, using svn_path_compose instead. Re-add -Werror to the Makefile.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 Makefile      |    2 +-
 dump_editor.c |   21 ++++++++++++++-------
 2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index 269c406..cf7fef7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
 svnclient_ra: *.c *.h
-	$(CC) -Wall -ggdb3 -O0 -o $@ svnclient_ra.c debug_editor.c dump_editor.c -lsvn_client-1 -I. -I/usr/local/include/subversion-1 -I/usr/include/apr-1.0
+	$(CC) -Wall -Werror -ggdb3 -O0 -o $@ svnclient_ra.c debug_editor.c dump_editor.c -lsvn_client-1 -I. -I/usr/local/include/subversion-1 -I/usr/include/apr-1.0
 clean:
 	$(RM) svnclient_ra
diff --git a/dump_editor.c b/dump_editor.c
index ba0630f..00c838a 100644
--- a/dump_editor.c
+++ b/dump_editor.c
@@ -80,14 +80,17 @@ struct dir_baton *make_dir_baton(const char *path,
 	struct dir_baton *pb = parent_dir_baton;
 	struct dir_baton *new_db = apr_pcalloc(pool, sizeof(*new_db));
 	const char *full_path;
-
+	apr_array_header_t *compose_path = apr_array_make(pool, 2, sizeof(const char *));
 
 	/* A path relative to nothing?  I don't think so. */
 	SVN_ERR_ASSERT_NO_RETURN(!path || pb);
 
 	/* Construct the full path of this node. */
-	if (pb)
-		full_path = svn_path_join("/", path, pool);
+	if (pb) {
+		APR_ARRAY_PUSH(compose_path, const char *) = "/";
+		APR_ARRAY_PUSH(compose_path, const char *) = path;
+		full_path = svn_path_compose(compose_path, pool);
+	}
 	else
 		full_path = apr_pstrdup(pool, "/");
 
@@ -332,12 +335,14 @@ svn_error_t *open_directory(const char *path,
 	struct dir_baton *new_db;
 	const char *cmp_path = NULL;
 	svn_revnum_t cmp_rev = SVN_INVALID_REVNUM;
+	apr_array_header_t *compose_path = apr_array_make(pool, 2, sizeof(const char *));
 
 	/* If the parent directory has explicit comparison path and rev,
 	   record the same for this one. */
 	if (pb && ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev)) {
-		cmp_path = svn_path_join(pb->cmp_path,
-		                         svn_dirent_basename(path, pool), pool);
+		APR_ARRAY_PUSH(compose_path, const char *) = pb->cmp_path;
+		APR_ARRAY_PUSH(compose_path, const char *) = svn_dirent_basename(path, pool);
+		cmp_path = svn_path_compose(compose_path, pool);
 		cmp_rev = pb->cmp_rev;
 	}
 
@@ -424,11 +429,13 @@ svn_error_t *open_file(const char *path,
 	const char *cmp_path = NULL;
 	svn_revnum_t cmp_rev = SVN_INVALID_REVNUM;
 
+	apr_array_header_t *compose_path = apr_array_make(pool, 2, sizeof(const char *));
 	/* If the parent directory has explicit comparison path and rev,
 	   record the same for this one. */
 	if (pb && ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev)) {
-		cmp_path = svn_path_join(pb->cmp_path,
-		                         svn_dirent_basename(path, pool), pool);
+		APR_ARRAY_PUSH(compose_path, const char *) = pb->cmp_path;
+		APR_ARRAY_PUSH(compose_path, const char *) = svn_dirent_basename(path, pool);
+		cmp_path = svn_path_compose(compose_path, pool);
 		cmp_rev = pb->cmp_rev;
 	}
 
-- 
1.7.1
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 13 of 18 in “[GSoC update] git-remote-svn: Week 8”
  1. Ramkumar RamachandraJun 23, 2010
  2. 1/7 Add skeleton RA svnclientRamkumar Ramachandra, Jun 23, 2010
  3. Jonathan NiederJun 25, 2010
  4. Daniel ShahafJun 25, 2010
  5. Ramkumar RamachandraJun 25, 2010
  6. Daniel ShahafJun 25, 2010
  7. OT: typesafe callbacks in C (Re: [WIP PATCH 1/7] Add skeleton RA svnclient)Jonathan Nieder, Jun 25, 2010
  8. Jonathan NiederJun 25, 2010
  9. Jonathan NiederJun 25, 2010
  10. 2/7 Add stripped dump editorRamkumar Ramachandra, Jun 23, 2010
  11. 3/7 Import dump_node to dump what changed and cleanup whitespaceRamkumar Ramachandra, Jun 23, 2010
  12. Ramkumar RamachandraJun 23, 2010
  13. 4/7 Replace deprecated svn_path_joinRamkumar Ramachandra, Jun 23, 2010
  14. 5/7 Trigger dump_node in change_dir_propRamkumar Ramachandra, Jun 23, 2010
  15. 6/7 Add file_baton and trigger dump_node in change_file_propRamkumar Ramachandra, Jun 23, 2010
  16. 7/7 Dump the text deltaRamkumar Ramachandra, Jun 23, 2010
  17. Ramkumar RamachandraJun 23, 2010
  18. Jonathan NiederJun 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.