- if (todo_list_write_to_file(r, todo_list, todo_file,
- shortrevisions, shortonto, -1,
- flags | TODO_LIST_SHORTEN_IDS | TODO_LIST_APPEND_TODO_HELP))
- return error_errno(_("could not write '%s'"), todo_file);
-
- if (copy_file(rebase_path_todo_backup(), todo_file, 0666))
- return error(_("could not copy '%s' to '%s'."), todo_file,
- rebase_path_todo_backup());
-
- if (launch_sequence_editor(todo_file, &new_todo.buf, NULL)) {
+ res = edit_todo_list(r, todo_list, &new_todo, shortrevisions,
+ shortonto, flags);
+ if (res == -1)
+ return -1;
+ else if (res == -2) {