summaryrefslogtreecommitdiff
path: root/ideas/revert.go
blob: 5a080e97def1191977b1c0b812ae68b0df3301cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package repostatus

// 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()
	dName := rs.GetDevelBranchName()
	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())

	var all [][]string
	all = append(all, []string{"git", "checkout", dName}) // switch to the devel branch
	all = append(all, []string{"git", "branch", "-D", mName})
	all = append(all, []string{"git", "branch", mName}) // make a master branch based on devel
	all = append(all, []string{"git", "checkout", mName})
	all = append(all, []string{"git", "push", "--set-upstream", "--force", "origin", mName})

	// don't do anything with tags here
	// 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
}
*/