Commit 67148445 authored by Jonathan Doklovic's avatar Jonathan Doklovic

Merge branch 'release/1.0-alpha23'

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