You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jonathan Guy <jo...@ikoder.com> on 2019/03/03 13:07:53 UTC

New lines in notify.c

Hi all

Just out of curiosity in notify.c we have the two lines

SVN_ERR(svn_cmdline_printf(pool, "\rChecking r             "));
SVN_ERR(svn_cmdline_printf(pool, "\rChecking r%ld...", n->revision));

Is there a specific reason \r is used and not \n?

Thanks
Jonathan Guy

Re: New lines in notify.c

Posted by Stefan Sperling <st...@elego.de>.
On Sun, Mar 03, 2019 at 01:07:53PM +0000, Jonathan Guy wrote:
> Hi all
> 
> Just out of curiosity in notify.c we have the two lines
> 
> SVN_ERR(svn_cmdline_printf(pool, "\rChecking r             "));
> SVN_ERR(svn_cmdline_printf(pool, "\rChecking r%ld...", n->revision));
> 
> Is there a specific reason \r is used and not \n?

The conflict resolver uses this for reporting its progress while
scanning through history. The resolver might have to scan through
several hundreds or even thousands of revisions. Printing a newline
would make the output scroll by one line per scanned revision...

Re: New lines in notify.c

Posted by Branko Čibej <br...@apache.org>.
On 03.03.2019 14:07, Jonathan Guy wrote:
> Hi all
>
> Just out of curiosity in notify.c we have the two lines
>
> SVN_ERR(svn_cmdline_printf(pool, "\rChecking r             "));
> SVN_ERR(svn_cmdline_printf(pool, "\rChecking r%ld...", n->revision));
>
> Is there a specific reason \r is used and not \n?

Yes. \r is the carriage-return control code. If your screen were a
teletype, it would do something like this:

https://www.youtube.com/watch?v=UxKqOdQx-9k

-- Brane