Coverage Report - com.aragost.javahg.internals.GenericLogCommand
 
Classes in this File Line Coverage Branch Coverage Complexity
GenericLogCommand
100%
8/8
N/A
1
 
 1  
 package com.aragost.javahg.internals;
 2  
 
 3  
 import com.aragost.javahg.Repository;
 4  
 import com.aragost.javahg.commands.LogCommand;
 5  
 
 6  
 /**
 7  
  * A generic log command where the client is responsible to consume
 8  
  * the output from the command server.
 9  
  */
 10  
 public class GenericLogCommand extends LogCommand {
 11  
 
 12  
     public GenericLogCommand(Repository repository) {
 13  27
         super(repository, null);
 14  27
     }
 15  
 
 16  
     /**
 17  
      * Specify style to use
 18  
      * 
 19  
      * @param style
 20  
      * @return this instance
 21  
      */
 22  
     public GenericLogCommand style(String style) {
 23  12
         cmdAppend("--style", pathToStyle(style));
 24  12
         return this;
 25  
     }
 26  
 
 27  
     /**
 28  
      * Specify template to use
 29  
      * 
 30  
      * @param template
 31  
      * @return this instance
 32  
      */
 33  
     public GenericLogCommand template(String template) {
 34  15
         cmdAppend("--template", template);
 35  15
         return this;
 36  
     }
 37  
 
 38  
     private String pathToStyle(String style) {
 39  12
         return Utils.resourceAsFile("/styles/" + style + ".style").getAbsolutePath();
 40  
     }
 41  
 
 42  
     public HgInputStream stream(String... args) {
 43  27
         return launchStream(args);
 44  
     }
 45  
 
 46  
 }