You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2016/10/28 18:40:02 UTC

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

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(''))
]]]

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

Posted by Stefan <lu...@posteo.de>.
On 11/8/2016 21:45, Stefan wrote:
> On 10/28/2016 20:40, Daniel Shahaf wrote:
>> 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,
>>
> [...]
> I took the liberty and created a corresponding bug report in the issue
> tracker, so it's on record and can be referenced in the changelog.
> https://issues.apache.org/jira/browse/SVN-4660
>
> Regards,
> Stefan
>
Nominated for backport to 1.9.x in r1769491

Regards,
Stefan



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

Posted by Stefan <lu...@posteo.de>.
On 10/28/2016 20:40, Daniel Shahaf wrote:
> 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,
>
[...]
I took the liberty and created a corresponding bug report in the issue
tracker, so it's on record and can be referenced in the changelog.
https://issues.apache.org/jira/browse/SVN-4660

Regards,
Stefan