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

'svn info --show-item=revision' has trailing whitespace

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 28 Oct 2016 18:40:02 +0000

Stefan Hett found this trailing whitespace:

% svn info --show-item=revision | xxd
0000000: 3137 3632 3031 3620 2020 0a 1762016 .

I think the attached patch should fix it. Haven't tested it yet (I'm
not near a build environment).

Cheers,

Daniel

[[[
'svn info --show-item': Don't print trailing whitespace after revision
numbers that comprise 8 digits or less.

* subversion/svn/info-cmd.c
  (print_info_item_revision): As above.

* subversion/tests/cmdline/info_tests.py
  (info_item_simple): Change the expectation from unanchored regexp
    match to string equality, to catch the above bug.
]]]

[[[
Index: subversion/svn/info-cmd.c
===================================================================
--- subversion/svn/info-cmd.c (revision 1762016)
+++ subversion/svn/info-cmd.c (working copy)
@@ -811,7 +811,7 @@ print_info_item_revision(svn_revnum_t rev, const c
       if (target_path)
         SVN_ERR(svn_cmdline_printf(pool, "%-10ld %s", rev, target_path));
       else
- SVN_ERR(svn_cmdline_printf(pool, "%-10ld", rev));
+ SVN_ERR(svn_cmdline_printf(pool, "%ld", rev));
     }
   else if (target_path)
     SVN_ERR(svn_cmdline_printf(pool, "%-10s %s", "", target_path));
Index: subversion/tests/cmdline/info_tests.py
===================================================================
--- subversion/tests/cmdline/info_tests.py (revision 1762016)
+++ subversion/tests/cmdline/info_tests.py (working copy)
@@ -641,6 +641,6 @@ def info_item_simple(sbox):
 
   sbox.build(read_only=True)
   svntest.actions.run_and_verify_svn(
- '1', [],
+ ['1'], [],
     'info', '--show-item=revision', '--no-newline',
     sbox.ospath(''))
]]]
Received on 2016-10-28 20:42:15 CEST

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.