You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Collins-Sussman <su...@red-bean.com> on 2007/10/02 01:14:50 UTC

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Guys, I have a patch to fix this problem (attached) which just adds
svn_cmdline_fflush() after every call to svn_cmdline_printf() within
in the interactive conflict loop.

It seems sort of hacky to me though.  epg was thinking that maybe we
should change svn_cmdline_printf() to automatically fflush() if the
incoming string ends with \n.  What do people think?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Daniel Rall <dl...@collab.net>.
I committed the patch in r26917.

On Tue, 02 Oct 2007, Ben Collins-Sussman wrote:

> This patch looks pretty good to me.  Can you commit it, and see if it
> resolves the weird behavior that Mark was seeing?
> 
> On 10/1/07, Daniel L. Rall <dl...@finemaltcoding.com> wrote:
> > On Mon, 01 Oct 2007, Eric Gillespie wrote:
> >
> > > Jack Repenning <jr...@collab.net> writes:
> > >
> > > > On Oct 1, 2007, at 6:32 PM, Eric Gillespie wrote:
> > > >
> > > > > I advocate setting line buffering in
> > > > > svn_cmdline_init, something like:
> > > > >
> > > > >   setvbuf(stderr, NULL, _IOLBF, 0);
> > > > >   setvbuf(stdout, NULL, _IOLBF, 0);
> > > >
> > > > +1 on stdout.  But isn't stderr ordinarily character-buffered, for
> > > > reasons having to do with ensuring you can report program crash even
> > > > if the crash is because you can't allocate a line buffer to report it?
> > >
> > > When connected to a tty, yes; good catch.  We should use _IONBF
> > > for stderr.
> >
> > Patch attached.  Rather than operating on stderr, svn_cmdline_init()
> > takes an ERROR_STREAM parameter.  Return values from setvbuf() appear
> > to be best-off ignored, I suppose.

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Augie Fackler <du...@gmail.com>.

On Oct 3, 2007, at 10:23 AM, Mark Phippard wrote:

> On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
>> On 10/3/07, Mark Phippard <ma...@gmail.com> wrote:
>>> On 10/3/07, Erik Huelsmann <eh...@gmail.com> wrote:
>>>> On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
>>>>> On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
>>>>>> Did you try this on your Mac?  I get the same behavior as  
>>>>>> Augie when I
>>>>>> try this on OSX.  I'll be happy to try it again after the  
>>>>>> patch is
>>>>>> committed.
>>>>>
>>>>> Yes, this is a transcript from my Mac.
>>>>
>>>> Are you all using recent/current trunk versions? Could anything  
>>>> have
>>>> happened in the mean time?
>>>
>>> Did a HEAD build last night and I still get it on OSX.
>>
>> I still can't reproduce on my Mac, using HEAD.  Can you apply dlr's
>> proposed patch, see if it fixes the problem?
>
> I applied Dan's patch and I still have the problem.  Other than
> changing the colors, I am just using the default OSX terminal.

Just tried here with and without the patch, reproduced the problem  
using both Terminal.app and the xterm that comes with Apple's X11,  
both in 10.4.10.

I just wrote a test here to try and check and see what's going on:

[imladris:~] durin% cat test.c                                
[10/03/07 10:55AM]
#include <stdio.h>
#include <unistd.h>

int main()
{
   printf("o");
   fprintf(stderr, "e");
   system("sleep 1");
   printf("o\n");
   fprintf(stderr, "e\n");
   system("sleep 1");
   return 0;
}
[imladris:~] durin% cc test.c -o test                         
[10/03/07 10:55AM]
[imladris:~] durin% ./test                                    
[10/03/07 10:55AM]
eoo
e
[imladris:~] durin%                                           
[10/03/07 10:55AM]

Which means that stderr should be defaulting to no buffering, and  
stdout should be defaulting to line buffering, as set in the patch. A  
quick dance with gdb suggests that nothing else is calling setvbuf  
(called only twice, both times in svn_cmdline_init), which leaves me  
even more confused as to why this isn't behaving normally.

Augie

(Mark, sorry about the double-send, I fail at Mail.app today)

