changeset 699:fbff229ee2dc

add 'files' for log command
author eugene.petrenko@jetbrains.com
date Fri, 03 Jan 2014 14:37:04 +0100
parents 68251dea7eae
children a9adc3daf252
files mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/LogCommand.java
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/LogCommand.java	Fri Jan 03 14:04:09 2014 +0100
+++ b/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/LogCommand.java	Fri Jan 03 14:37:04 2014 +0100
@@ -28,10 +28,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.nio.charset.Charset;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 public class LogCommand extends VcsRootCommand {
 
@@ -47,6 +44,7 @@
   private boolean myCalculateParents = true;
   private String myRevsets;
   private File myTemplate;
+  private List<String> myFiles = new ArrayList<String>();
 
   public LogCommand(@NotNull CommandSettings commandSettings,
                     @NotNull String hgPath,
@@ -100,6 +98,11 @@
     return this;
   }
 
+  public LogCommand forFile(@NotNull final String file) {
+    myFiles.add(file);
+    return this;
+  }
+
   public List<ChangeSet> call() throws VcsException {
     MercurialCommandLine cli = createCommandLine();
     cli.setCharset(Charset.forName("UTF-8"));
@@ -125,6 +128,8 @@
       cli.addParameter(myLimit.toString());
     }
 
+    cli.addParameters(myFiles);
+
     CommandResult res = runCommand(cli);
     String output = res.getStdout();
     try {