builder.span('class':'project') {\r
mkp.yield "$type "\r
span('class': 'repository', name )\r
- mkp.yield " $action ($number commits)"\r
+ if (number > 0) {\r
+ mkp.yield " $action ($number commits)"\r
+ } else {\r
+ mkp.yield " $action"\r
+ }\r
}\r
}\r
}\r
\r
}\r
\r
- def writeCommitTable(commits) {\r
+ def writeCommitTable(commits, includeChangedPaths=true) {\r
// Write commits table\r
builder.table('class':"table table-disable-hover") {\r
thead {\r
for (commit in commits) {\r
writeCommit(commit)\r
\r
- // Write detail on that particular commit\r
- tr('class' : 'noborder') {\r
- td (colspan: includeGravatar ? 3 : 2)\r
- td (colspan:2) { writeStatusTable(commit) }\r
- }\r
+ if (includeChangedPaths) {\r
+ // Write detail on that particular commit\r
+ tr('class' : 'noborder') {\r
+ td (colspan: includeGravatar ? 3 : 2)\r
+ td (colspan:2) { writeStatusTable(commit) }\r
+ }\r
+ }\r
}\r
}\r
}\r
\r
switch (command.type) {\r
case ReceiveCommand.Type.CREATE:\r
- def commits = JGitUtils.getRevLog(repository, command.oldId.name, command.newId.name).reverse()\r
- commitCount += commits.size()\r
- // new branch\r
- // Write header\r
- writeBranchTitle(refType, ref, "created", commits.size())\r
- writeCommitTable(commits)\r
+ def commits = JGitUtils.getRevLog(repository, command.oldId.name, command.newId.name).reverse()\r
+ commitCount += commits.size()\r
+ if (refType == 'Branch') {\r
+ // new branch\r
+ writeBranchTitle(refType, ref, "created", commits.size())\r
+ writeCommitTable(commits, true)\r
+ } else {\r
+ // new tag\r
+ writeBranchTitle(refType, ref, "created", 0)\r
+ writeCommitTable(commits, false)\r
+ }\r
break\r
case ReceiveCommand.Type.UPDATE:\r
def commits = JGitUtils.getRevLog(repository, command.oldId.name, command.newId.name).reverse()\r