Add --is-draft argument on patchset-created hook

The `--is-draft` argument will be passed with either `true` if
the patchset is a draft, or `false` otherwise.

This can be used by hooks that need to behave differently if the
change is a draft.

Change-Id: Idd00efe799bb05b0fd00e917faaccd5c772b1e1f
This commit is contained in:
David Pursehouse 2012-09-18 21:44:18 +09:00 committed by Gustaf Lundh
parent a80e3f9037
commit eb081dcfbf
2 changed files with 2 additions and 1 deletions

View File

@ -27,7 +27,7 @@ This is called whenever a patchset is created (this includes new
changes and drafts).
====
patchset-created --change <change id> --change-url <change url> --project <project name> --branch <branch> --topic <topic> --uploader <uploader> --commit <sha1> --patchset <patchset id>
patchset-created --change <change id> --is-draft <boolean> --change-url <change url> --project <project name> --branch <branch> --topic <topic> --uploader <uploader> --commit <sha1> --patchset <patchset id>
====
draft-published

View File

@ -232,6 +232,7 @@ public class ChangeHookRunner implements ChangeHooks {
final List<String> args = new ArrayList<String>();
addArg(args, "--change", event.change.id);
addArg(args, "--is-draft", patchSet.isDraft() ? "true" : "false");
addArg(args, "--change-url", event.change.url);
addArg(args, "--project", event.change.project);
addArg(args, "--branch", event.change.branch);