>
> -- 
> Thanks
>
> Mark Phippard
> http://markphip.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Mark Phippard <ma...@gmail.com>.
On 10/3/07, Eric Gillespie <ep...@google.com> wrote:
> Eric Gillespie <ep...@google.com> writes:
> > We still need Dan's patch for other reasons, but it has nothing
> > to do with the problem.  I updated the issue yesterday with an
> > explanation of the problem, and how to fix it.
> >
> > ------- Additional comments from Eric Gillespie Tue Oct 2 17:20:15 -0700 2007 -------
> >
> > This happens because the prompt goes to stderr while the error message
> > goes to stdout (bogus).  We need to change the rest of the prompt
> > callback to use svn_cmdline_fprintf(stderr).
> >
> > As an aside, I don't see why this fails on Mac (isn't that where you
> > guys said you see this).  On sane systems, stdout is line-buffered
> > when connected to a tty, so the error message should have gone through
> > anyway (as it does on Linux).  I don't know why it's not, but that's
> > why adding the flush calls helped.  We have a separate change in
> > progress (from dlr) to force stderr/stdout to buffer the way we like,
> > though, so it doesn't really matter.
> >
>
> Try this patch (I haven't even compiled it):

Conceptually it works.  Looks like it needs some \n inserted (perhaps
this explains the buffering with the current code too?)

$ svn merge -g
--- Merging r2 through r8 into '.':
U    src/com/collabnet/banking/tests/BankingTests.java
Conflict discovered in 'src/com/collabnet/banking/models/BankAccount.java'.
Select: (p)ostpone, (d)iff, (e)dit, (h)elp : e
None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
and no 'editor-cmd' run-time configuration option was foundSelect:
(p)ostpone, (d)iff, (e)dit, (h)elp : e
None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
and no 'editor-cmd' run-time configuration option was foundSelect:
(p)ostpone, (d)iff, (e)dit, (h)elp : p
C    src/com/collabnet/banking/models/BankAccount.java
U    docs/products/index.html
U    docs/about/index.html
subversion/libsvn_client/merge.c:1504: (apr_err=155015)
svn: One or more conflicts were produced while merging r1:8 into
'.' --
resolve all conflicts and rerun the merge to apply the remaining
unmerged revisions


-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Eric Gillespie <ep...@google.com>.
Eric Gillespie <ep...@google.com> writes:

> "Mark Phippard" <ma...@gmail.com> writes:
> 
> > On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > > On 10/3/07, Mark Phippard <ma...@gmail.com> wrote:
> > > > On 10/3/07, Erik Huelsmann <eh...@gmail.com> wrote:
> > > > > On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > > > > > On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> > > > > > > Did you try this on your Mac?  I get the same behavior as Augie when I
> > > > > > > try this on OSX.  I'll be happy to try it again after the patch is
> > > > > > > committed.
> > > > > >
> > > > > > Yes, this is a transcript from my Mac.
> > > > >
> > > > > Are you all using recent/current trunk versions? Could anything have
> > > > > happened in the mean time?
> > > >
> > > > Did a HEAD build last night and I still get it on OSX.
> > >
> > > I still can't reproduce on my Mac, using HEAD.  Can you apply dlr's
> > > proposed patch, see if it fixes the problem?
> > 
> > I applied Dan's patch and I still have the problem.  Other than
> > changing the colors, I am just using the default OSX terminal.
> 
> We still need Dan's patch for other reasons, but it has nothing
> to do with the problem.  I updated the issue yesterday with an
> explanation of the problem, and how to fix it.
> 
> ------- Additional comments from Eric Gillespie Tue Oct 2 17:20:15 -0700 2007 -------
> 
> This happens because the prompt goes to stderr while the error message
> goes to stdout (bogus).  We need to change the rest of the prompt
> callback to use svn_cmdline_fprintf(stderr).
> 
> As an aside, I don't see why this fails on Mac (isn't that where you
> guys said you see this).  On sane systems, stdout is line-buffered
> when connected to a tty, so the error message should have gone through
> anyway (as it does on Linux).  I don't know why it's not, but that's
> why adding the flush calls helped.  We have a separate change in
> progress (from dlr) to force stderr/stdout to buffer the way we like,
> though, so it doesn't really matter.
> 

