mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
getChangeset instead of revision number if it is possible.
This commit is contained in:
@@ -94,6 +94,9 @@ public class HgRevisionNumber implements VcsRevisionNumber {
|
||||
}
|
||||
|
||||
public String asString() {
|
||||
if (revision.isEmpty()) {
|
||||
return changeset;
|
||||
}
|
||||
return revision + ":" + changeset;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.zmlx.hg4idea.action;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vcs.update.UpdatedFiles;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -110,7 +111,8 @@ public class HgMerge extends HgAbstractGlobalAction {
|
||||
|
||||
HgRevisionNumber otherHead = dialog.getOtherHead();
|
||||
if (otherHead != null) {
|
||||
hgMergeCommand.setRevision(otherHead.getRevision());
|
||||
String changeset = otherHead.getChangeset();
|
||||
hgMergeCommand.setRevision(StringUtil.isEmptyOrSpaces(changeset) ? otherHead.getRevision() : changeset);
|
||||
incomingRevision = otherHead;
|
||||
}
|
||||
|
||||
|
||||
@@ -155,9 +155,9 @@ public class HgStatusCommand {
|
||||
if (myIncludeCopySource) {
|
||||
options.add("--copies");
|
||||
}
|
||||
if (myBaseRevision != null && !myBaseRevision.getRevision().isEmpty()) {
|
||||
if (myBaseRevision != null && (!myBaseRevision.getRevision().isEmpty() || !myBaseRevision.getChangeset().isEmpty())) {
|
||||
options.add("--rev");
|
||||
options.add(myBaseRevision.getChangeset().isEmpty() ? myBaseRevision.getRevision() : myBaseRevision.getChangeset());
|
||||
options.add(StringUtil.isEmptyOrSpaces(myBaseRevision.getChangeset()) ? myBaseRevision.getRevision() : myBaseRevision.getChangeset());
|
||||
if (myTargetRevision != null) {
|
||||
options.add("--rev");
|
||||
options.add(myTargetRevision.getChangeset());
|
||||
|
||||
@@ -88,8 +88,10 @@ public class HgMergeProvider implements MergeProvider {
|
||||
// Find common ancestor of two revisions : hg debugancestor rev1 rev2
|
||||
// Using quotes may produce wrong escaping errors on Unix-type systems
|
||||
List<String> arguments = new ArrayList<String>();
|
||||
arguments.add(localRevisionNumber.getRevision());
|
||||
arguments.add(serverRevisionNumber.getRevision());
|
||||
String localChangeset = localRevisionNumber.getChangeset();
|
||||
String serverChangeset = serverRevisionNumber.getChangeset();
|
||||
arguments.add(StringUtil.isEmptyOrSpaces(localChangeset) ? localRevisionNumber.getRevision() : localChangeset);
|
||||
arguments.add(StringUtil.isEmptyOrSpaces(serverChangeset) ? serverRevisionNumber.getRevision() : serverChangeset);
|
||||
HgCommandResult result = new HgCommandExecutor(myProject).executeInCurrentThread(repo, "debugancestor", arguments);
|
||||
if (result != null) {
|
||||
String output = result.getRawOutput();
|
||||
|
||||
Reference in New Issue
Block a user