tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [1/3] incubator-tinkerpop git commit: Fixed bug where some scripts weren't submitting with :>
Date Wed, 30 Mar 2016 17:58:35 GMT
Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 5177109be -> 4626ed02a


Fixed bug where some scripts weren't submitting with :>

The issue had to do with all scripts being converted to multi-line which was necessary for
remote requests in console mode.  However in local mode :> commands don't accept multiple
lines. Had to rectify that by assembling multi-line scripts in GremlinGroovysh instead of
DriverRemoteAcceptor. CTR


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/92f61576
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/92f61576
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/92f61576

Branch: refs/heads/master
Commit: 92f61576d51c95167c99b3cf505bfe155bb45c4b
Parents: 3b053ea
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Wed Mar 30 13:51:37 2016 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Wed Mar 30 13:55:14 2016 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy | 5 ++++-
 .../gremlin/console/groovy/plugin/DriverRemoteAcceptor.java     | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/92f61576/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
index 0cbd500..31a8ba8 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
@@ -21,6 +21,7 @@ package org.apache.tinkerpop.gremlin.console
 import org.codehaus.groovy.tools.shell.Command
 import org.codehaus.groovy.tools.shell.Groovysh
 import org.codehaus.groovy.tools.shell.ParseCode
+import org.codehaus.groovy.tools.shell.Parser
 
 /**
  * Overrides the posix style parsing of Groovysh allowing for commands to parse prior to
Groovy 2.4.x.
@@ -84,7 +85,9 @@ class GremlinGroovysh extends Groovysh {
 
             switch (status.code) {
                 case ParseCode.COMPLETE:
-                    setLastResult(mediator.currentRemote().submit(current))
+                    // concat script here because commands don't support multi-line
+                    def script = String.join(Parser.getNEWLINE(), current)
+                    setLastResult(mediator.currentRemote().submit([script]))
                     buffers.clearSelected()
                     break
                 case ParseCode.INCOMPLETE:

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/92f61576/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
index 7733524..c92d5b3 100644
--- a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
+++ b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
@@ -138,7 +138,7 @@ public class DriverRemoteAcceptor implements RemoteAcceptor {
 
     @Override
     public Object submit(final List<String> args) throws RemoteException {
-        final String line = RemoteAcceptor.getScript(String.join(Parser.getNEWLINE(), args),
this.shell);
+        final String line = RemoteAcceptor.getScript(String.join(" ", args), this.shell);
 
         try {
             final List<Result> resultSet = send(line);


Mime
View raw message