Try this patch (I haven't even compiled it):

Index: conflict-callbacks.c
===================================================================
--- conflict-callbacks.c	(revision 26905)
+++ conflict-callbacks.c	(working copy)
@@ -154,9 +154,9 @@
       char *prompt;
       svn_boolean_t performed_edit = FALSE;
 
-      SVN_ERR(svn_cmdline_printf(subpool,
-                                 _("Conflict discovered in '%s'.\n"),
-                                 desc->path));
+      SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+                                  _("Conflict discovered in '%s'.\n"),
+                                  desc->path));
       while (TRUE)
         {
           svn_pool_clear(subpool);
@@ -173,7 +173,7 @@
 
           if ((strcmp(answer, "h") == 0) || (strcmp(answer, "?") == 0))
             {
-              SVN_ERR(svn_cmdline_printf(subpool,
+              SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
               _("  (p)ostpone - mark the conflict to be resolved later\n"
                 "  (d)iff     - show all changes made to merged file\n"
                 "  (e)dit     - change merged file in an editor\n"
@@ -221,7 +221,8 @@
                   performed_edit = TRUE;
                 }
               else
-                SVN_ERR(svn_cmdline_printf(subpool, _("Invalid option.\n\n")));
+                SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+                                            _("Invalid option.\n\n")));
             }
           if (strcmp(answer, "e") == 0)
             {
@@ -232,16 +233,18 @@
                                                       NULL, NULL, subpool);
                   if (eerr && (eerr->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR))
                     {
-                      SVN_ERR(svn_cmdline_printf(subpool,
-                                                 eerr->message ? eerr->message :
-                                                 _("No editor found.\n")));
+                      SVN_ERR(svn_cmdline_fprintf(
+                                  stderr, subpool,
+                                  eerr->message ? eerr->message :
+                                  _("No editor found.\n")));
                       svn_error_clear(eerr);
                     }
                   else if (eerr && (eerr->apr_err == SVN_ERR_EXTERNAL_PROGRAM))
                     {
-                      SVN_ERR(svn_cmdline_printf(subpool,
-                                                 eerr->message ? eerr->message :
-                                                 _("Error running editor.\n")));
+                      SVN_ERR(svn_cmdline_fprintf(
+                                  stderr, subpool,
+                                  eerr->message ? eerr->message :
+                                  _("Error running editor.\n")));
                       svn_error_clear(eerr);
                     }
                   else if (eerr)
@@ -250,19 +253,21 @@
                     performed_edit = TRUE;
                 }
               else
-                SVN_ERR(svn_cmdline_printf(subpool, _("Invalid option.\n\n")));
+                SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+                                            _("Invalid option.\n\n")));
             }
           if (strcmp(answer, "l") == 0)
             {
               if (desc->base_file && desc->repos_file && desc->user_file)
                 {
                   /* ### TODO: launch $SVNMERGE tool here with 3 fulltexts. */
-                  SVN_ERR(svn_cmdline_printf(
-                              subpool, _("Feature not yet implemented.\n\n")));
+                  SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+                                       _("Feature not yet implemented.\n\n")));
                   performed_edit = TRUE;
                 }
               else
-                SVN_ERR(svn_cmdline_printf(subpool, _("Invalid option.\n\n")));
+                SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+                                            _("Invalid option.\n\n")));
             }
           if (strcmp(answer, "r") == 0)
             {
@@ -275,7 +280,8 @@
                   break;
                 }
               else
-                SVN_ERR(svn_cmdline_printf(subpool, _("Invalid option.\n\n")));
+                SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+                                            _("Invalid option.\n\n")));
             }
         }
     }
@@ -303,10 +309,11 @@
       const char *answer;
       const char *prompt;
 
-      SVN_ERR(svn_cmdline_printf(subpool,
-                                 _("Conflict discovered when trying to add '%s'.\n"
-                                   "An object of the same name already exists.\n"),
-                                 desc->path));
+      SVN_ERR(svn_cmdline_fprintf(
+                  stderr, subpool,
+                  _("Conflict discovered when trying to add '%s'.\n"
+                    "An object of the same name already exists.\n"),
+                  desc->path));
       prompt = _("Select: (p)ostpone, (m)ine, (t)heirs, (h)elp :");
 
       while (1)
