CR in notify.c

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

CR in notify.c

Philip Martin
When rolling trunk tarballs I notice the error:

../svn/notify.c:483: warning: internationalized messages should not contain the '\r' escape sequence

The '\r' is intentional, the notification is of the form:

  Checking r32...

and the \r causes the line to get overwritten as the revision changes.
I haven't tested what happens if the revision number gets shorter by
lots of digits, but I suspect that if a long first notification:

  Checking r1234567...

is followed by a short second:

  Checking r99...

the first will not be completely obliterated by the second.

Perhaps we should move the \r out of the internationalized message and
use it in some longer message that is guaranteed to obliterate any
previous message.

--
Philip
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CR in notify.c

Philip Martin
Philip Martin <[hidden email]> writes:

> the first will not be completely obliterated by the second.

I hacked the code rather than create a repository with millions of
revisions:

     case svn_wc_notify_tree_conflict_details_progress:
-      SVN_ERR(svn_cmdline_printf(pool, _("\rChecking r%ld..."), n->revision));
+      {
+      static long revision = 1111111;
+      SVN_ERR(svn_cmdline_printf(pool, _("\rChecking r%ld..."), revision));
+      revision = 99;
+      sleep(5);
+      }
       break;

and it does produce garbled output:

      Checking r1111111...

becomes:

      Checking r99...11...

--
Philip
Loading...