Skip to content
This repository was archived by the owner on Jan 22, 2018. It is now read-only.

Commit c3d42b1

Browse files
committed
Pass branch name to push-tags script, filter tags for the current release branch
1 parent 3f5f326 commit c3d42b1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

push-tags

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env php
22
<?php
33

4+
if (empty($GLOBALS['argv']['1'])) {
5+
throw new Exception("Invalid branch name");
6+
}
7+
8+
list($major, $minor) = explode('.', $GLOBALS['argv']['1']);
9+
410
define('UPSTREAM_REPOSITORY', 'https://git.drupal.org/project/drupal.git');
511
define('UPSTREAM_DIRECTORY', 'upstream');
612
define('DOWNSTREAM_REPOSITORY', exec('git config --get remote.origin.url'));
@@ -18,19 +24,19 @@ $blacklist = array(
1824
'8.0.0-beta5',
1925
);
2026

21-
function filter_valid_tags($upstream_tags, $blacklist) {
27+
function filter_valid_tags($upstream_tags, $blacklist, $major, $minor) {
2228
$tags = array();
2329
foreach ($upstream_tags as $tag) {
24-
preg_match('/refs\/tags\/(8\.[0-9]+\.[0-9]+[^\^\{}\n]*)/', $tag, $value);
30+
preg_match('/refs\/tags\/(' . $major . '\.' . $minor . '\.[0-9]+[^\^\{}\n]*)/', $tag, $value);
2531
if (isset($value[1]) && !in_array($value[1], $blacklist)) {
2632
$tags[] = $value[1];
2733
}
2834
}
2935
return array_unique($tags);
3036
}
3137

32-
$upstream_tags = filter_valid_tags($upstream_tags, $blacklist);
33-
$downstream_tags = filter_valid_tags($downstream_tags, $blacklist);
38+
$upstream_tags = filter_valid_tags($upstream_tags, $blacklist, $major, $minor);
39+
$downstream_tags = filter_valid_tags($downstream_tags, $blacklist, $major, $minor);
3440

3541
// Tags thats are not in the downstream repo.
3642
$tags = array_diff($upstream_tags, $downstream_tags);

update.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function update_subtree_split {
1111
git clean -fd
1212
cd $BASEDIR
1313
./subtree-split push branch $1
14-
./push-tags
14+
./push-tags $1
1515
rm -rf ./upstream/.git/subtree-cache
1616
}
1717

0 commit comments

Comments
 (0)