changeset 123:62fe3e69cee6

Use VcsManager to find all mercurial roots
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Fri, 24 Sep 2010 19:45:30 +0400
parents 20cfe50e3b81
children 9123ad25b082
files mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java
diffstat 1 files changed, 5 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Fri Sep 24 19:35:07 2010 +0400
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Fri Sep 24 19:45:30 2010 +0400
@@ -24,8 +24,6 @@
 import jetbrains.buildServer.util.EventDispatcher;
 import jetbrains.buildServer.util.FileUtil;
 import jetbrains.buildServer.util.StringUtil;
-import jetbrains.buildServer.util.filters.Filter;
-import jetbrains.buildServer.util.filters.FilterUtil;
 import jetbrains.buildServer.vcs.*;
 import jetbrains.buildServer.vcs.patches.PatchBuilder;
 import org.jetbrains.annotations.NotNull;
@@ -547,14 +545,8 @@
     }
   }
 
-  private Collection<VcsRoot> getMercurialVcsRoots() {
-    List<VcsRoot> res = new ArrayList<VcsRoot>(myVcsManager.getAllRegisteredVcsRoots());
-    FilterUtil.filterCollection(res, new Filter<VcsRoot>() {
-      public boolean accept(@NotNull final VcsRoot data) {
-        return getName().equals(data.getVcsName());
-      }
-    });
-    return res;
+  private Collection<? extends SVcsRoot> getMercurialVcsRoots() {
+    return myVcsManager.findRootsByVcsName(getName());
   }
 
   @Nullable
@@ -603,9 +595,9 @@
   private String fixTagName(final String label) {
     // according to Mercurial documentation http://hgbook.red-bean.com/hgbookch8.html#x12-1570008
     // tag name must not contain:
-    // Colon (ASCII 58, :)
-    // Carriage return (ASCII 13, \r)
-    // Newline (ASCII 10, \n)
+    // Colon (ASCII 58, �:�)
+    // Carriage return (ASCII 13, �\r�)
+    // Newline (ASCII 10, �\n�)
     // all these characters will be replaced with _ (underscore)
     return label.replace(':', '_').replace('\r', '_').replace('\n', '_');
   }