MarkTraceur has submitted this change and it was merged.

Change subject: Commit template change for inline comments
......................................................................


Commit template change for inline comments

Also fix error with inlineCount

Change-Id: I6b89871707082d7085989cc5300fbfd66c77b2f8
---
M src/preprocess.js
M src/template.txt
2 files changed, 5 insertions(+), 2 deletions(-)

Approvals:
  MarkTraceur: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/preprocess.js b/src/preprocess.js
index 8355037..e4cd642 100644
--- a/src/preprocess.js
+++ b/src/preprocess.js
@@ -60,7 +60,7 @@
         url: message.change.url,
         owner: message.change.owner.name
     };
-    var inlineCount = message.comment.match(/(?:^|\s)\((\d+) 
comments\)(?:$|\s)/)[1],
+    var inlineCount = message.comment.match(/(?:^|\s)\((\d+) 
comments\)(?:$|\s)/),
         comment = message.comment
         // Strip out useless first line
         .replace(/^\s*Patch Set \d+:.*$/m, '')
@@ -73,7 +73,7 @@
         comment = '"' + comment.substring(0, 138) + '"';
     }
     if(inlineCount) {
-        ret.inlineComments = inlineCount;
+        ret.inlineComments = inlineCount[1];
     }
     ret.message = comment;
     if(message.approvals) {
diff --git a/src/template.txt b/src/template.txt
index c22db3f..c905019 100644
--- a/src/template.txt
+++ b/src/template.txt
@@ -13,6 +13,9 @@
         {%- endfor -%}]
     {% endif %}
     {{message}} 
+    {% if inlineComments -%}
+        ({{inlineComments|color('bold.green')}} comments)
+    {% endif %}
     [{{repo}}]
     {% if branch %} ({{branch}}) {% endif %}
     - {{url|color('teal')}}

-- 
To view, visit https://gerrit.wikimedia.org/r/95661
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6b89871707082d7085989cc5300fbfd66c77b2f8
Gerrit-PatchSet: 2
Gerrit-Project: labs/tools/grrrit
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to