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

Re: [PATCH] new parameter option '--full-paths' for 'svnlook tree'

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-04-05 23:10:07 CEST

Mathias.Weinert@gfa-net.de writes:

> --- subversion/svnlook/main.c.orig 2004-10-13 10:35:57.000000000
> +0200
> +++ subversion/svnlook/main.c 2005-03-30 11:51:54.396306800 +0200
> @@ -74,7 +74,8 @@
> {
> svnlook__version = SVN_OPT_FIRST_LONGOPT_ID,
> svnlook__show_ids,
> - svnlook__no_diff_deleted
> + svnlook__no_diff_deleted,
> + svnlook__full_paths
> };
>
> /*
> @@ -109,6 +110,9 @@
> {"no-diff-deleted", svnlook__no_diff_deleted, 0,
> N_("do not print differences for deleted files")},
>
> + {"full-paths", svnlook__full_paths, 0,
> + N_("show full paths instead of indenting them")},
> +
> {0, 0, 0, 0}
> };
>
> @@ -186,7 +190,7 @@
> N_("usage: svnlook tree REPOS_PATH [PATH_IN_REPOS]\n\n"
> "Print the tree, starting at PATH_IN_REPOS (if supplied, at the
> root\n"
> "of the tree otherwise), optionally showing node revision
> ids.\n"),

I was tempted to apply this patch, but your email client has mangled
it and I got several rejects, see the above lines for example.

> - {'r', 't', svnlook__show_ids} },
> + {'r', 't', svnlook__show_ids, svnlook__full_paths} },
>
> {"uuid", subcommand_uuid, {0},
> N_("usage: svnlook uuid REPOS_PATH\n\n"
> @@ -215,6 +219,7 @@
> svn_boolean_t help; /* --help */
> svn_boolean_t no_diff_deleted; /* --no-diff-deleted */
> svn_boolean_t verbose; /* --verbose */
> + svn_boolean_t full_paths; /* --full-paths */
> };
>
>
> @@ -225,6 +230,7 @@
> svn_boolean_t is_revision;
> svn_boolean_t show_ids;
> svn_boolean_t no_diff_deleted;
> + svn_boolean_t full_paths;
> svn_revnum_t rev_id;
> svn_fs_txn_t *txn;
> const char *txn_name /* UTF-8! */;
> @@ -1002,6 +1008,7 @@
> svn_boolean_t is_dir,
> int indentation,
> svn_boolean_t show_ids,
> + svn_boolean_t full_paths,
> apr_pool_t *pool)
> {
> apr_pool_t *subpool;
> @@ -1009,21 +1016,27 @@
> const char *name_native;
> apr_hash_t *entries;
> apr_hash_index_t *hi;
> + const char *print_path;
>
> SVN_ERR (check_cancel (NULL));
>
> /* Print the indentation. */
> - for (i = 0; i < indentation; i++)
> - {
> - SVN_ERR (svn_cmdline_fputs (" ", stdout, pool));
> - }
> + if(!full_paths)
> + for (i = 0; i < indentation; i++)
> + {
> + SVN_ERR (svn_cmdline_fputs (" ", stdout, pool));
> + }
>
> /* Print the node. */
> SVN_ERR (svn_utf_cstring_from_utf8 (&name_native,
> svn_path_basename (path, pool),
> pool));

I noticed that the above conversion was redundant so I removed it in
r13957.

> + if(!full_paths)
> + print_path = svn_path_basename (path, pool);
> + else
> + print_path = path;
> SVN_ERR (svn_cmdline_printf (pool, "%s%s",
> - svn_path_basename (path, pool),
> + print_path,
> is_dir ? "/" : ""));
>
> if (show_ids)

You might like to update the patch and submit it again. For extra
points add a regression test to svnlook_tests.py that runs the new
code.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 6 19:15:32 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.