2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.jetbrains
.idea
.svn
.dialogs
;
18 import com
.intellij
.openapi
.vfs
.VirtualFile
;
19 import org
.jetbrains
.idea
.svn
.WorkingCopyFormat
;
20 import org
.tmatesoft
.svn
.core
.SVNURL
;
21 import org
.tmatesoft
.svn
.core
.internal
.util
.SVNPathUtil
;
23 import java
.util
.List
;
25 public class WCInfoWithBranches
extends WCInfo
{
26 private final List
<Branch
> myBranches
;
27 private final VirtualFile myRoot
;
28 private final String myTrunkRoot
;
30 public WCInfoWithBranches(final String path
, final SVNURL url
, final WorkingCopyFormat format
, final String repositoryRoot
, final boolean isWcRoot
,
31 final List
<Branch
> branches
,
32 final VirtualFile root
,
33 final String trunkToot
) {
34 super(path
, url
, format
, repositoryRoot
, isWcRoot
);
35 myBranches
= branches
;
37 myTrunkRoot
= trunkToot
;
40 // to be used in combo
42 public String
toString() {
47 public VirtualFile
getVcsRoot() {
51 public List
<Branch
> getBranches() {
55 public VirtualFile
getRoot() {
59 public String
getTrunkRoot() {
63 public static class Branch
{
64 private final String myName
;
65 private final String myUrl
;
67 public Branch(final String url
) {
68 myName
= SVNPathUtil
.tail(url
);
72 public String
getName() {
76 public String
getUrl() {
81 public String
toString() {
86 public boolean equals(final Object o
) {
87 if (this == o
) return true;
88 if (o
== null || getClass() != o
.getClass()) return false;
90 final Branch branch
= (Branch
)o
;
92 if (myUrl
!= null ?
!myUrl
.equals(branch
.myUrl
) : branch
.myUrl
!= null) return false;
98 public int hashCode() {
99 return (myUrl
!= null ? myUrl
.hashCode() : 0);