2 * Copyright 2000-2007 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.
17 package com
.intellij
.openapi
.vcs
;
19 import com
.intellij
.openapi
.vfs
.VirtualFile
;
24 public class VcsRoot
{
25 public final AbstractVcs vcs
;
26 public final VirtualFile path
;
28 public VcsRoot(final AbstractVcs vcs
, final VirtualFile path
) {
34 public boolean equals(Object o
) {
35 if (this == o
) return true;
36 if (o
== null || getClass() != o
.getClass()) return false;
38 VcsRoot root
= (VcsRoot
)o
;
40 if (path
!= null ?
!path
.equals(root
.path
) : root
.path
!= null) return false;
41 if (vcs
!= null ?
!vcs
.getName().equals(root
.vcs
.getName()) : root
.vcs
!= null) return false;
47 public int hashCode() {
48 int result
= vcs
!= null ? vcs
.getName().hashCode() : 0;
49 result
= 31 * result
+ (path
!= null ? path
.hashCode() : 0);