Add new copy votes policy for merge commits

Adds new 'copyAllScoresOnMergeFirstParentUpdate' vote policy. This
policy allows to carry over votes on "merge commit rebase". This meas
when only first (left parent) changes and rest of parent(s) stays the
same.

Such policy is useful for changes that are merge commit of feature
branches that tracks destination branch. When it is enabled it reduces
the overhead of CI and human reviews on merge commits that only
incorporate newer changes from destination branch in next patch set.

Change-Id: I02062544608546498d9605c628bc1b7a0386e91a
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:
Dariusz Luksza
2016-01-29 12:06:20 +01:00
parent 6f86343193
commit cedbbee78e
7 changed files with 69 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ public class LabelType {
public static final boolean DEF_COPY_ALL_SCORES_IF_NO_CHANGE = true;
public static final boolean DEF_COPY_ALL_SCORES_IF_NO_CODE_CHANGE = false;
public static final boolean DEF_COPY_ALL_SCORES_ON_TRIVIAL_REBASE = false;
public static final boolean DEF_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATE = false;
public static final boolean DEF_COPY_MAX_SCORE = false;
public static final boolean DEF_COPY_MIN_SCORE = false;
@@ -99,6 +100,7 @@ public class LabelType {
protected String functionName;
protected boolean copyMinScore;
protected boolean copyMaxScore;
protected boolean copyAllScoresOnMergeFirstParentUpdate;
protected boolean copyAllScoresOnTrivialRebase;
protected boolean copyAllScoresIfNoCodeChange;
protected boolean copyAllScoresIfNoChange;
@@ -138,6 +140,8 @@ public class LabelType {
setCopyAllScoresIfNoChange(DEF_COPY_ALL_SCORES_IF_NO_CHANGE);
setCopyAllScoresIfNoCodeChange(DEF_COPY_ALL_SCORES_IF_NO_CODE_CHANGE);
setCopyAllScoresOnTrivialRebase(DEF_COPY_ALL_SCORES_ON_TRIVIAL_REBASE);
setCopyAllScoresOnMergeFirstParentUpdate(
DEF_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATE);
setCopyMaxScore(DEF_COPY_MAX_SCORE);
setCopyMinScore(DEF_COPY_MIN_SCORE);
}
@@ -217,6 +221,16 @@ public class LabelType {
this.copyMaxScore = copyMaxScore;
}
public boolean isCopyAllScoresOnMergeFirstParentUpdate() {
return copyAllScoresOnMergeFirstParentUpdate;
}
public void setCopyAllScoresOnMergeFirstParentUpdate(
boolean copyAllScoresOnMergeFirstParentUpdate) {
this.copyAllScoresOnMergeFirstParentUpdate =
copyAllScoresOnMergeFirstParentUpdate;
}
public boolean isCopyAllScoresOnTrivialRebase() {
return copyAllScoresOnTrivialRebase;
}