Mercurial > hg > mercurial
view mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/HgSubrepoConfigChange.java @ 596:a37960e1f0a0
Log stderr when hg command fails to ease troubleshooting
author | Dmitry Neverov <dmitry.neverov@jetbrains.com> |
---|---|
date | Mon, 29 Apr 2013 14:23:20 +0400 |
parents | 6c8911ed66f2 |
children | d1469a7cc038 |
line wrap: on
line source
package jetbrains.buildServer.buildTriggers.vcs.mercurial; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; import static java.util.Arrays.asList; /** * A change in subrepo configuration */ public class HgSubrepoConfigChange { private final String myPath; private final SubRepo myCurrent; private final List<SubRepo> myPrevious; public HgSubrepoConfigChange(@NotNull String path, @Nullable SubRepo previous, @Nullable SubRepo current) { this(path, previous != null ? asList(previous) : new ArrayList<SubRepo>(), current); } public HgSubrepoConfigChange(@NotNull String path, @NotNull List<SubRepo> previous, @Nullable SubRepo current) { myPath = path; myPrevious = previous; myCurrent = current; } @NotNull public String getPath() { return myPath; } @NotNull public List<SubRepo> getPrevious() { return myPrevious; } public SubRepo getCurrent() { return myCurrent; } public boolean subrepoRemoved() { return myCurrent == null && !myPrevious.isEmpty(); } public boolean subrepoAdded() { return myCurrent != null && myPrevious.isEmpty(); } public boolean subrepoUrlChanged() { if (myCurrent == null) return false; if (myPrevious.isEmpty()) return false; for (SubRepo sr : myPrevious) { if (!myCurrent.url().equals(sr.url())) return true; } return false; } }