You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Hyrum K Wright <hy...@hyrumwright.org> on 2011/02/21 13:18:19 UTC

Re: svn commit: r1072084 - /subversion/trunk/subversion/svn/util.c

On Fri, Feb 18, 2011 at 5:53 PM,  <da...@apache.org> wrote:
> Author: danielsh
> Date: Fri Feb 18 17:53:36 2011
> New Revision: 1072084
>
> URL: http://svn.apache.org/viewvc?rev=1072084&view=rev
> Log:
> * subversion/svn/util.c
>  (svn_cl__edit_string_externally):
>    Preserve the edit log message file if the editor exited non-zero.
>
> Review by: cmpilato
> Hindered by: irony
> (I committed this using a pre-this-patch svn, but Vim apparently
> exited non-zero (this happens sometimes) and the log message was lost...)

Will this also help the case where interactive conflict resolution
sometimes barfs on a non-zero vim exit?  (/me really hopes so...)

-Hyrum

>
> Modified:
>    subversion/trunk/subversion/svn/util.c
>
> Modified: subversion/trunk/subversion/svn/util.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/util.c?rev=1072084&r1=1072083&r2=1072084&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svn/util.c (original)
> +++ subversion/trunk/subversion/svn/util.c Fri Feb 18 17:53:36 2011
> @@ -438,11 +438,21 @@ svn_cl__edit_string_externally(svn_strin
>       goto cleanup;
>     }
>
> -  /* Now, run the editor command line.  */
> +  /* Prepare the editor command line.  */
>   err = svn_utf_cstring_from_utf8(&tmpfile_native, tmpfile_name, pool);
>   if (err)
>     goto cleanup;
>   cmd = apr_psprintf(pool, "%s %s", editor, tmpfile_native);
> +
> +  /* If the caller wants us to leave the file around, return the path
> +     of the file we'll use, and make a note not to destroy it.  */
> +  if (tmpfile_left)
> +    {
> +      *tmpfile_left = svn_dirent_join(base_dir, tmpfile_name, pool);
> +      remove_file = FALSE;
> +    }
> +
> +  /* Now, run the editor command line.  */
>   sys_err = system(cmd);
>   if (sys_err != 0)
>     {
> @@ -462,14 +472,6 @@ svn_cl__edit_string_externally(svn_strin
>       goto cleanup;
>     }
>
> -  /* If the caller wants us to leave the file around, return the path
> -     of the file we used, and make a note not to destroy it.  */
> -  if (tmpfile_left)
> -    {
> -      *tmpfile_left = svn_dirent_join(base_dir, tmpfile_name, pool);
> -      remove_file = FALSE;
> -    }
> -
>   /* If the file looks changed... */
>   if ((finfo_before.mtime != finfo_after.mtime) ||
>       (finfo_before.size != finfo_after.size))
>
>
>

Re: svn commit: r1072084 - /subversion/trunk/subversion/svn/util.c

Posted by Daniel Shahaf <da...@apache.org>.
Hyrum K Wright wrote on Mon, Feb 21, 2011 at 12:18:19 +0000:
> On Fri, Feb 18, 2011 at 5:53 PM,  <da...@apache.org> wrote:
> > Author: danielsh
> > Date: Fri Feb 18 17:53:36 2011
> > New Revision: 1072084
> >
> > URL: http://svn.apache.org/viewvc?rev=1072084&view=rev
> > Log:
> > * subversion/svn/util.c
> >  (svn_cl__edit_string_externally):
> >    Preserve the edit log message file if the editor exited non-zero.
> >
> > Review by: cmpilato
> > Hindered by: irony
> > (I committed this using a pre-this-patch svn, but Vim apparently
> > exited non-zero (this happens sometimes) and the log message was lost...)
> 
> Will this also help the case where interactive conflict resolution
> sometimes barfs on a non-zero vim exit?  (/me really hopes so...)
> 

No; that uses svn_cl__edit_file_externally().

> -Hyrum
> 
> >
> > Modified:
> >    subversion/trunk/subversion/svn/util.c
> >
> > Modified: subversion/trunk/subversion/svn/util.c
> > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/util.c?rev=1072084&r1=1072083&r2=1072084&view=diff
> > ==============================================================================
> > --- subversion/trunk/subversion/svn/util.c (original)
> > +++ subversion/trunk/subversion/svn/util.c Fri Feb 18 17:53:36 2011
> > @@ -438,11 +438,21 @@ svn_cl__edit_string_externally(svn_strin
> >       goto cleanup;
> >     }
> >
> > -  /* Now, run the editor command line.  */
> > +  /* Prepare the editor command line.  */
> >   err = svn_utf_cstring_from_utf8(&tmpfile_native, tmpfile_name, pool);
> >   if (err)
> >     goto cleanup;
> >   cmd = apr_psprintf(pool, "%s %s", editor, tmpfile_native);
> > +
> > +  /* If the caller wants us to leave the file around, return the path
> > +     of the file we'll use, and make a note not to destroy it.  */
> > +  if (tmpfile_left)
> > +    {
> > +      *tmpfile_left = svn_dirent_join(base_dir, tmpfile_name, pool);
> > +      remove_file = FALSE;
> > +    }
> > +
> > +  /* Now, run the editor command line.  */
> >   sys_err = system(cmd);
> >   if (sys_err != 0)
> >     {
> > @@ -462,14 +472,6 @@ svn_cl__edit_string_externally(svn_strin
> >       goto cleanup;
> >     }
> >
> > -  /* If the caller wants us to leave the file around, return the path
> > -     of the file we used, and make a note not to destroy it.  */
> > -  if (tmpfile_left)
> > -    {
> > -      *tmpfile_left = svn_dirent_join(base_dir, tmpfile_name, pool);
> > -      remove_file = FALSE;
> > -    }
> > -
> >   /* If the file looks changed... */
> >   if ((finfo_before.mtime != finfo_after.mtime) ||
> >       (finfo_before.size != finfo_after.size))
> >
> >
> >