Add --project and --branch parameters on the topic-changed hook

It is currently not possible to distinguish which change the hook
is called on if the same Change-Id is used on multiple changes on
different projects or branches.

Add --project and --branch parameters on the hook.

Bug: Issue 2243
Change-Id: I71240017a0ca60ba223435ecc4b6a7e875a72fc0
This commit is contained in:
David Pursehouse
2013-11-07 15:21:41 +09:00
parent 7faa5260c9
commit 3f6563d0a3
2 changed files with 3 additions and 1 deletions

View File

@@ -126,7 +126,7 @@ topic-changed
Called whenever a change's topic is changed from the Web UI or via the REST API.
====
topic-changed --change <change id> --changer <changer> --old-topic <old topic> --new-topic <new topic>
topic-changed --change <change id> --project <project name> --branch <branch> --changer <changer> --old-topic <old topic> --new-topic <new topic>
====
cla-signed

View File

@@ -582,6 +582,8 @@ public class ChangeHookRunner implements ChangeHooks, LifecycleListener {
final List<String> args = new ArrayList<String>();
addArg(args, "--change", event.change.id);
addArg(args, "--project", event.change.project);
addArg(args, "--branch", event.change.branch);
addArg(args, "--changer", getDisplayName(account));
addArg(args, "--old-topic", oldTopic);
addArg(args, "--new-topic", event.change.topic);