diff --git a/reno/config.py b/reno/config.py index 7174726..db8eca4 100644 --- a/reno/config.py +++ b/reno/config.py @@ -167,7 +167,7 @@ _OPTIONS = [ "base" of a branch. Other branches are ignored. """)), - Opt('closed_branch_tag_re', '(.+)-eol', + Opt('closed_branch_tag_re', '(.+)-eo[lm]', textwrap.dedent("""\ The pattern for names for tags that replace closed branches that are relevant when scanning history to diff --git a/reno/scanner.py b/reno/scanner.py index 0891e7b..d8b0d6c 100644 --- a/reno/scanner.py +++ b/reno/scanner.py @@ -555,6 +555,9 @@ class Scanner(object): 'refs/tags/' + name, # If a stable branch was removed, look for its EOL tag. 'refs/tags/' + (name.rpartition('/')[-1] + '-eol'), + # If a stable branch was moved to unmaintained, look + # for its EOM tag. EOL will have precedence if exists. + 'refs/tags/' + (name.rpartition('/')[-1] + '-eom'), # If someone is using the "short" name for a branch # without a local tracking branch, look to see if the # name exists on the 'origin' remote. diff --git a/reno/tests/test_scanner.py b/reno/tests/test_scanner.py index ded425d..4cc5e83 100644 --- a/reno/tests/test_scanner.py +++ b/reno/tests/test_scanner.py @@ -1874,6 +1874,8 @@ class GetRefTest(Base): self.repo.git('tag', '-s', '-m', 'first tag', '1.0.0') self.repo.git('branch', 'stable/foo') self.repo.git('tag', 'bar-eol') + self.repo.git('tag', 'bar-eom') + self.repo.git('tag', 'baz-eom') self.scanner = scanner.Scanner(self.c) def tearDown(self): @@ -1895,6 +1897,11 @@ class GetRefTest(Base): expected = self.scanner._repo.head() self.assertEqual(expected, ref) + def test_eom_tag_from_branch(self): + ref = self.scanner._get_ref('stable/baz') + expected = self.scanner._repo.head() + self.assertEqual(expected, ref) + def test_head(self): ref = self.scanner._get_ref(None) expected = self.scanner._repo.head()