Skip to content

Commit

Permalink
chore: temporary working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
codejedi365 committed Apr 29, 2024
1 parent 9760444 commit 99fcbfa
Show file tree
Hide file tree
Showing 2 changed files with 579 additions and 9 deletions.
49 changes: 40 additions & 9 deletions tests/fixtures/repos/git_flow/repo_w_3_release_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,21 @@ def _build_git_flow_repo_w_3_release_channels(
git_repo, next_version_def["commits"], hvcs
)

# Grab reference to main branch
main_branch_head = git_repo.heads.main

# Make initial feature release (v0.1.0)
create_release_tagged_commit(git_repo, next_version, tag_format)

# Increment version pointer
next_version = next(versions)
next_version_def = repo_def[next_version]

# Prepare for a prerelease
# Change to a dev branch
dev_branch_head = git_repo.create_head("dev")
dev_branch_head.checkout()

# Prepare for a prerelease (direct commit to dev branch)
next_version_def["commits"] = simulate_change_commits_n_rtn_changelog_entry(
git_repo, next_version_def["commits"], hvcs
)
Expand All @@ -291,35 +298,59 @@ def _build_git_flow_repo_w_3_release_channels(
next_version = next(versions)
next_version_def = repo_def[next_version]

# Change to a feature branch
feat_branch_head = git_repo.create_head("breaking-feature")
feat_branch_head.checkout()

# Prepare for a major feature release
next_version_def["commits"] = simulate_change_commits_n_rtn_changelog_entry(
git_repo, next_version_def["commits"], hvcs
)

# check out dev branch (in prep for merge)
dev_branch_head.checkout()

# Merge feature branch into dev
git_repo.git.merge(
feat_branch_head.name,
"--no-ff",
m=f"Merge branch '{feat_branch_head.name}' into '{dev_branch_head.name}'"
)

# Make a major feature release candidate (v1.0.0-rc.1)
create_release_tagged_commit(git_repo, next_version, tag_format)

# Increment version pointer
next_version = next(versions)
next_version_def = repo_def[next_version]

# Add non-breaking feature commit
# Add non-breaking feature commit (directly to dev)
next_version_def["commits"] = simulate_change_commits_n_rtn_changelog_entry(
git_repo, next_version_def["commits"], hvcs
)

# check out main branch (in prep for merge)
main_branch_head.checkout()

# Merge dev branch into main
git_repo.git.merge(
dev_branch_head.name,
"--no-ff",
m=f"Merge branch '{dev_branch_head.name}' into 'main'"
)

# Make a major feature release (v1.0.0)
create_release_tagged_commit(git_repo, next_version, tag_format)

# Increment version pointer
next_version = next(versions)
next_version_def = repo_def[next_version]

# Change to a dev branch
git_repo.create_head("dev")
git_repo.heads.dev.checkout()
# fast-forward update dev branch
dev_branch_head.checkout()
git_repo.git.merge(main_branch_head.name, "--ff-only")

# Prepare for a minor bump release candidate
# Prepare for a minor bump release candidate (direct to dev)
next_version_def["commits"] = simulate_change_commits_n_rtn_changelog_entry(
git_repo, next_version_def["commits"], hvcs
)
Expand All @@ -331,7 +362,7 @@ def _build_git_flow_repo_w_3_release_channels(
next_version = next(versions)
next_version_def = repo_def[next_version]

# Make a patch level commit
# Make a patch level commit (direct to dev branch)
next_version_def["commits"] = simulate_change_commits_n_rtn_changelog_entry(
git_repo, next_version_def["commits"], hvcs
)
Expand All @@ -344,8 +375,8 @@ def _build_git_flow_repo_w_3_release_channels(
next_version_def = repo_def[next_version]

# Change to a feature branch
git_repo.create_head("feature")
git_repo.heads.feature.checkout()
feat_branch_head = git_repo.create_head("feature")
feat_branch_head.checkout()

# Make a feature commit
next_version_def["commits"] = simulate_change_commits_n_rtn_changelog_entry(
Expand Down

0 comments on commit 99fcbfa

Please sign in to comment.