You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/11/12 13:27:46 UTC
svn commit: r1714028 - in /subversion/branches/move-tracking-2: ./
subversion/libsvn_subr/ subversion/libsvn_subr/linenoise/
subversion/svnmover/ subversion/svnmover/linenoise/
Author: julianfoad
Date: Thu Nov 12 12:27:45 2015
New Revision: 1714028
URL: http://svn.apache.org/viewvc?rev=1714028&view=rev
Log:
On the 'move-tracking-2' branch: Move the 'linenoise' command-line input and
completion library from libsvn_subr into 'svnmover', as it is not (yet)
needed by any other part of Subversion.
* build.conf
Track the move of the 'linenoise' library files.
* subversion/libsvn_subr/prompt.c
(svn_cmdline_prompt_user2): Remove the linenoise' code from here.
* subversion/libsvn_subr/linenoise
Move from here...
* subversion/svnmover/linenoise
... to here.
* subversion/svnmover/svnmover.c
(read_words): Call svnmover_prompt_user() instead of
svn_cmdline_prompt_user2().
* subversion/svnmover/svnmover.h
(svnmover_prompt_user): New.
* subversion/svnmover/util.c
New file.
Include 'linenoise/linenoise.c' in order to build it.
(svnmover_prompt_user): New, moved out of svn_cmdline_prompt_user2().
Added:
subversion/branches/move-tracking-2/subversion/svnmover/linenoise/
- copied from r1714027, subversion/branches/move-tracking-2/subversion/libsvn_subr/linenoise/
subversion/branches/move-tracking-2/subversion/svnmover/util.c (with props)
Removed:
subversion/branches/move-tracking-2/subversion/libsvn_subr/linenoise/
Modified:
subversion/branches/move-tracking-2/build.conf
subversion/branches/move-tracking-2/subversion/libsvn_subr/prompt.c
subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h
Modified: subversion/branches/move-tracking-2/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/build.conf?rev=1714028&r1=1714027&r2=1714028&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/build.conf (original)
+++ subversion/branches/move-tracking-2/build.conf Thu Nov 12 12:27:45 2015
@@ -45,8 +45,8 @@ private-includes =
subversion/bindings/cxxhl/src/private/*.hpp
subversion/bindings/javahl/native/*.hpp
subversion/bindings/javahl/native/jniwrapper/jni_*.hpp
- subversion/libsvn_subr/linenoise/linenoise.h
- subversion/libsvn_subr/linenoise/linenoise.c
+ subversion/svnmover/linenoise/linenoise.h
+ subversion/svnmover/linenoise/linenoise.c
subversion/libsvn_subr/utf8proc/utf8proc.h
subversion/libsvn_subr/utf8proc/utf8proc.c
subversion/libsvn_subr/utf8proc/utf8proc_data.c
Modified: subversion/branches/move-tracking-2/subversion/libsvn_subr/prompt.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_subr/prompt.c?rev=1714028&r1=1714027&r2=1714028&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_subr/prompt.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_subr/prompt.c Thu Nov 12 12:27:45 2015
@@ -48,11 +48,6 @@
#include <termios.h>
#endif
-#define HAVE_LINENOISE
-#ifdef HAVE_LINENOISE
-#include "linenoise/linenoise.c"
-#endif
-
/* Descriptor of an open terminal */
@@ -930,28 +925,10 @@ svn_cmdline_prompt_user2(const char **re
svn_cmdline_prompt_baton_t *baton,
apr_pool_t *pool)
{
-#ifdef HAVE_LINENOISE
- char *input;
-
- input = linenoise(prompt_str);
- if (! input)
- {
- return svn_error_create(SVN_ERR_CANCELLED, NULL, NULL);
- }
- /* add the line to the recallable history (if non-empty) */
- if (input && *input)
- {
- linenoiseHistoryAdd(input);
- }
- *result = apr_pstrdup(pool, input);
- free(input);
- return SVN_NO_ERROR;
-#else
/* XXX: We know prompt doesn't use the new members
* of svn_cmdline_prompt_baton2_t. */
return prompt(result, prompt_str, FALSE /* don't hide input */,
(svn_cmdline_prompt_baton2_t *)baton, pool);
-#endif
}
/* This implements 'svn_auth_gnome_keyring_unlock_prompt_func_t'. */
Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1714028&r1=1714027&r2=1714028&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Thu Nov 12 12:27:45 2015
@@ -57,7 +57,7 @@
#define HAVE_LINENOISE
#ifdef HAVE_LINENOISE
-#include "../libsvn_subr/linenoise/linenoise.h"
+#include "linenoise/linenoise.h"
#endif
/* Version compatibility check */
@@ -3535,7 +3535,7 @@ read_words(apr_array_header_t **words,
const char *input;
settext(TEXT_FG_YELLOW);
- err = svn_cmdline_prompt_user2(&input, prompt, NULL, result_pool);
+ err = svnmover_prompt_user(&input, prompt, result_pool);
settext(TEXT_RESET);
if (err && (err->apr_err == SVN_ERR_CANCELLED || err->apr_err == APR_EOF))
{
Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h?rev=1714028&r1=1714027&r2=1714028&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h Thu Nov 12 12:27:45 2015
@@ -28,6 +28,7 @@
#define SVNMOVER_H
#include "svn_types.h"
+#include "svn_client.h"
#include "svn_ra.h"
#include "private/svn_branch.h"
@@ -53,6 +54,15 @@ extern "C" {
apr_hash_merge(apr_hash_pool_get(overlay), h1, h2, merger, data)
+/* Display PROMPT_STR, read a line of text, and set *RESULT to that line.
+ *
+ * The interface here is similar to svn_cmdline_prompt_user2().
+ */
+svn_error_t *
+svnmover_prompt_user(const char **result,
+ const char *prompt_str,
+ apr_pool_t *pool);
+
/* Print a notification. */
__attribute__((format(printf, 1, 2)))
void
Added: subversion/branches/move-tracking-2/subversion/svnmover/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/util.c?rev=1714028&view=auto
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/util.c (added)
+++ subversion/branches/move-tracking-2/subversion/svnmover/util.c Thu Nov 12 12:27:45 2015
@@ -0,0 +1,54 @@
+/*
+ * util.c: Utility functions for 'svnmover'
+ *
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ */
+
+#include "svnmover.h"
+
+#define HAVE_LINENOISE
+#ifdef HAVE_LINENOISE
+#include "linenoise/linenoise.c"
+#endif
+
+
+svn_error_t *
+svnmover_prompt_user(const char **result,
+ const char *prompt_str,
+ apr_pool_t *pool)
+{
+ char *input;
+
+ input = linenoise(prompt_str);
+ if (! input)
+ {
+ return svn_error_create(SVN_ERR_CANCELLED, NULL, NULL);
+ }
+ /* add the line to the recallable history (if non-empty) */
+ if (input && *input)
+ {
+ linenoiseHistoryAdd(input);
+ }
+ *result = apr_pstrdup(pool, input);
+ free(input);
+ return SVN_NO_ERROR;
+}
+
+
Propchange: subversion/branches/move-tracking-2/subversion/svnmover/util.c
------------------------------------------------------------------------------
svn:eol-style = native