/*******************************************************************************
 * Copyright (c) 2005-2008 VecTrace (Zingo Andersen) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Bastian Doetsch	implementation
 *******************************************************************************/
package com.vectrace.MercurialEclipse.synchronize;

import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.variants.IResourceVariant;

import com.vectrace.MercurialEclipse.team.IStorageMercurialRevision;

public class MercurialResourceVariant implements IResourceVariant {
	private IStorageMercurialRevision rev;

	public MercurialResourceVariant(IStorageMercurialRevision rev) {
		this.rev = rev;
	}

	public byte[] asBytes() {
		return getContentIdentifier().getBytes();
	}

	public String getContentIdentifier() {
		return rev.getGlobal();
	}

	public String getName() {
		return rev.getName();
	}

	public IStorage getStorage(IProgressMonitor monitor) throws TeamException {
		return rev;
	}

	public boolean isContainer() {
		return false;
	}

    /**
     * @return the rev
     */
    public IStorageMercurialRevision getRev() {
        return rev;
    }

}

@@ -910,17 +910,20 @@
 t %7B%0A
-%09
+    
 private 
 ISto
@@ -918,16 +918,22 @@
 private 
+final 
 IStorage
@@ -956,17 +956,20 @@
 n rev;%0A%0A
-%09
+    
 public M
@@ -1025,18 +1025,24 @@
  rev) %7B%0A
-%09%09
+        
 this.rev
@@ -1045,29 +1045,35 @@
 .rev = rev;%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 public byte%5B
@@ -1082,26 +1082,32 @@
 asBytes() %7B%0A
-%09%09
+        
 return getCo
@@ -1132,29 +1132,35 @@
 getBytes();%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 public Strin
@@ -1182,26 +1182,32 @@
 ntifier() %7B%0A
-%09%09
+        
 return rev.g
@@ -1214,29 +1214,35 @@
 etGlobal();%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 public Strin
@@ -1251,26 +1251,32 @@
 getName() %7B%0A
-%09%09
+        
 return rev.g
@@ -1281,21 +1281,41 @@
 .get
-Name();%0A%09%7D%0A%0A%09
+Resource().getName();%0A    %7D%0A%0A    
 publ
@@ -1386,18 +1386,24 @@
 ption %7B%0A
-%09%09
+        
 return r
@@ -1410,13 +1410,19 @@
 ev;%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 publ
@@ -1452,10 +1452,16 @@
 ) %7B%0A
-%09%09
+        
 retu
@@ -1470,17 +1470,20 @@
  false;%0A
-%09
+    
 %7D%0A%0A    /

Enable right content types (based on file types) in compare editor opened from Synchronization view