mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
tip reference moved as a separated static constant to HgUtil
This commit is contained in:
@@ -38,6 +38,8 @@ import org.zmlx.hg4idea.util.HgUtil;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import static org.zmlx.hg4idea.util.HgUtil.TIP_REFERENCE;
|
||||
|
||||
public class HgLogProvider implements VcsLogProvider {
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(HgLogProvider.class);
|
||||
@@ -47,8 +49,6 @@ public class HgLogProvider implements VcsLogProvider {
|
||||
@NotNull private final VcsLogRefManager myRefSorter;
|
||||
@NotNull private final VcsLogObjectsFactory myVcsObjectsFactory;
|
||||
|
||||
private static final String RECENT_HEAD = "tip";
|
||||
|
||||
public HgLogProvider(@NotNull Project project, @NotNull HgRepositoryManager repositoryManager, @NotNull VcsLogObjectsFactory factory) {
|
||||
myProject = project;
|
||||
myRepositoryManager = repositoryManager;
|
||||
@@ -119,7 +119,7 @@ public class HgLogProvider implements VcsLogProvider {
|
||||
}
|
||||
String currentRevision = repository.getCurrentRevision();
|
||||
if (currentRevision != null) { // null => fresh repository
|
||||
refs.add(myVcsObjectsFactory.createRef(myVcsObjectsFactory.createHash(currentRevision), RECENT_HEAD, HgRefManager.HEAD, root));
|
||||
refs.add(myVcsObjectsFactory.createRef(myVcsObjectsFactory.createHash(currentRevision), TIP_REFERENCE, HgRefManager.HEAD, root));
|
||||
}
|
||||
for (HgNameWithHashInfo tagInfo : tags) {
|
||||
refs.add(myVcsObjectsFactory.createRef(tagInfo.getHash(), tagInfo.getName(), HgRefManager.TAG, root));
|
||||
@@ -172,7 +172,7 @@ public class HgLogProvider implements VcsLogProvider {
|
||||
|
||||
boolean atLeastOneBranchExists = false;
|
||||
for (String branchName : filterCollection.getBranchFilter().getBranchNames()) {
|
||||
if (branchName.equals(RECENT_HEAD) || branchExists(repository, branchName)) {
|
||||
if (branchName.equals(TIP_REFERENCE) || branchExists(repository, branchName)) {
|
||||
filterParameters.add(prepareParameter("branch", branchName));
|
||||
atLeastOneBranchExists = true;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.Collection;
|
||||
|
||||
import static org.zmlx.hg4idea.util.HgUtil.TIP_REFERENCE;
|
||||
|
||||
public class HgCommonDialogWithChoices extends DialogWrapper {
|
||||
|
||||
|
||||
@@ -119,7 +121,8 @@ public class HgCommonDialogWithChoices extends DialogWrapper {
|
||||
HgRepository repo = hgRepositorySelectorComponent.getRepository();
|
||||
branchSelector.setModel(new DefaultComboBoxModel(repo.getOpenedBranches().toArray()));
|
||||
DefaultComboBoxModel tagComboBoxModel = new DefaultComboBoxModel(HgUtil.getNamesWithoutHashes(repo.getTags()).toArray());
|
||||
tagComboBoxModel.addElement("tip"); //HgRepository does not store 'tip' tag because it is internal and not included in tags file
|
||||
tagComboBoxModel
|
||||
.addElement(TIP_REFERENCE); //HgRepository does not store 'tip' tag because it is internal and not included in tags file
|
||||
tagSelector.setModel(tagComboBoxModel);
|
||||
bookmarkSelector.setModel(new DefaultComboBoxModel(HgUtil.getNamesWithoutHashes(repo.getBookmarks()).toArray()));
|
||||
update();
|
||||
|
||||
@@ -72,6 +72,7 @@ public abstract class HgUtil {
|
||||
public static final int MANY_FILES = 100;
|
||||
private static final Logger LOG = Logger.getInstance(HgUtil.class);
|
||||
public static final String DOT_HG = ".hg";
|
||||
public static final String TIP_REFERENCE = "tip";
|
||||
|
||||
public static File copyResourceToTempFile(String basename, String extension) throws IOException {
|
||||
final InputStream in = HgUtil.class.getClassLoader().getResourceAsStream("python/" + basename + extension);
|
||||
|
||||
Reference in New Issue
Block a user