Skip to content

Commit

Permalink
[SCM-977] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsbasjes committed May 20, 2022
1 parent 2960c8f commit a52f1a6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ public void initRepo()
{
HgRepoUtils.initRepo();
}

@Override
public boolean aTagIsAnExtraCommit()
{
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ public abstract class ChangeLogCommandTckTest
private static final String COMMIT_MSG = "Second changelog";
private static final String COMMIT_TAG = "v3.14";

/**
* In some SCMs (HG) adding a tag creates an extra commit which offsets the expectations.
* @return If an extra commit will be present for a tag.
*/
public boolean aTagIsAnExtraCommit()
{
return false;
}

public void testChangeLogCommand()
throws Exception
{
Expand Down Expand Up @@ -93,9 +102,9 @@ public void testChangeLogCommand()
boolean lastCommitIsCausedByTagging = false;
int lastCodeCommitIndex = 0;

if ( changeSets.get( 0 ).getTags().contains( "tip" ) )
if ( aTagIsAnExtraCommit() )
{
// This is Mercurial which creates an extra commit after tagging.
// This is for example Mercurial which creates an extra commit after tagging.
lastCommitIsCausedByTagging = true;
expectedChangeSets += 1;
lastCodeCommitIndex = 1;
Expand Down

0 comments on commit a52f1a6

Please sign in to comment.