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...)
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))