subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Shahaf <...@daniel.shahaf.name>
Subject 'svn info --show-item=revision' has trailing whitespace
Date Fri, 28 Oct 2016 18:40:02 GMT
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(''))
]]]

Mime
View raw message