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

[PATCH] Re: bad output format design issue: svn log -v format is not parseable :-(

From: C.A.T.Magic <c.a.t.magic_at_gmx.at>
Date: 2004-04-05 18:06:25 CEST

yes, at least the longer usernames with whitespaces
were a hazzle before i patched the svn cli.
and if you ever have a name like
"patch2.3 (from customer)" in your
repository its at least annoying to find the exact
regexp for the log parser.

i'd like to suggest the following small patches,

but i'm not sure if anybody else (who doesnt care
for spaces) relies on the current /amiguous/ output
format. an optional solution could be to use a
colon instead of the tab, if you don't like tabs
to format your output. i found the TAB least intrusive.

my (suggested) CHANGES:

fixed two output format ambiguities:

patch1: svn status -v now truncates long usernames to the specified 12
characters to prevent ambiguity like in
>svn status -v
> 11 11 cat a file.txt
> 12 12 administrator johnMy spaced File.c

patch2: svn log now separates the path and the copyfrom path with a TAB,
since a tab cannot occour in a filename to prevent ambiguity like in
>svn log -v
> A \tag\patch1.2 (from customer) (from \trunk\patch1.2:623)
this now changes to
> A \tag\patch1.2 (from customer)<TAB>(from \trunk\patch1.2:623)



Index: C:/INSTALL/SubversionBUILD/subversion/subversion/clients/cmdline/status.c
--- C:/INSTALL/SubversionBUILD/subversion/subversion/clients/cmdline/status.c (revision 9281)
+++ C:/INSTALL/SubversionBUILD/subversion/subversion/clients/cmdline/status.c (working copy)
@@ -117,8 +117,10 @@
+ /* Usernames are truncated to 12 characters to avoid ambiguity
+ of long usernames with whitespace and/or filenames with whitespace */
   if (detailed && show_last_committed)
- printf ("%c%c%c%c%c %c %6s %6s %-12s %s\n",
+ printf ("%c%c%c%c%c %c %6s %6s %-12.12s %s\n",
             generate_status_code (status->text_status),
             generate_status_code (status->prop_status),
             status->locked ? 'L' : ' ',

Index: C:/INSTALL/SubversionBUILD/subversion/subversion/clients/cmdline/log-cmd.c
--- C:/INSTALL/SubversionBUILD/subversion/subversion/clients/cmdline/log-cmd.c (revision 9281)
+++ C:/INSTALL/SubversionBUILD/subversion/subversion/clients/cmdline/log-cmd.c (working copy)
@@ -281,9 +281,11 @@
               SVN_ERR (svn_cmdline_cstring_from_utf8
                        (&path_stdout, log_item->copyfrom_path, pool));
+ /* A TAB character separates the pathname and the
+ copyfrom pathname to avoid ambiguity for log parsers */
                 = apr_psprintf (pool,
- " (from %s:%" SVN_REVNUM_T_FMT ")",
+ "\t(from %s:%" SVN_REVNUM_T_FMT ")",

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Apr 5 18:07:08 2004

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

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