2 * Copyright (C) 2006 Robin Rosenberg
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License, version 2.1, as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
17 package org
.spearce
.egit
.core
.internal
.mapping
;
21 import org
.eclipse
.core
.resources
.IResource
;
22 import org
.eclipse
.core
.runtime
.CoreException
;
23 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
24 import org
.eclipse
.team
.core
.history
.IFileRevision
;
25 import org
.eclipse
.team
.core
.history
.provider
.FileRevision
;
26 import org
.spearce
.jgit
.lib
.ObjectId
;
27 import org
.spearce
.jgit
.lib
.TopologicalSorter
;
30 * A Git related {@link IFileRevision}. It references a version
31 * and a resource, i.e. the version we think corresponds to the
32 * resource in specific version.
34 public abstract class GitFileRevision
extends FileRevision
{
36 private final IResource resource
;
38 private final int count
;
40 private TopologicalSorter
<ObjectId
>.Lane lane
;
43 * Construct a {@link GitFileRevision}
46 * @param count index into the full list of commits
48 public GitFileRevision(IResource resource
, int count
) {
50 this.resource
= resource
;
53 public String
getName() {
54 return resource
.toString();
57 public boolean isPropertyMissing() {
61 public IFileRevision
withAllProperties(IProgressMonitor monitor
)
62 throws CoreException
{
67 return resource
.getLocationURI();
71 * @return the {@link IResource} the {@link IFileRevision} refers to.
73 public IResource
getResource() {
79 * @return index into full list of versions
81 public int getCount() {
86 * @return the swim lane assigned by the graph layout
88 public TopologicalSorter
<ObjectId
>.Lane
getLane() {
93 * Set the swim where this revision is found. Invoked by the
98 public void setLane(TopologicalSorter
<ObjectId
>.Lane lane
) {
103 * @return the ObjectId this IFileRevision refers to.
105 public ObjectId
getCommitId() {