@@ -317,7 +324,7 @@
 
           if ((strcmp(answer, "h") == 0) || (strcmp(answer, "?") == 0))
             {
-              SVN_ERR(svn_cmdline_printf(subpool,
+              SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
               _("  (p)ostpone - resolve the conflict later\n"
                 "  (m)ine     - accept pre-existing item \n"
                 "  (t)heirs   - accept incoming item\n"

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Eric Gillespie <ep...@google.com>.
"Mark Phippard" <ma...@gmail.com> writes:

> On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > On 10/3/07, Mark Phippard <ma...@gmail.com> wrote:
> > > On 10/3/07, Erik Huelsmann <eh...@gmail.com> wrote:
> > > > On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > > > > On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> > > > > > Did you try this on your Mac?  I get the same behavior as Augie when I
> > > > > > try this on OSX.  I'll be happy to try it again after the patch is
> > > > > > committed.
> > > > >
> > > > > Yes, this is a transcript from my Mac.
> > > >
> > > > Are you all using recent/current trunk versions? Could anything have
> > > > happened in the mean time?
> > >
> > > Did a HEAD build last night and I still get it on OSX.
> >
> > I still can't reproduce on my Mac, using HEAD.  Can you apply dlr's
> > proposed patch, see if it fixes the problem?
> 
> I applied Dan's patch and I still have the problem.  Other than
> changing the colors, I am just using the default OSX terminal.

We still need Dan's patch for other reasons, but it has nothing
to do with the problem.  I updated the issue yesterday with an
explanation of the problem, and how to fix it.

------- Additional comments from Eric Gillespie Tue Oct 2 17:20:15 -0700 2007 -------

This happens because the prompt goes to stderr while the error message
goes to stdout (bogus).  We need to change the rest of the prompt
callback to use svn_cmdline_fprintf(stderr).

As an aside, I don't see why this fails on Mac (isn't that where you
guys said you see this).  On sane systems, stdout is line-buffered
when connected to a tty, so the error message should have gone through
anyway (as it does on Linux).  I don't know why it's not, but that's
why adding the flush calls helped.  We have a separate change in
progress (from dlr) to force stderr/stdout to buffer the way we like,
though, so it doesn't really matter.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Mark Phippard <ma...@gmail.com>.
On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> On 10/3/07, Mark Phippard <ma...@gmail.com> wrote:
> > On 10/3/07, Erik Huelsmann <eh...@gmail.com> wrote:
> > > On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > > > On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> > > > > Did you try this on your Mac?  I get the same behavior as Augie when I
> > > > > try this on OSX.  I'll be happy to try it again after the patch is
> > > > > committed.
> > > >
> > > > Yes, this is a transcript from my Mac.
> > >
> > > Are you all using recent/current trunk versions? Could anything have
> > > happened in the mean time?
> >
> > Did a HEAD build last night and I still get it on OSX.
>
> I still can't reproduce on my Mac, using HEAD.  Can you apply dlr's
> proposed patch, see if it fixes the problem?

I applied Dan's patch and I still have the problem.  Other than
changing the colors, I am just using the default OSX terminal.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Ben Collins-Sussman <su...@red-bean.com>.
On 10/3/07, Mark Phippard <ma...@gmail.com> wrote:
> On 10/3/07, Erik Huelsmann <eh...@gmail.com> wrote:
> > On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > > On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> > > > Did you try this on your Mac?  I get the same behavior as Augie when I
> > > > try this on OSX.  I'll be happy to try it again after the patch is
> > > > committed.
> > >
> > > Yes, this is a transcript from my Mac.
> >
> > Are you all using recent/current trunk versions? Could anything have
> > happened in the mean time?
>
> Did a HEAD build last night and I still get it on OSX.

I still can't reproduce on my Mac, using HEAD.  Can you apply dlr's
proposed patch, see if it fixes the problem?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Mark Phippard <ma...@gmail.com>.
On 10/3/07, Erik Huelsmann <eh...@gmail.com> wrote:
> On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> > > Did you try this on your Mac?  I get the same behavior as Augie when I
> > > try this on OSX.  I'll be happy to try it again after the patch is
> > > committed.
> >
> > Yes, this is a transcript from my Mac.
>
> Are you all using recent/current trunk versions? Could anything have
> happened in the mean time?

Did a HEAD build last night and I still get it on OSX.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Erik Huelsmann <eh...@gmail.com>.
On 10/3/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> >
> > > Conflict discovered in 'cvs2cl.pl'.
> > > Select: (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > > and no 'editor-cmd' run-time configuration option was foundSelect:
> > > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > > and no 'editor-cmd' run-time configuration option was foundSelect:
> > > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > > and no 'editor-cmd' run-time configuration option was foundSelect:
> > > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> >
> > Did you try this on your Mac?  I get the same behavior as Augie when I
> > try this on OSX.  I'll be happy to try it again after the patch is
> > committed.
>
> Yes, this is a transcript from my Mac.

Are you all using recent/current trunk versions? Could anything have
happened in the mean time?

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Ben Collins-Sussman <su...@red-bean.com>.
On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
>
> > Conflict discovered in 'cvs2cl.pl'.
> > Select: (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > and no 'editor-cmd' run-time configuration option was foundSelect:
> > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > and no 'editor-cmd' run-time configuration option was foundSelect:
> > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > and no 'editor-cmd' run-time configuration option was foundSelect:
> > (p)ostpone, (d)iff, (e)dit, (h)elp : e
>
> Did you try this on your Mac?  I get the same behavior as Augie when I
> try this on OSX.  I'll be happy to try it again after the patch is
> committed.

Yes, this is a transcript from my Mac.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Mark Phippard <ma...@gmail.com>.
On 10/2/07, Eric Gillespie <ep...@google.com> wrote:
> "Mark Phippard" <ma...@gmail.com> writes:
>
> > On 10/2/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > > On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> > > > On 10/2/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > > > > This patch looks pretty good to me.  Can you commit it, and see if it
> > > > > resolves the weird behavior that Mark was seeing?
> > > >
> > > > I was not seeing this, a user on the merge tracking forums reported it.
> > > >
> > > > Is it not easy to reproduce?  I could get more info but I assumed
> > > > anyone without the environment variables set could reproduce it.
> > > >
> > >
> > > I know that Augie reported a similar bug when expermenting with his
> > > 'external merge tool' patch, but I can't reproduce the problem myself.
> > >  When I unset $EDITOR, I see the error message after each time I press
> > > "e" on a conflict:
> > >
> > > Conflict discovered in 'cvs2cl.pl'.
> > > Select: (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > > and no 'editor-cmd' run-time configuration option was foundSelect:
> > > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > > and no 'editor-cmd' run-time configuration option was foundSelect:
> > > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > > and no 'editor-cmd' run-time configuration option was foundSelect:
> > > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> >
> > Did you try this on your Mac?  I get the same behavior as Augie when I
> > try this on OSX.  I'll be happy to try it again after the patch is
> > committed.
>
> Can someone say what the behavior actually is?  Or point me to
> some previous thread...
>

http://subversion.tigris.org/issues/show_bug.cgi?id=2950

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Eric Gillespie <ep...@google.com>.
"Mark Phippard" <ma...@gmail.com> writes:

> On 10/2/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> > > On 10/2/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > > > This patch looks pretty good to me.  Can you commit it, and see if it
> > > > resolves the weird behavior that Mark was seeing?
> > >
> > > I was not seeing this, a user on the merge tracking forums reported it.
> > >
> > > Is it not easy to reproduce?  I could get more info but I assumed
> > > anyone without the environment variables set could reproduce it.
> > >
> >
> > I know that Augie reported a similar bug when expermenting with his
> > 'external merge tool' patch, but I can't reproduce the problem myself.
> >  When I unset $EDITOR, I see the error message after each time I press
> > "e" on a conflict:
> >
> > Conflict discovered in 'cvs2cl.pl'.
> > Select: (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > and no 'editor-cmd' run-time configuration option was foundSelect:
> > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > and no 'editor-cmd' run-time configuration option was foundSelect:
> > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> > None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> > and no 'editor-cmd' run-time configuration option was foundSelect:
> > (p)ostpone, (d)iff, (e)dit, (h)elp : e
> 
> Did you try this on your Mac?  I get the same behavior as Augie when I
> try this on OSX.  I'll be happy to try it again after the patch is
> committed.

Can someone say what the behavior actually is?  Or point me to
some previous thread...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Mark Phippard <ma...@gmail.com>.
On 10/2/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> > On 10/2/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > > This patch looks pretty good to me.  Can you commit it, and see if it
> > > resolves the weird behavior that Mark was seeing?
> >
> > I was not seeing this, a user on the merge tracking forums reported it.
> >
> > Is it not easy to reproduce?  I could get more info but I assumed
> > anyone without the environment variables set could reproduce it.
> >
>
> I know that Augie reported a similar bug when expermenting with his
> 'external merge tool' patch, but I can't reproduce the problem myself.
>  When I unset $EDITOR, I see the error message after each time I press
> "e" on a conflict:
>
> Conflict discovered in 'cvs2cl.pl'.
> Select: (p)ostpone, (d)iff, (e)dit, (h)elp : e
> None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> and no 'editor-cmd' run-time configuration option was foundSelect:
> (p)ostpone, (d)iff, (e)dit, (h)elp : e
> None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> and no 'editor-cmd' run-time configuration option was foundSelect:
> (p)ostpone, (d)iff, (e)dit, (h)elp : e
> None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
> and no 'editor-cmd' run-time configuration option was foundSelect:
> (p)ostpone, (d)iff, (e)dit, (h)elp : e

Did you try this on your Mac?  I get the same behavior as Augie when I
try this on OSX.  I'll be happy to try it again after the patch is
committed.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Ben Collins-Sussman <su...@red-bean.com>.
On 10/2/07, Mark Phippard <ma...@gmail.com> wrote:
> On 10/2/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> > This patch looks pretty good to me.  Can you commit it, and see if it
> > resolves the weird behavior that Mark was seeing?
>
> I was not seeing this, a user on the merge tracking forums reported it.
>
> Is it not easy to reproduce?  I could get more info but I assumed
> anyone without the environment variables set could reproduce it.
>

I know that Augie reported a similar bug when expermenting with his
'external merge tool' patch, but I can't reproduce the problem myself.
 When I unset $EDITOR, I see the error message after each time I press
"e" on a conflict:

Conflict discovered in 'cvs2cl.pl'.
Select: (p)ostpone, (d)iff, (e)dit, (h)elp : e
None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
and no 'editor-cmd' run-time configuration option was foundSelect:
(p)ostpone, (d)iff, (e)dit, (h)elp : e
None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
and no 'editor-cmd' run-time configuration option was foundSelect:
(p)ostpone, (d)iff, (e)dit, (h)elp : e
None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set,
and no 'editor-cmd' run-time configuration option was foundSelect:
(p)ostpone, (d)iff, (e)dit, (h)elp : e
...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Mark Phippard <ma...@gmail.com>.
On 10/2/07, Ben Collins-Sussman <su...@red-bean.com> wrote:
> This patch looks pretty good to me.  Can you commit it, and see if it
> resolves the weird behavior that Mark was seeing?

I was not seeing this, a user on the merge tracking forums reported it.

Is it not easy to reproduce?  I could get more info but I assumed
anyone without the environment variables set could reproduce it.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Ben Collins-Sussman <su...@red-bean.com>.
This patch looks pretty good to me.  Can you commit it, and see if it
resolves the weird behavior that Mark was seeing?

On 10/1/07, Daniel L. Rall <dl...@finemaltcoding.com> wrote:
> On Mon, 01 Oct 2007, Eric Gillespie wrote:
>
> > Jack Repenning <jr...@collab.net> writes:
> >
> > > On Oct 1, 2007, at 6:32 PM, Eric Gillespie wrote:
> > >
> > > > I advocate setting line buffering in
> > > > svn_cmdline_init, something like:
> > > >
> > > >   setvbuf(stderr, NULL, _IOLBF, 0);
> > > >   setvbuf(stdout, NULL, _IOLBF, 0);
> > >
> > > +1 on stdout.  But isn't stderr ordinarily character-buffered, for
> > > reasons having to do with ensuring you can report program crash even
> > > if the crash is because you can't allocate a line buffer to report it?
> >
> > When connected to a tty, yes; good catch.  We should use _IONBF
> > for stderr.
>
> Patch attached.  Rather than operating on stderr, svn_cmdline_init()
> takes an ERROR_STREAM parameter.  Return values from setvbuf() appear
> to be best-off ignored, I suppose.
> --
>
> Daniel Rall
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
On Mon, 01 Oct 2007, Eric Gillespie wrote:

> Jack Repenning <jr...@collab.net> writes:
> 
> > On Oct 1, 2007, at 6:32 PM, Eric Gillespie wrote:
> > 
> > > I advocate setting line buffering in
> > > svn_cmdline_init, something like:
> > >
> > >   setvbuf(stderr, NULL, _IOLBF, 0);
> > >   setvbuf(stdout, NULL, _IOLBF, 0);
> > 
> > +1 on stdout.  But isn't stderr ordinarily character-buffered, for  
> > reasons having to do with ensuring you can report program crash even  
> > if the crash is because you can't allocate a line buffer to report it?
> 
> When connected to a tty, yes; good catch.  We should use _IONBF
> for stderr.

Patch attached.  Rather than operating on stderr, svn_cmdline_init()
takes an ERROR_STREAM parameter.  Return values from setvbuf() appear
to be best-off ignored, I suppose.
-- 

Daniel Rall

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Eric Gillespie <ep...@google.com>.
Jack Repenning <jr...@collab.net> writes:

> On Oct 1, 2007, at 6:32 PM, Eric Gillespie wrote:
> 
> > I advocate setting line buffering in
> > svn_cmdline_init, something like:
> >
> >   setvbuf(stderr, NULL, _IOLBF, 0);
> >   setvbuf(stdout, NULL, _IOLBF, 0);
> 
> +1 on stdout.  But isn't stderr ordinarily character-buffered, for  
> reasons having to do with ensuring you can report program crash even  
> if the crash is because you can't allocate a line buffer to report it?

When connected to a tty, yes; good catch.  We should use _IONBF
for stderr.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Jack Repenning <jr...@collab.net>.
On Oct 1, 2007, at 6:32 PM, Eric Gillespie wrote:

> I advocate setting line buffering in
> svn_cmdline_init, something like:
>
>   setvbuf(stderr, NULL, _IOLBF, 0);
>   setvbuf(stdout, NULL, _IOLBF, 0);

+1 on stdout.  But isn't stderr ordinarily character-buffered, for  
reasons having to do with ensuring you can report program crash even  
if the crash is because you can't allocate a line buffer to report it?

-==-
Jack Repenning
Chief Technology Officer
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
office: +1 650.228.2562
mobile: +1 408.835.8090
raindance: +1 877.326.2337, x844.7461
aim: jackrepenning
skype: jrepenning




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2950] New - Weird prompting to resolve conflicts when EDITOR is not defined

Posted by Eric Gillespie <ep...@pretzelnet.org>.
"Ben Collins-Sussman" <su...@red-bean.com> writes:

> Guys, I have a patch to fix this problem (attached) which just adds
> svn_cmdline_fflush() after every call to svn_cmdline_printf() within
> in the interactive conflict loop.
> 
> It seems sort of hacky to me though.  epg was thinking that maybe we
> should change svn_cmdline_printf() to automatically fflush() if the
> incoming string ends with \n.  What do people think?

I thought that until I found out they're just using stdio, not
APR foo.  In that case, I advocate setting line buffering in
svn_cmdline_init, something like:

  setvbuf(stderr, NULL, _IOLBF, 0);
  setvbuf(stdout, NULL, _IOLBF, 0);

This prompt stuff isn't the only stuff to have the problem, and
the problem isn't new.  Any poor schmuck who does

  svn foo > log 2>&1 &
  tail -f log

is annoyed that status comes through in 8K chunks.  I am
frequently that schmuck ;->.  So, doing it in either
svn_cmdline_fputs or svn_cmdline_init (better) will save a bunch
of flushing all over the place.

-- 
Eric Gillespie <*> epg@pretzelnet.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org