changeset 49026:2d519511c5c3

extensions: use new function for getting first line of string Differential Revision: https://phab.mercurial-scm.org/D12409
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 24 Mar 2022 22:05:13 -0700
parents f808417db5cc
children 0f0e3830c099
files mercurial/extensions.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/extensions.py	Thu Mar 24 22:04:38 2022 -0700
+++ b/mercurial/extensions.py	Thu Mar 24 22:05:13 2022 -0700
@@ -831,7 +831,7 @@
     for name, path in paths.items():
         doc = _disabledhelp(path)
         if doc and name != b'__index__':
-            exts[name] = doc.splitlines()[0]
+            exts[name] = stringutil.firstline(doc)
 
     return exts
 
@@ -935,7 +935,7 @@
         assert doc is not None  # help pytype
         if shortname:
             ename = ename.split(b'.')[-1]
-        exts[ename] = doc.splitlines()[0].strip()
+        exts[ename] = stringutil.firstline(doc).strip()
 
     return exts