use of org.eclipse.egit.core.op.TagOperation in project egit by eclipse.
the class BranchAndResetActionTest method setup.
@Before
public void setup() throws Exception {
repositoryFile = createProjectAndCommitToRepository();
Repository repo = lookupRepository(repositoryFile);
TagBuilder tag = new TagBuilder();
tag.setTag("SomeTag");
tag.setTagger(RawParseUtils.parsePersonIdent(TestUtil.TESTAUTHOR));
tag.setMessage("I'm just a little tag");
tag.setObjectId(repo.resolve(repo.getFullBranch()), Constants.OBJ_COMMIT);
TagOperation top = new TagOperation(repo, tag, false);
top.execute(null);
touchAndSubmit(null);
RepositoriesViewLabelProvider provider = GitRepositoriesViewTestUtils.createLabelProvider();
LOCAL_BRANCHES = provider.getText(new LocalNode(new RepositoryNode(null, repo), repo));
TAGS = provider.getText(new TagsNode(new RepositoryNode(null, repo), repo));
}
use of org.eclipse.egit.core.op.TagOperation in project egit by eclipse.
the class CompareActionsTest method setup.
@Before
public void setup() throws Exception {
repositoryFile = createProjectAndCommitToRepository();
Repository repo = lookupRepository(repositoryFile);
disablePerspectiveSwitchPrompt();
setEnabledModelProvider(ModelProvider.RESOURCE_MODEL_PROVIDER_ID);
TagBuilder tag = new TagBuilder();
tag.setTag("SomeTag");
tag.setTagger(RawParseUtils.parsePersonIdent(TestUtil.TESTAUTHOR));
tag.setMessage("I'm just a little tag");
tag.setObjectId(repo.resolve(repo.getFullBranch()), Constants.OBJ_COMMIT);
commitOfTag = tag.getObjectId();
TagOperation top = new TagOperation(repo, tag, false);
top.execute(null);
touchAndSubmit(null);
RepositoriesViewLabelProvider provider = GitRepositoriesViewTestUtils.createLabelProvider();
// LOCAL_BRANCHES = provider.getText(new LocalNode(new RepositoryNode(
// null, repo), repo));
TAGS = provider.getText(new TagsNode(new RepositoryNode(null, repo), repo));
}
use of org.eclipse.egit.core.op.TagOperation in project egit by eclipse.
the class TagActionTest method setup.
@Before
public void setup() throws Exception {
repositoryFile = createProjectAndCommitToRepository();
Repository repo = lookupRepository(repositoryFile);
TagBuilder tag = new TagBuilder();
tag.setTag("SomeTag");
tag.setTagger(RawParseUtils.parsePersonIdent(TestUtil.TESTAUTHOR));
tag.setMessage("I'm just a little tag");
tag.setObjectId(repo.resolve(repo.getFullBranch()), Constants.OBJ_COMMIT);
TagOperation top = new TagOperation(repo, tag, false);
top.execute(null);
touchAndSubmit(null);
}
use of org.eclipse.egit.core.op.TagOperation in project egit by eclipse.
the class ReleaseStartOperationTest method createTag.
protected void createTag(RevCommit head, String name, String message, Repository repository) throws CoreException {
TagBuilder tag = new TagBuilder();
tag.setTag(name);
tag.setMessage(message);
tag.setObjectId(head);
new TagOperation(repository, tag, false).execute(null);
}
use of org.eclipse.egit.core.op.TagOperation in project egit by eclipse.
the class CreateTagHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RepositoryCommit> commits = getCommits(event);
if (commits.size() == 1) {
RepositoryCommit commit = commits.get(0);
Repository repository = commit.getRepository();
CreateTagDialog dialog = new CreateTagDialog(HandlerUtil.getActiveShellChecked(event), commit.getRevCommit().getId(), repository);
if (dialog.open() != Window.OK)
return null;
final TagBuilder tag = new TagBuilder();
PersonIdent personIdent = new PersonIdent(repository);
String tagName = dialog.getTagName();
tag.setTag(tagName);
tag.setTagger(personIdent);
tag.setMessage(dialog.getTagMessage());
tag.setObjectId(commit.getRevCommit());
try {
new TagOperation(repository, tag, dialog.shouldOverWriteTag()).execute(new NullProgressMonitor());
} catch (CoreException e) {
throw new ExecutionException(e.getMessage(), e);
}
if (dialog.shouldStartPushWizard())
PushTagsWizard.openWizardDialog(repository, tagName);
}
return null;
}
Aggregations