@@ -79,10 +79,10 @@ public IAction getProductionReleaseAction(Component comp, ActionKind actionKind)
7979 childActions .add (getProductionReleaseAction (mDep , actionKind ));
8080 }
8181
82- return getProductionReleaseActionRoot (comp , childActions , actionKind );
82+ return getProductionReleaseActionRoot (comp , rb , childActions , actionKind );
8383 }
8484
85- public IAction getProductionReleaseActionRoot (Component comp , List <IAction > childActions , ActionKind actionKind ) {
85+ private IAction getProductionReleaseActionRoot (Component comp , ReleaseBranch rb , List <IAction > childActions , ActionKind actionKind ) {
8686 DevelopBranch db = new DevelopBranch (comp );
8787 if (!db .hasVersionFile ()) {
8888 throw new EComponentConfig ("no " + VER_FILE_NAME + " file for " + comp .toString ());
@@ -93,62 +93,65 @@ public IAction getProductionReleaseActionRoot(Component comp, List<IAction> chil
9393 return new ActionNone (comp , childActions , "develop branch is IGNORED" );
9494 }
9595
96- ReleaseBranch rb = new ReleaseBranch (comp );
9796 ReleaseBranchStatus rbs = rb .getStatus ();
9897
9998 if (rbs == ReleaseBranchStatus .MISSING ) {
10099 skipAllBuilds (childActions );
101100 if (actionKind == ActionKind .BUILD ) {
102- return new ActionNone (comp , childActions , "nothing to build. " + rb . getVersion () + " " + rb . getStatus ( ));
101+ return new ActionNone (comp , childActions , "nothing to build. " + getReleaseBranchDetailsStr ( rb , rbs ));
103102 }
104103
105- return new SCMActionFork (comp , childActions , ReleaseBranchStatus .MISSING , ReleaseBranchStatus .MDEPS_ACTUAL , options );
104+ return new SCMActionFork (comp , rb , childActions , ReleaseBranchStatus .MISSING , ReleaseBranchStatus .MDEPS_ACTUAL , options );
106105 }
107106
108107 if (rbs == ReleaseBranchStatus .BRANCHED ) {
109108 // need to freeze mdeps
110109 skipAllBuilds (childActions );
111110 if (actionKind == ActionKind .BUILD ) {
112- return new ActionNone (comp , childActions , "nothing to build. " + rb . getVersion () + " " + rb . getStatus ( ));
111+ return new ActionNone (comp , childActions , "nothing to build. " + getReleaseBranchDetailsStr ( rb , rbs ));
113112 }
114- return new SCMActionFork (comp , childActions , ReleaseBranchStatus .BRANCHED , ReleaseBranchStatus .MDEPS_ACTUAL , options );
113+ return new SCMActionFork (comp , rb , childActions , ReleaseBranchStatus .BRANCHED , ReleaseBranchStatus .MDEPS_ACTUAL , options );
115114 }
116115
117116 if (rbs == ReleaseBranchStatus .MDEPS_FROZEN ) {
118117 if (needToActualizeMDeps (rb )) {
119118 // need to actualize
120119 skipAllBuilds (childActions );
121120 if (actionKind == ActionKind .BUILD ) {
122- return new ActionNone (comp , childActions , "nothing to build. " + rb . getVersion () + " " + rb . getStatus ( ));
121+ return new ActionNone (comp , childActions , "nothing to build. " + getReleaseBranchDetailsStr ( rb , rbs ));
123122 }
124- return new SCMActionFork (comp , childActions , ReleaseBranchStatus .MDEPS_FROZEN , ReleaseBranchStatus .MDEPS_ACTUAL , options );
123+ return new SCMActionFork (comp , rb , childActions , ReleaseBranchStatus .MDEPS_FROZEN , ReleaseBranchStatus .MDEPS_ACTUAL , options );
125124 } else {
126125 // All necessary version will be build by Child Actions. Need to build
127126 skipAllForks (childActions );
128127 if (actionKind == ActionKind .FORK ) {
129- return new ActionNone (comp , childActions , "nothing to fork. " + rb . getVersion () + " " + rb . getStatus ( ));
128+ return new ActionNone (comp , childActions , "nothing to fork. " + getReleaseBranchDetailsStr ( rb , rbs ));
130129 }
131- return new SCMActionBuild (comp , childActions , ReleaseReason .NEW_DEPENDENCIES , rb .getVersion (), options );
130+ return new SCMActionBuild (comp , rb , childActions , ReleaseReason .NEW_DEPENDENCIES , rb .getVersion (), options );
132131 }
133132 }
134133
135134 if (rbs == ReleaseBranchStatus .MDEPS_ACTUAL ) {
136135 // need to build
137136 if (actionKind == ActionKind .FORK ) {
138- return new ActionNone (comp , childActions , "nothing to fork. " + rb . getVersion () + " " + rb . getStatus ( ));
137+ return new ActionNone (comp , childActions , "nothing to fork. " + getReleaseBranchDetailsStr ( rb , rbs ));
139138 }
140- return new SCMActionBuild (comp , childActions , ReleaseReason .NEW_FEATURES , rb .getVersion (), options );
139+ return new SCMActionBuild (comp , rb , childActions , ReleaseReason .NEW_FEATURES , rb .getVersion (), options );
141140 }
142141
143142 if (hasForkChildActions (childActions )) {
144143 skipAllBuilds (childActions );
145144 if (actionKind == ActionKind .FORK ) {
146145 return new ActionNone (comp , childActions , "nothing to build. " + rb .getVersion () + " " + rb .getStatus ());
147146 }
148- return new SCMActionFork (comp , childActions , rbs , rbs , options );
147+ return new SCMActionFork (comp , rb , childActions , rbs , rbs , options );
149148 }
150149
151- return new ActionNone (comp , childActions , rb .getVersion ().toString () + " " + rbs .toString ());
150+ return new ActionNone (comp , childActions , getReleaseBranchDetailsStr (rb , rbs ));
151+ }
152+
153+ private String getReleaseBranchDetailsStr (ReleaseBranch rb , ReleaseBranchStatus rbs ) {
154+ return rb .getName () + " " + rbs + ", target version " + rb .getVersion ();
152155 }
153156
154157 private boolean needToActualizeMDeps (ReleaseBranch currentCompRB ) {
@@ -158,12 +161,12 @@ private boolean needToActualizeMDeps(ReleaseBranch currentCompRB) {
158161 mDepRB = new ReleaseBranch (mDep );
159162 ReleaseBranchStatus rbs = mDepRB .getStatus ();
160163 if (rbs == ReleaseBranchStatus .MDEPS_ACTUAL ) {
161- if (!mDepRB .getCurrentVersion ().equals (mDep .getVersion ())) {
164+ if (!mDepRB .getHeadVersion ().equals (mDep .getVersion ())) {
162165 return true ;
163166 }
164167
165168 } else if (rbs == ReleaseBranchStatus .ACTUAL ) {
166- if (!mDepRB .getCurrentVersion ().toPreviousPatch ().equals (mDep .getVersion ())) {
169+ if (!mDepRB .getHeadVersion ().toPreviousPatch ().equals (mDep .getVersion ())) {
167170 return true ;
168171 }
169172 } else {
@@ -225,7 +228,6 @@ public IAction getTagReleaseAction(String compName) {
225228 }
226229
227230 private IAction getTagReleaseActionRoot (Component comp , List <IAction > childActions ) {
228- ReleaseBranch rb = new ReleaseBranch (comp );
229231 DelayedTagsFile cf = new DelayedTagsFile ();
230232 IVCS vcs = comp .getVCS ();
231233
@@ -234,24 +236,24 @@ private IAction getTagReleaseActionRoot(Component comp, List<IAction> childActio
234236 if (delayedRevisionToTag == null ) {
235237 return new ActionNone (comp , childActions , "no delayed tags" );
236238 }
237-
239+
240+ ReleaseBranch rb = new ReleaseBranch (comp );
238241 List <VCSTag > tagsOnRevision = vcs .getTagsOnRevision (delayedRevisionToTag );
239242 if (tagsOnRevision .isEmpty ()) {
240- return new SCMActionTagRelease (comp , childActions , options );
243+ return new SCMActionTagRelease (comp , rb , childActions , options );
241244 }
242245 Version delayedTagVersion = new Version (vcs .getFileContent (rb .getName (), SCMReleaser .VER_FILE_NAME , delayedRevisionToTag ));
243246 for (VCSTag tag : tagsOnRevision ) {
244247 if (tag .getTagName ().equals (delayedTagVersion .toReleaseString ())) {
245248 return new ActionNone (comp , childActions , "tag " + tag .getTagName () + " already exists" );
246249 }
247250 }
248- return new SCMActionTagRelease (comp , childActions , options );
251+ return new SCMActionTagRelease (comp , rb , childActions , options );
249252 }
250253
251254 public static TagDesc getTagDesc (String verStr ) {
252- String tagName = verStr ;
253- String tagMessage = tagName + " release" ;
254- return new TagDesc (tagName , tagMessage );
255+ String tagMessage = verStr + " release" ;
256+ return new TagDesc (verStr , tagMessage );
255257 }
256258
257259 public List <Option > getOptions () {
0 commit comments