<commit_before>/*******************************************************************************
 * Copyright (c) 2005-2009 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> (Intland) - implementation
 *******************************************************************************/
package com.vectrace.MercurialEclipse.dialogs;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;

import com.vectrace.MercurialEclipse.menu.CommitMergeHandler;
import com.vectrace.MercurialEclipse.ui.CommitFilesChooser;
import com.vectrace.MercurialEclipse.ui.SWTWidgetHelper;

/**
 * @author Andrei
 */
public class MergeDialog extends CommitDialog {
	private final IProject mergeProject;

	public MergeDialog(Shell shell, IProject mergeProject, String defaultCommitMessage) {
		super(shell, null);
		Assert.isNotNull(mergeProject);
		this.mergeProject = mergeProject;
		setDefaultCommitMessage(defaultCommitMessage);
	}

	@Override
	protected void createFilesList(Composite container) {
		SWTWidgetHelper.createLabel(container, Messages.getString("CommitDialog.selectFiles")); //$NON-NLS-1$
		List<IResource> resources = new ArrayList<IResource>();
		resources.add(mergeProject);
		commitFilesList = new CommitFilesChooser(container, false, resources, true, true);
	}

	@Override
	protected void createRevertCheckBox(Composite container) {
		// does nothing
	}

	@Override
	protected void performCommit(String messageToCommit, boolean closeBranch) throws CoreException {
		CommitMergeHandler.commitMerge(mergeProject.getProject(), messageToCommit);
	}

	@Override
	protected String getInitialCommitUserName() {
		return getDefaultCommitName(mergeProject);
	}
}<commit_msg>don't show "close branch" option in the commit merge dialog.<commit_after>/*******************************************************************************
 * Copyright (c) 2005-2009 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> (Intland) - implementation
 *******************************************************************************/
package com.vectrace.MercurialEclipse.dialogs;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;

import com.vectrace.MercurialEclipse.menu.CommitMergeHandler;
import com.vectrace.MercurialEclipse.ui.CommitFilesChooser;
import com.vectrace.MercurialEclipse.ui.SWTWidgetHelper;

/**
 * @author Andrei
 */
public class MergeDialog extends CommitDialog {
	private final IProject mergeProject;

	public MergeDialog(Shell shell, IProject mergeProject, String defaultCommitMessage) {
		super(shell, null);
		Assert.isNotNull(mergeProject);
		this.mergeProject = mergeProject;
		setDefaultCommitMessage(defaultCommitMessage);
	}

	@Override
	protected void createFilesList(Composite container) {
		SWTWidgetHelper.createLabel(container, Messages.getString("CommitDialog.selectFiles")); //$NON-NLS-1$
		List<IResource> resources = new ArrayList<IResource>();
		resources.add(mergeProject);
		commitFilesList = new CommitFilesChooser(container, false, resources, true, true);
	}

	@Override
	protected void createRevertCheckBox(Composite container) {
		// does nothing
	}

	@Override
	protected void createCloseBranchCheckBox(Composite container) {
		// don't create it as we don't want it in merge dialog
	}

	@Override
	protected void performCommit(String messageToCommit, boolean closeBranch) throws CoreException {
		CommitMergeHandler.commitMerge(mergeProject.getProject(), messageToCommit);
	}

	@Override
	protected String getInitialCommitUserName() {
		return getDefaultCommitName(mergeProject);
	}
}
{'fraction_non_alphanumeric': 0.15857962064402295, 'fraction_numerical': 0.005734450816056462, 'mean_word_length': 6.175632911392405, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6958329', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1240, 'n_words': 293}