summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--argv.go5
-rw-r--r--doSubmitPatch.go13
-rw-r--r--main.go5
-rw-r--r--windowPatches.go6
4 files changed, 19 insertions, 10 deletions
diff --git a/argv.go b/argv.go
index 524b7bb..3d0b617 100644
--- a/argv.go
+++ b/argv.go
@@ -37,8 +37,9 @@ type EmptyCmd struct {
type testCmd string
type PatchCmd struct {
- List *EmptyCmd `arg:"subcommand:list" help:"list available patches"`
- Show *EmptyCmd `arg:"subcommand:show" help:"show a specific patch"`
+ List *EmptyCmd `arg:"subcommand:list" help:"list available patches"`
+ Show *EmptyCmd `arg:"subcommand:show" help:"show a specific patch"`
+ Submit string `arg:"--submit" help:"name of patchset"`
}
type ConfigAddCmd struct {
diff --git a/doSubmitPatch.go b/doSubmitPatch.go
new file mode 100644
index 0000000..8f7b6dd
--- /dev/null
+++ b/doSubmitPatch.go
@@ -0,0 +1,13 @@
+package main
+
+import (
+ "go.wit.com/log"
+)
+
+func doSubmit(name string) {
+ if err := sendDevelDiff(name); err != nil {
+ log.Info("sending patches failed", err)
+ } else {
+ log.Info("sent patch set ok")
+ }
+}
diff --git a/main.go b/main.go
index 4312d33..93e7427 100644
--- a/main.go
+++ b/main.go
@@ -172,9 +172,8 @@ func main() {
okExit("")
}
if argv.Patch != nil {
- if argv.Patch.Show != nil {
- sendDevelDiff("fixme")
- // sendMasterDiff()
+ if argv.Patch.Submit != "" {
+ doSubmit(argv.Patch.Submit)
okExit("")
}
diff --git a/windowPatches.go b/windowPatches.go
index d9bfd9e..b137454 100644
--- a/windowPatches.go
+++ b/windowPatches.go
@@ -71,11 +71,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
}
}
s.submitB = s.grid.NewButton("Submit", func() {
- if err := sendDevelDiff(s.reason.String()); err != nil {
- log.Info("sending patches failed", err)
- } else {
- log.Info("sent patch set ok")
- }
+ doSubmit(s.reason.String())
})
s.grid.NewButton("List Patchsets", func() {