<commit_before>/*******************************************************************************
 * Copyright (c) 2008 VecTrace (<NAME>) 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:
 *     <NAME>              - implementation
 *     <NAME>                  - Code cleanup
 *     <NAME>			 - extracted from RevisionChooserDialog for Sync.
 *******************************************************************************/
package com.vectrace.MercurialEclipse.storage;

import java.util.Arrays;
import java.util.Collections;
import java.util.SortedMap;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;

import com.vectrace.MercurialEclipse.exception.HgException;
import com.vectrace.MercurialEclipse.model.ChangeSet;
import com.vectrace.MercurialEclipse.team.MercurialStatusCache;

public class FileDataLoader extends DataLoader {

	private IFile file;

	public FileDataLoader(IFile file) {
		this.file = file;
	}

	@Override
	public IProject getProject() {
		return file.getProject();
	}

	@Override
	public ChangeSet[] getRevisions() throws HgException {
		// if (file.getType() == IResource.FILE) {
		// super.changeSets = HgLogClient.getRevisions(file);
		// return changeSets;
		// }
		// return null;
		
		SortedMap<Integer, ChangeSet> changeSetMap = MercurialStatusCache
				.getInstance().getLocalChangeSets(file);
		ChangeSet[] changes = changeSetMap.values().toArray(
				new ChangeSet[changeSetMap.values().size()]);
		Collections.reverse(Arrays.asList(changes));
		super.changeSets = changes;
		return changes;
	}
}<commit_msg>Fixes not including incoming revisions.<commit_after>/*******************************************************************************
 * Copyright (c) 2008 VecTrace (<NAME>) 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:
 *     <NAME>              - implementation
 *     <NAME>                  - Code cleanup
 *     <NAME>			 - extracted from RevisionChooserDialog for Sync.
 *******************************************************************************/
package com.vectrace.MercurialEclipse.storage;

import java.util.Arrays;
import java.util.Collections;
import java.util.SortedMap;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;

import com.vectrace.MercurialEclipse.exception.HgException;
import com.vectrace.MercurialEclipse.model.ChangeSet;
import com.vectrace.MercurialEclipse.team.MercurialStatusCache;

public class FileDataLoader extends DataLoader {

	private IFile file;

	public FileDataLoader(IFile file) {
		this.file = file;
	}

	@Override
	public IProject getProject() {
		return file.getProject();
	}

	@Override
	public ChangeSet[] getRevisions() throws HgException {
		// if (file.getType() == IResource.FILE) {
		// super.changeSets = HgLogClient.getRevisions(file);
		// return changeSets;
		// }
		// return null;
		
		SortedMap<Integer, ChangeSet> changeSetMap = MercurialStatusCache
				.getInstance().getLocalChangeSets(file);
		
		SortedMap<Integer, ChangeSet> incomingChangeSetMap =MercurialStatusCache.getInstance().getIncomingChangeSets(file);
		changeSetMap.putAll(incomingChangeSetMap);
		
		ChangeSet[] changes = changeSetMap.values().toArray(
				new ChangeSet[changeSetMap.values().size()]);
		Collections.reverse(Arrays.asList(changes));
		super.changeSets = changes;
		return changes;
	}
}
{'fraction_non_alphanumeric': 0.18019437877593905, 'fraction_numerical': 0.0042027843446283165, 'mean_word_length': 4.567251461988304, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1216803', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1045, 'n_words': 243}