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
.NestedCopyType
;
20 import org
.jetbrains
.idea
.svn
.WorkingCopyFormat
;
21 import org
.tmatesoft
.svn
.core
.SVNURL
;
22 import org
.tmatesoft
.svn
.core
.internal
.util
.SVNPathUtil
;
24 import java
.util
.List
;
26 public class WCInfoWithBranches
extends WCInfo
{
27 private final List
<Branch
> myBranches
;
28 private final VirtualFile myRoot
;
29 private final String myTrunkRoot
;
31 public WCInfoWithBranches(final String path
, final SVNURL url
, final WorkingCopyFormat format
, final String repositoryRoot
, final boolean isWcRoot
,
32 final List
<Branch
> branches
,
33 final VirtualFile root
,
34 final String trunkToot
,
35 final NestedCopyType type
) {
36 super(path
, url
, format
, repositoryRoot
, isWcRoot
, type
);
37 myBranches
= branches
;
39 myTrunkRoot
= trunkToot
;
42 // to be used in combo
44 public String
toString() {
49 public VirtualFile
getVcsRoot() {
53 public List
<Branch
> getBranches() {
57 public VirtualFile
getRoot() {
61 public String
getTrunkRoot() {
65 public static class Branch
{
66 private final String myName
;
67 private final String myUrl
;
69 public Branch(final String url
) {
70 myName
= SVNPathUtil
.tail(url
);
74 public String
getName() {
78 public String
getUrl() {
83 public String
toString() {
88 public boolean equals(final Object o
) {
89 if (this == o
) return true;
90 if (o
== null || getClass() != o
.getClass()) return false;
92 final Branch branch
= (Branch
)o
;
94 if (myUrl
!= null ?
!myUrl
.equals(branch
.myUrl
) : branch
.myUrl
!= null) return false;
100 public int hashCode() {
101 return (myUrl
!= null ? myUrl
.hashCode() : 0);