Show branch in commit notices in (github.py)
This commit is contained in:
parent
e1cff13dbe
commit
4ad35006c0
1 changed files with 6 additions and 4 deletions
|
@ -91,6 +91,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
def push(self, event, full_name, data):
|
def push(self, event, full_name, data):
|
||||||
outputs = []
|
outputs = []
|
||||||
|
branch = data["ref"].split("/", 2)[2]
|
||||||
if len(data["commits"]) <= 3:
|
if len(data["commits"]) <= 3:
|
||||||
for commit in data["commits"]:
|
for commit in data["commits"]:
|
||||||
id = self._short_hash(commit["id"])
|
id = self._short_hash(commit["id"])
|
||||||
|
@ -103,8 +104,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
removed = self._removed(len(commit["removed"]))
|
removed = self._removed(len(commit["removed"]))
|
||||||
modified = self._modified(len(commit["modified"]))
|
modified = self._modified(len(commit["modified"]))
|
||||||
|
|
||||||
outputs.append("[%s/%s/%s files] commit by '%s': %s - %s"
|
outputs.append("[%s/%s/%s files] commit by %s to %s: %s - %s"
|
||||||
% (added, removed, modified, author, message, url))
|
% (added, removed, modified, author, branch, message, url))
|
||||||
else:
|
else:
|
||||||
branch = data["ref"].split("/", 2)[2]
|
branch = data["ref"].split("/", 2)[2]
|
||||||
first_id = self._short_hash(data["before"])
|
first_id = self._short_hash(data["before"])
|
||||||
|
@ -118,8 +119,9 @@ class Module(ModuleManager.BaseModule):
|
||||||
modified = self._modified(len(self._flat_unique(commits,
|
modified = self._modified(len(self._flat_unique(commits,
|
||||||
"modified")))
|
"modified")))
|
||||||
|
|
||||||
outputs.append("[%s/%s/%s files] '%s' pushed %d commits - %s"
|
outputs.append("[%s/%s/%s files] %s pushed %d commits to %s - %s"
|
||||||
% (added, removed, modified, pusher, len(data["commits"]), url))
|
% (added, removed, modified, pusher, len(data["commits"]),
|
||||||
|
branch, url))
|
||||||
|
|
||||||
return outputs
|
return outputs
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue