mercurial/context.py
changeset 30040 3e3f2201bbdf
parent 30023 ff17dff99295
child 30270 e25ce44f8447
--- a/mercurial/context.py	Sun Oct 02 05:29:17 2016 +0530
+++ b/mercurial/context.py	Sat Oct 01 14:18:58 2016 +0100
@@ -930,7 +930,7 @@
         def lines(text):
             if text.endswith("\n"):
                 return text.count("\n")
-            return text.count("\n") + 1
+            return text.count("\n") + int(bool(text))
 
         if linenumber:
             def decorate(text, rev):