updated to new protobuf file
This commit is contained in:
parent
ae8fd94a2c
commit
abdcd1fc62
|
@ -13,7 +13,7 @@ import (
|
|||
)
|
||||
|
||||
// returns bad if patches can not be applied
|
||||
func dumpPatchset(pset *forgepb.Patchs) bool {
|
||||
func dumpPatchset(pset *forgepb.Patchset) bool {
|
||||
log.Info("applyPatches() NAME", pset.Name)
|
||||
log.Info("applyPatches() COMMENT", pset.Comment)
|
||||
log.Info("applyPatches() GIT_AUTHOR_NAME", pset.GetGitAuthorName())
|
||||
|
@ -85,7 +85,7 @@ func countCurrentPatches(repo *gitpb.Repo) int {
|
|||
return len(result.Stdout)
|
||||
}
|
||||
|
||||
func applyPatchset(pset *forgepb.Patchs) error {
|
||||
func applyPatchset(pset *forgepb.Patchset) error {
|
||||
var everythingworked bool = true
|
||||
tmpdir, err := os.MkdirTemp("", "forge")
|
||||
if err != nil {
|
||||
|
@ -132,7 +132,7 @@ func applyPatchset(pset *forgepb.Patchs) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func readPatchFile(pbfile string) (*forgepb.Patchs, error) {
|
||||
func readPatchFile(pbfile string) (*forgepb.Patchset, error) {
|
||||
bytes, err := os.ReadFile(pbfile)
|
||||
if err != nil {
|
||||
log.Info("readfile error", pbfile, err)
|
||||
|
@ -141,9 +141,9 @@ func readPatchFile(pbfile string) (*forgepb.Patchs, error) {
|
|||
return handleBytes(bytes)
|
||||
}
|
||||
|
||||
func handleBytes(bytes []byte) (*forgepb.Patchs, error) {
|
||||
var pset *forgepb.Patchs
|
||||
pset = new(forgepb.Patchs)
|
||||
func handleBytes(bytes []byte) (*forgepb.Patchset, error) {
|
||||
var pset *forgepb.Patchset
|
||||
pset = new(forgepb.Patchset)
|
||||
err := pset.Unmarshal(bytes)
|
||||
if err != nil {
|
||||
log.Info("Unmarshal failed", err)
|
||||
|
|
|
@ -43,12 +43,7 @@ func doConfig() {
|
|||
UserBranchName: argv.Config.Add.User,
|
||||
}
|
||||
|
||||
if me.forge.Config.Append(&new1) {
|
||||
log.Info("added", new1.GoPath, "ok")
|
||||
} else {
|
||||
log.Info("added", new1.GoPath, "failed")
|
||||
os.Exit(-1)
|
||||
}
|
||||
me.forge.Config.Append(&new1)
|
||||
me.forge.ConfigSave()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
|
8
send.go
8
send.go
|
@ -12,7 +12,7 @@ import (
|
|||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
func sendPatches(pset *forgepb.Patchs) error {
|
||||
func sendPatches(pset *forgepb.Patchset) error {
|
||||
var url string
|
||||
url = me.urlbase + "/patchset"
|
||||
msg, err := pset.Marshal()
|
||||
|
@ -91,7 +91,7 @@ func doRegister(newurl string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func getPatch(pbfile string) (*forgepb.Patchs, error) {
|
||||
func getPatch(pbfile string) (*forgepb.Patchset, error) {
|
||||
url := me.urlbase + "/patchsetget?filename=" + pbfile
|
||||
log.Info("getPatch() url", url)
|
||||
body, err := httpPost(url, nil)
|
||||
|
@ -100,8 +100,8 @@ func getPatch(pbfile string) (*forgepb.Patchs, error) {
|
|||
return nil, err
|
||||
}
|
||||
log.Info("getPatch() len(body)", len(body))
|
||||
var pset *forgepb.Patchs
|
||||
pset = new(forgepb.Patchs)
|
||||
var pset *forgepb.Patchset
|
||||
pset = new(forgepb.Patchset)
|
||||
err = pset.Unmarshal(body)
|
||||
if err != nil {
|
||||
log.Info("Unmarshal failed", err)
|
||||
|
|
Loading…
Reference in New Issue