Skip to content

Commit ddd5dcf

Browse files
committed
merge new commits from post-release-fix to release branch before doing normal mpush tasks
1 parent a204254 commit ddd5dcf

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

bin/git-mpush

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ BEGIN {
3838

3939
use EnsEMBL::Git;
4040
use Getopt::Long;
41-
# use List::MoreUtils qw(uniq);
41+
use List::MoreUtils qw(uniq);
4242

4343
run();
4444

@@ -114,31 +114,28 @@ sub run {
114114
update_branch($_, $remote);
115115
}
116116

117-
=head
118-
# For Pull Requests (atm it works without this)
117+
# For Pull Requests
119118
my $no_merge = 1;
119+
# get all commits in PRfix that are not in master or release branches
120120
my $prf_commits_master = commits_list($master_branch, $post_release_fix_branch, $no_merge);
121121
my $prf_commits_release = commits_list($release_branch, $post_release_fix_branch, $no_merge);
122122
my @prf_commits = uniq(@$prf_commits_release, @$prf_commits_master);
123-
info("Checking $post_release_fix_branch for any commits");
123+
info("Checking $post_release_fix_branch for new commits");
124124
if ($#prf_commits >= 0) {
125125
info(join "\n", "Found commits in $post_release_fix_branch:", @prf_commits);
126-
info("Do you want to merge them to $release_branch? (y/n)");
126+
info("Going to merge above commits to $release_branch. Press any key to continue");
127127
my $user_input = <>;
128-
if ($user_input =~/y|yes/i) {
129-
switch_branch($release_branch);
130-
if (!ff_merge($post_release_fix_branch)) {
131-
error("Could not merge branch '$post_release_fix_branch' to '$release_branch'.");
132-
}
133-
else {
134-
info("DONE: Merging '$post_release_fix_branch' to '$release_branch'");
135-
}
128+
switch_branch($release_branch);
129+
if(!merge_branch($post_release_fix_branch)) {
130+
error("Could not merge branch '$post_release_fix_branch' to '$release_branch'.");
136131
}
137132
else {
138-
info("OK, not merging.");
133+
info("DONE: Merging '$post_release_fix_branch' to '$release_branch'");
139134
}
140135
}
141-
=cut
136+
else {
137+
info("No new commits on $post_release_fix_branch");
138+
}
142139

143140
# Find out the branch that contains commits that need to be pushed
144141
my $branch_with_commits = {};

0 commit comments

Comments
 (0)