Commit 5f6caf15 authored by Jonathan Doklovic's avatar Jonathan Doklovic

Merge branch 'release/1.0-alpha25'

parents b73118cb 78786b9a
......@@ -9,7 +9,7 @@
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jgitflow-plugin</artifactId>
<version>1.0-alpha24</version>
<version>1.0-alpha25</version>
<packaging>maven-plugin</packaging>
......@@ -333,7 +333,7 @@
<mavenVersion>2.2.1</mavenVersion>
<!--<mavenVersion>3.0.5</mavenVersion>-->
<mavenPluginPluginVersion>3.1</mavenPluginPluginVersion>
<jgitFlowVersion>0.19</jgitFlowVersion>
<jgitFlowVersion>0.20</jgitFlowVersion>
<scmVersion>1.8</scmVersion>
<mavenReleaseVersion>2.4</mavenReleaseVersion>
<jschAgentVersion>0.0.5</jschAgentVersion>
......
......@@ -520,14 +520,14 @@ public class DefaultProjectHelper extends AbstractLogEnabled implements ProjectH
public void ensureOrigin(String defaultRemote, JGitFlow flow) throws JGitFlowReleaseException
{
getLogger().info("ensuring origin exists...");
String newOriginUrl = defaultRemote;
try
{
StoredConfig config = flow.git().getRepository().getConfig();
String originUrl = config.getString(ConfigConstants.CONFIG_REMOTE_SECTION, Constants.DEFAULT_REMOTE_NAME, "url");
if (Strings.isNullOrEmpty(originUrl) && !Strings.isNullOrEmpty(defaultRemote))
{
String newOriginUrl = defaultRemote;
if(defaultRemote.startsWith("file://"))
{
File originFile = new File(defaultRemote.substring(7));
......@@ -537,10 +537,30 @@ public class DefaultProjectHelper extends AbstractLogEnabled implements ProjectH
getLogger().info("adding origin from default...");
config.setString(ConfigConstants.CONFIG_REMOTE_SECTION, Constants.DEFAULT_REMOTE_NAME, "url", newOriginUrl);
config.setString(ConfigConstants.CONFIG_REMOTE_SECTION, Constants.DEFAULT_REMOTE_NAME, "fetch", "+refs/heads/*:refs/remotes/origin/*");
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getMasterBranchName(), "remote", Constants.DEFAULT_REMOTE_NAME);
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getMasterBranchName(), "merge", Constants.R_HEADS + flow.getMasterBranchName());
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getDevelopBranchName(), "remote", Constants.DEFAULT_REMOTE_NAME);
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getDevelopBranchName(), "merge", Constants.R_HEADS + flow.getDevelopBranchName());
}
if(!Strings.isNullOrEmpty(originUrl) || !Strings.isNullOrEmpty(newOriginUrl))
{
if(Strings.isNullOrEmpty(config.getString(ConfigConstants.CONFIG_BRANCH_SECTION,flow.getMasterBranchName(),"remote")))
{
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getMasterBranchName(), "remote", Constants.DEFAULT_REMOTE_NAME);
}
if(Strings.isNullOrEmpty(config.getString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getMasterBranchName(), "merge")))
{
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getMasterBranchName(), "merge", Constants.R_HEADS + flow.getMasterBranchName());
}
if(Strings.isNullOrEmpty(config.getString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getDevelopBranchName(), "remote")))
{
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getDevelopBranchName(), "remote", Constants.DEFAULT_REMOTE_NAME);
}
if(Strings.isNullOrEmpty(config.getString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getDevelopBranchName(), "merge")))
{
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, flow.getDevelopBranchName(), "merge", Constants.R_HEADS + flow.getDevelopBranchName());
}
config.save();
try
......@@ -552,31 +572,7 @@ public class DefaultProjectHelper extends AbstractLogEnabled implements ProjectH
{
throw new JGitFlowReleaseException("error configuring remote git repo with url: " + newOriginUrl, e);
}
/*
getLogger().info("updating branch upstreams...");
Ref originMaster = GitHelper.getRemoteBranch(flow.git(), flow.getMasterBranchName());
if (null != originMaster)
{
Ref localMaster = GitHelper.getLocalBranch(flow.git(), flow.getMasterBranchName());
RefUpdate update = flow.git().getRepository().updateRef(localMaster.getName());
update.setNewObjectId(originMaster.getObjectId());
update.forceUpdate();
}
Ref originDevelop = GitHelper.getRemoteBranch(flow.git(), flow.getDevelopBranchName());
if (null != originDevelop)
{
Ref localDevelop = GitHelper.getLocalBranch(flow.git(), flow.getDevelopBranchName());
RefUpdate updateDevelop = flow.git().getRepository().updateRef(localDevelop.getName());
updateDevelop.setNewObjectId(originDevelop.getObjectId());
updateDevelop.forceUpdate();
}
commitAllChanges(flow.git(), "committing changes from new origin");
*/
}
}
......@@ -584,10 +580,6 @@ public class DefaultProjectHelper extends AbstractLogEnabled implements ProjectH
{
throw new JGitFlowReleaseException("error configuring remote git repo with url: " + defaultRemote, e);
}
// catch (JGitFlowIOException e)
// {
// throw new JGitFlowReleaseException("error configuring remote git repo with url: " + defaultRemote, e);
// }
}
......
......@@ -44,7 +44,7 @@ public class DefaultFlowFeatureManager extends AbstractFlowReleaseManager
JGitFlow flow = null;
try
{
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext());
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext(), ctx.getDefaultOriginUrl());
writeReportHeader(ctx, flow.getReporter());
setupCredentialProviders(ctx, flow.getReporter());
......@@ -91,7 +91,7 @@ public class DefaultFlowFeatureManager extends AbstractFlowReleaseManager
try
{
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext());
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext(), ctx.getDefaultOriginUrl());
JGitFlowReporter reporter = flow.getReporter();
......@@ -205,7 +205,7 @@ public class DefaultFlowFeatureManager extends AbstractFlowReleaseManager
try
{
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext());
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext(), ctx.getDefaultOriginUrl());
projectHelper.ensureOrigin(ctx.getDefaultOriginUrl(), flow);
writeReportHeader(ctx, flow.getReporter());
......
......@@ -44,7 +44,7 @@ public class DefaultFlowHotfixManager extends AbstractFlowReleaseManager
MavenJGitFlowConfiguration config = null;
try
{
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext());
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext(), ctx.getDefaultOriginUrl());
writeReportHeader(ctx,flow.getReporter());
setupCredentialProviders(ctx,flow.getReporter());
......@@ -100,7 +100,7 @@ public class DefaultFlowHotfixManager extends AbstractFlowReleaseManager
try
{
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext());
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext(), ctx.getDefaultOriginUrl());
writeReportHeader(ctx,flow.getReporter());
setupCredentialProviders(ctx,flow.getReporter());
......
......@@ -38,7 +38,7 @@ public class DefaultFlowReleaseManager extends AbstractFlowReleaseManager
JGitFlow flow = null;
try
{
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext());
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext(), ctx.getDefaultOriginUrl());
writeReportHeader(ctx,flow.getReporter());
setupCredentialProviders(ctx,flow.getReporter());
......@@ -79,7 +79,7 @@ public class DefaultFlowReleaseManager extends AbstractFlowReleaseManager
MavenJGitFlowConfiguration config = null;
try
{
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext());
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext(), ctx.getDefaultOriginUrl());
writeReportHeader(ctx,flow.getReporter());
setupCredentialProviders(ctx,flow.getReporter());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment