diff options
| author | Jeff Carr <[email protected]> | 2024-02-14 00:09:58 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-14 00:09:58 -0600 |
| commit | f7947b08b69b1a2f02168de511e7c8b005035221 (patch) | |
| tree | adae2c1f5b0bc546a078e1311b3e18b0a0636578 /revert.go | |
| parent | 95fd6ca05a28774ad374801984a4f62c202835d3 (diff) | |
code reorg and clean
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'revert.go')
| -rw-r--r-- | revert.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/revert.go b/revert.go new file mode 100644 index 0000000..22a6041 --- /dev/null +++ b/revert.go @@ -0,0 +1,45 @@ +package repostatus + +import "go.wit.com/log" + +// reverts master to devel +// used in the unwind process of making GUI releases +func (rs *RepoStatus) RevertMasterToDevel() bool { + if rs.CheckDirty() { + log.Info("sorry, it's still dirty") + return false + } + + curName := rs.GetCurrentBranchName() + mName := rs.GetMasterBranchName() + if curName != mName { + log.Info("repo is not working from main branch", curName, "!=", mName) + return false + } + + log.Info("reset master to devel", curName, rs.String()) + + // git checkout devel + // git branch -D master + // git branch master + // git checkout master + // git push --set-upstream --force origin master + + var all [][]string + all = append(all, []string{"git", "checkout", "devel"}) + all = append(all, []string{"git", "branch", "-D", mName}) + all = append(all, []string{"git", "branch", mName}) + all = append(all, []string{"git", "checkout", mName}) + all = append(all, []string{"git", "push", "--set-upstream", "--force", "origin", mName}) + + // all = append(all, []string{"git", "tag", "--delete", release.version.String()}) + // all = append(all, []string{"git", "push", "--delete", "origin", release.version.String()}) + + if rs.DoAll(all) { + log.Info("EVERYTHING OK. RERELEASED", rs.String()) + return true + } + + log.Info("SOMETHING FAILED") + return false +} |
