Commit 67148445 authored by Jonathan Doklovic's avatar Jonathan Doklovic

Merge branch 'release/1.0-alpha23'

parents 85013cfb 072fb4d4
......@@ -9,7 +9,7 @@
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jgitflow-plugin</artifactId>
<version>1.0-alpha22</version>
<version>1.0-alpha23</version>
<packaging>maven-plugin</packaging>
......
......@@ -40,6 +40,7 @@ public class ReleaseContext
private boolean allowUntracked;
private boolean allowRemote;
private boolean pullMaster;
private boolean pullDevelop;
private String startCommit;
private String defaultOriginUrl;
private String scmCommentPrefix;
......@@ -77,6 +78,7 @@ public class ReleaseContext
this.defaultOriginUrl = "";
this.scmCommentPrefix = "";
this.pullMaster = false;
this.pullDevelop = false;
}
public boolean isAllowSnapshots()
......@@ -427,7 +429,7 @@ public class ReleaseContext
return this;
}
public boolean isPullMater()
public boolean isPullMaster()
{
return pullMaster;
}
......@@ -437,4 +439,16 @@ public class ReleaseContext
this.pullMaster = pullMaster;
return this;
}
public ReleaseContext setPullDevelop(boolean pullDevelop)
{
this.pullDevelop = pullDevelop;
return this;
}
public boolean isPullDevelop()
{
return pullDevelop;
}
}
......@@ -64,6 +64,9 @@ public class ReleaseFinishMojo extends AbstractJGitFlowMojo
@Parameter( defaultValue = "false", property = "pullMaster" )
private boolean pullMaster = false;
@Parameter( defaultValue = "false", property = "pullDevelop" )
private boolean pullDevelop = false;
@Parameter( defaultValue = "true", property = "updateDependencies" )
private boolean updateDependencies = true;
......@@ -101,6 +104,7 @@ public class ReleaseFinishMojo extends AbstractJGitFlowMojo
.setDefaultOriginUrl(defaultOriginUrl)
.setScmCommentPrefix(scmCommentPrefix)
.setPullMaster(pullMaster)
.setPullDevelop(pullDevelop)
.setFlowInitContext(getFlowInitContext().getJGitFlowContext());
try
......
......@@ -206,6 +206,7 @@ public class DefaultFlowFeatureManager extends AbstractFlowReleaseManager
try
{
flow = JGitFlow.forceInit(ctx.getBaseDir(), ctx.getFlowInitContext());
projectHelper.ensureOrigin(ctx.getDefaultOriginUrl(), flow);
writeReportHeader(ctx, flow.getReporter());
......
......@@ -216,6 +216,16 @@ public class DefaultFlowReleaseManager extends AbstractFlowReleaseManager
if(GitHelper.remoteBranchExists(flow.git(), flow.getDevelopBranchName(), flow.getReporter()))
{
if(ctx.isPullDevelop())
{
reporter.debugText("finishRelease", "pulling develop before remote behind check");
reporter.flush();
flow.git().checkout().setName(flow.getDevelopBranchName()).call();
flow.git().pull().call();
flow.git().checkout().setName(prefixedBranchName).call();
}
if(GitHelper.localBranchBehindRemote(flow.git(),flow.getDevelopBranchName(),flow.getReporter()))
{
reporter.errorText("release-finish","local branch '" + flow.getDevelopBranchName() + "' is behind the remote branch");
......@@ -226,7 +236,7 @@ public class DefaultFlowReleaseManager extends AbstractFlowReleaseManager
if(GitHelper.remoteBranchExists(flow.git(), flow.getMasterBranchName(), flow.getReporter()))
{
if(ctx.isPullMater())
if(ctx.isPullMaster())
{
reporter.debugText("finishRelease", "pulling master before remote behind check");
reporter.flush();
......
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