.proto changes
This commit is contained in:
parent
73ef74d479
commit
7fa4889dce
14
patchsets.go
14
patchsets.go
|
@ -27,8 +27,8 @@ func getPatchset(w http.ResponseWriter, pbname string) {
|
||||||
fmt.Fprintf(w, msg)
|
fmt.Fprintf(w, msg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var m *forgepb.Patchs
|
var m *forgepb.Patchset
|
||||||
m = new(forgepb.Patchs)
|
m = new(forgepb.Patchset)
|
||||||
if err := m.Unmarshal(data); err != nil {
|
if err := m.Unmarshal(data); err != nil {
|
||||||
msg := fmt.Sprintf("proto.Unmarshal() failed on %s len=%d\n", filename, len(data))
|
msg := fmt.Sprintf("proto.Unmarshal() failed on %s len=%d\n", filename, len(data))
|
||||||
fmt.Printf(msg)
|
fmt.Printf(msg)
|
||||||
|
@ -62,8 +62,8 @@ func listPatchsets(w http.ResponseWriter) {
|
||||||
fmt.Println(entry.Name(), err)
|
fmt.Println(entry.Name(), err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var p *forgepb.Patchs
|
var p *forgepb.Patchset
|
||||||
p = new(forgepb.Patchs)
|
p = new(forgepb.Patchset)
|
||||||
err = p.Unmarshal(bytes)
|
err = p.Unmarshal(bytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(w, entry.Name(), err)
|
fmt.Fprintln(w, entry.Name(), err)
|
||||||
|
@ -80,8 +80,8 @@ func listPatchsets(w http.ResponseWriter) {
|
||||||
|
|
||||||
func savePatchset(w http.ResponseWriter, msg []byte) {
|
func savePatchset(w http.ResponseWriter, msg []byte) {
|
||||||
log.Info("proto.Unmarshal() try message len", len(msg))
|
log.Info("proto.Unmarshal() try message len", len(msg))
|
||||||
var m *forgepb.Patchs
|
var m *forgepb.Patchset
|
||||||
m = new(forgepb.Patchs)
|
m = new(forgepb.Patchset)
|
||||||
if err := m.Unmarshal(msg); err != nil {
|
if err := m.Unmarshal(msg); err != nil {
|
||||||
log.Info("proto.Unmarshal() failed on wire message len", len(msg))
|
log.Info("proto.Unmarshal() failed on wire message len", len(msg))
|
||||||
log.Info("error =", err)
|
log.Info("error =", err)
|
||||||
|
@ -89,7 +89,7 @@ func savePatchset(w http.ResponseWriter, msg []byte) {
|
||||||
}
|
}
|
||||||
log.Info("GOT patchset:", len(msg))
|
log.Info("GOT patchset:", len(msg))
|
||||||
fmt.Fprintln(w, "GOT patchset:", len(msg))
|
fmt.Fprintln(w, "GOT patchset:", len(msg))
|
||||||
all := m.SortByFilename()
|
all := m.Patches.SortByFilename()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
repo := all.Next()
|
repo := all.Next()
|
||||||
log.Info("filename:", repo.Filename)
|
log.Info("filename:", repo.Filename)
|
||||||
|
|
Loading…
Reference in New Issue