update copyright
[fedora-idea.git] / plugins / svn4idea / src / org / jetbrains / idea / svn / update / MergeRootInfo.java
blob875b811fab27cc3d85b48c2464dfdb4d02a6ad74
1 /*
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.update;
18 import org.tmatesoft.svn.core.wc.SVNRevision;
19 import org.tmatesoft.svn.core.wc.SVNWCClient;
20 import org.tmatesoft.svn.core.SVNURL;
21 import org.tmatesoft.svn.core.SVNException;
22 import org.jetbrains.idea.svn.SvnVcs;
24 import java.io.File;
26 public class MergeRootInfo {
27 private String myUrl1;
28 private SVNRevision myRevision1;
29 private String myUrl2;
30 private SVNRevision myRevision2;
32 public MergeRootInfo(File file, SvnVcs vcs) {
33 myRevision1 = SVNRevision.HEAD;
34 myRevision2 = SVNRevision.HEAD;
36 try {
37 SVNWCClient wcClient = vcs.createWCClient();
38 final SVNURL url = wcClient.doInfo(file, SVNRevision.WORKING).getURL();
39 myUrl1 = url.toString();
40 myUrl2 = url.toString();
42 catch (SVNException e) {
43 myUrl1 = "";
44 myUrl2 = "";
49 public SVNURL getUrl1() {
50 try {
51 return SVNURL.parseURIDecoded(myUrl1);
53 catch (SVNException e) {
54 return null;
58 public SVNURL getUrl2() {
59 try {
60 return SVNURL.parseURIDecoded(myUrl2);
62 catch (SVNException e) {
63 return null;
67 public SVNRevision getRevision2() {
68 return myRevision2;
71 public SVNRevision getRevision1() {
72 return myRevision1;
75 public long getResultRevision() {
76 return myRevision2.getNumber();
79 public void setUrl1(final String text) {
80 myUrl1 = text;
83 public void setUrl2(final String text) {
84 myUrl2 = text;
87 public void setRevision1(final SVNRevision rev) {
88 myRevision1 = rev;
91 public void setRevision2(final SVNRevision rev) {
92 myRevision2 = rev;
95 public String getUrlString1() {
96 return myUrl1;
99 public String getUrlString2() {
100 return myUrl2;