.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)
|
||||
return
|
||||
}
|
||||
var m *forgepb.Patchs
|
||||
m = new(forgepb.Patchs)
|
||||
var m *forgepb.Patchset
|
||||
m = new(forgepb.Patchset)
|
||||
if err := m.Unmarshal(data); err != nil {
|
||||
msg := fmt.Sprintf("proto.Unmarshal() failed on %s len=%d\n", filename, len(data))
|
||||
fmt.Printf(msg)
|
||||
|
@ -62,8 +62,8 @@ func listPatchsets(w http.ResponseWriter) {
|
|||
fmt.Println(entry.Name(), err)
|
||||
continue
|
||||
}
|
||||
var p *forgepb.Patchs
|
||||
p = new(forgepb.Patchs)
|
||||
var p *forgepb.Patchset
|
||||
p = new(forgepb.Patchset)
|
||||
err = p.Unmarshal(bytes)
|
||||
if err != nil {
|
||||
fmt.Fprintln(w, entry.Name(), err)
|
||||
|
@ -80,8 +80,8 @@ func listPatchsets(w http.ResponseWriter) {
|
|||
|
||||
func savePatchset(w http.ResponseWriter, msg []byte) {
|
||||
log.Info("proto.Unmarshal() try message len", len(msg))
|
||||
var m *forgepb.Patchs
|
||||
m = new(forgepb.Patchs)
|
||||
var m *forgepb.Patchset
|
||||
m = new(forgepb.Patchset)
|
||||
if err := m.Unmarshal(msg); err != nil {
|
||||
log.Info("proto.Unmarshal() failed on wire message len", len(msg))
|
||||
log.Info("error =", err)
|
||||
|
@ -89,7 +89,7 @@ func savePatchset(w http.ResponseWriter, msg []byte) {
|
|||
}
|
||||
log.Info("GOT patchset:", len(msg))
|
||||
fmt.Fprintln(w, "GOT patchset:", len(msg))
|
||||
all := m.SortByFilename()
|
||||
all := m.Patches.SortByFilename()
|
||||
for all.Scan() {
|
||||
repo := all.Next()
|
||||
log.Info("filename:", repo.Filename)
|
||||
|
|
Loading…
Reference in New Issue