diff options
Diffstat (limited to 'plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepoInfo.java')
-rw-r--r-- | plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepoInfo.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepoInfo.java b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepoInfo.java index f73375f9c791..55efa0b43418 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepoInfo.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepoInfo.java @@ -34,6 +34,7 @@ public class HgRepoInfo { @NotNull private Set<HgNameWithHashInfo> myBookmarks = Collections.emptySet(); @NotNull private Set<HgNameWithHashInfo> myTags = Collections.emptySet(); @NotNull private Set<HgNameWithHashInfo> myLocalTags = Collections.emptySet(); + @NotNull Set<HgNameWithHashInfo> mySubrepos = Collections.emptySet(); public HgRepoInfo(@NotNull String currentBranch, @Nullable String currentRevision, @@ -43,7 +44,7 @@ public class HgRepoInfo { @NotNull Collection<HgNameWithHashInfo> bookmarks, @Nullable String currentBookmark, @NotNull Collection<HgNameWithHashInfo> tags, - @NotNull Collection<HgNameWithHashInfo> localTags) { + @NotNull Collection<HgNameWithHashInfo> localTags, @NotNull Collection<HgNameWithHashInfo> subrepos) { myCurrentBranch = currentBranch; myCurrentRevision = currentRevision; myTipRevision = currentTipRevision; @@ -53,6 +54,7 @@ public class HgRepoInfo { myCurrentBookmark = currentBookmark; myTags = new LinkedHashSet<HgNameWithHashInfo>(tags); myLocalTags = new LinkedHashSet<HgNameWithHashInfo>(localTags); + mySubrepos = new HashSet<HgNameWithHashInfo>(subrepos); } @NotNull @@ -116,6 +118,7 @@ public class HgRepoInfo { if (!myBookmarks.equals(info.myBookmarks)) return false; if (!myTags.equals(info.myTags)) return false; if (!myLocalTags.equals(info.myLocalTags)) return false; + if (!mySubrepos.equals(info.mySubrepos)) return false; return true; } @@ -123,7 +126,7 @@ public class HgRepoInfo { @Override public int hashCode() { return Objects.hashCode(myCurrentBranch, myCurrentRevision, myTipRevision, myCurrentBookmark, myState, myBranches, myBookmarks, myTags, - myLocalTags); + myLocalTags, mySubrepos); } @Override @@ -132,4 +135,13 @@ public class HgRepoInfo { return String.format("HgRepository{myCurrentBranch=%s, myCurrentRevision='%s', myState=%s}", myCurrentBranch, myCurrentRevision, myState); } + + public boolean hasSubrepos() { + return !mySubrepos.isEmpty(); + } + + @NotNull + public Collection<HgNameWithHashInfo> getSubrepos() { + return mySubrepos; + } } |