mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[hg]: IDEA-147086 Add an ability to merge current branch with commit from log
This commit is contained in:
@@ -101,6 +101,8 @@
|
||||
description="Create new tag pointing to this commit"/>
|
||||
<action class="org.zmlx.hg4idea.action.HgCreateNewBranchFromLogAction" id="hg4idea.CreateNewBranch" text="New Branch..."
|
||||
description="Create new branch starting from the selected commit"/>
|
||||
<action class="org.zmlx.hg4idea.action.HgMergeWithRevisionFromLog" id="hg4idea.MergeWithRevision" text="Merge With"
|
||||
description="Merge with selected revision"/>
|
||||
<group id="Hg.Mq" class="com.intellij.ide.actions.NonTrivialActionGroup" text="MQ" popup="true"
|
||||
icon="AllIcons.Modules.Edit">
|
||||
<action class="org.zmlx.hg4idea.action.mq.HgQImportFromLogAction" id="hg4idea.QImport" text="Import"
|
||||
@@ -137,6 +139,7 @@
|
||||
<reference id="hg4idea.UpdateToRevision"/>
|
||||
<reference id="hg4idea.CreateNewBranch"/>
|
||||
<reference id="hg4idea.CreateNewTag"/>
|
||||
<reference id="hg4idea.MergeWithRevision"/>
|
||||
<separator/>
|
||||
<reference id="Hg.Mq"/>
|
||||
<add-to-group group-id="Vcs.Log.ContextMenu"/>
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.zmlx.hg4idea.action;
|
||||
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.vcs.update.UpdatedFiles;
|
||||
import com.intellij.vcs.log.VcsFullCommitDetails;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.zmlx.hg4idea.command.HgMergeCommand;
|
||||
import org.zmlx.hg4idea.repo.HgRepository;
|
||||
|
||||
public class HgMergeWithRevisionFromLog extends HgLogSingleCommitAction {
|
||||
@Override
|
||||
protected void actionPerformed(@NotNull final HgRepository repository, @NotNull VcsFullCommitDetails commit) {
|
||||
FileDocumentManager.getInstance().saveAllDocuments();
|
||||
HgMergeCommand.mergeWith(repository, commit.getId().asString(), UpdatedFiles.create());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user