Author: rohini
Date: Wed Mar  1 22:20:47 2017
New Revision: 1785056

URL: http://svn.apache.org/viewvc?rev=1785056&view=rev
Log:
PIG-5159: Fix Pig not saving grunt history (szita via rohini)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java

Modified: pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1785056&r1=1785055&r2=1785056&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Wed Mar  1 22:20:47 2017
@@ -89,6 +89,8 @@ OPTIMIZATIONS
  
 BUG FIXES
 
+PIG-5159: Fix Pig not saving grunt history (szita via rohini)
+
 PIG-5127: Test fail when running test-core-mrtez (daijy)
 
 PIG-5083: CombinerPackager and LitePackager should not materialize bags 
(rohini)

Modified: pig/trunk/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java
URL: 
http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java?rev=1785056&r1=1785055&r2=1785056&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java 
(original)
+++ pig/trunk/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java Wed 
Mar  1 22:20:47 2017
@@ -23,6 +23,7 @@ import java.io.SequenceInputStream;
 import java.util.Enumeration;
 
 import jline.console.ConsoleReader;
+import jline.console.history.FileHistory;
 
 /** Borrowed from jline.console.internal.ConsoleReaderInputStream. However,
  *  we cannot use ConsoleReaderInputStream directly since:
@@ -104,6 +105,9 @@ public class ConsoleReaderInputStream ex
 
             if (buffer == null) {
                 buffer = reader.readLine().getBytes();
+
+                //Write current grunt buffer to pig history file
+                ((FileHistory)reader.getHistory()).flush();
             }
 
             if (buffer == null) {


Reply via email to