You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2002/04/29 18:33:03 UTC

Re: svn commit: rev 1826 - trunk/subversion/clients/cmdline

daniel@tigris.org writes:

>    /* Now, run the editor command line.  Ignore the return values; all
>       we really care about (for now) is whether or not our tmpfile
>       contents have changed. */
> -  cmd_args[0] = editor;
> -  cmd_args[1] = tmpfile_name->data;
> -  SVN_ERR (svn_io_run_cmd (".", editor, cmd_args, &exit_code, &exit_why,
> -                           TRUE, NULL, NULL, NULL, pool));
> +  cmd = apr_psprintf (pool, "%s %s", editor, tmpfile_name->data);
> +
> +  system (cmd);

What? No checking of the return code?

-- 
Philip

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

Re: svn commit: rev 1826 - trunk/subversion/clients/cmdline

Posted by cm...@collab.net.
Justin Erenkrantz <je...@apache.org> writes:

> > > +  cmd = apr_psprintf (pool, "%s %s", editor, tmpfile_name->data);
> > > +
> > > +  system (cmd);
> > 
> > What? No checking of the return code?
> 
> Yeah, it should.  But, note that the return values are going to be
> WEXITSTATUSified.
>
> RETURN VALUE
>        The value returned is -1 on error (e.g. fork failed),  and
>        the  return  status of the command otherwise.  This latter
>        return status is  in  the  format  specified  in  wait(2).
>        Thus,  the  exit  code  of  the  command will be WEXITSTA­
>        TUS(status).  In case /bin/sh could not be  executed,  the
>        exit status will be that of a command that does exit(127).
> 
> I know that CVS detects when no log message is created and pops up
> the "abort, retry, fail" (not exactly) prompt.  We may be able to
> also do that when the editor fails to run.  (I forget what SVN
> does when there is no log message...)  -- justin

SVN should do the same, since it will see that no edits were made
between the time the EDITOR was supposed to have been launched and
time it returned (regardless of the return value).

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

Re: svn commit: rev 1826 - trunk/subversion/clients/cmdline

Posted by Justin Erenkrantz <je...@apache.org>.
On Mon, Apr 29, 2002 at 07:33:03PM +0100, Philip Martin wrote:
> daniel@tigris.org writes:
> 
> >    /* Now, run the editor command line.  Ignore the return values; all
> >       we really care about (for now) is whether or not our tmpfile
> >       contents have changed. */
> > -  cmd_args[0] = editor;
> > -  cmd_args[1] = tmpfile_name->data;
> > -  SVN_ERR (svn_io_run_cmd (".", editor, cmd_args, &exit_code, &exit_why,
> > -                           TRUE, NULL, NULL, NULL, pool));
> > +  cmd = apr_psprintf (pool, "%s %s", editor, tmpfile_name->data);
> > +
> > +  system (cmd);
> 
> What? No checking of the return code?

Yeah, it should.  But, note that the return values are going to be
WEXITSTATUSified.

RETURN VALUE
       The value returned is -1 on error (e.g. fork failed),  and
       the  return  status of the command otherwise.  This latter
       return status is  in  the  format  specified  in  wait(2).
       Thus,  the  exit  code  of  the  command will be WEXITSTA­
       TUS(status).  In case /bin/sh could not be  executed,  the
       exit status will be that of a command that does exit(127).

I know that CVS detects when no log message is created and pops up
the "abort, retry, fail" (not exactly) prompt.  We may be able to
also do that when the editor fails to run.  (I forget what SVN
does when there is no log message...)  -- justin

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