Patchwork D12409: extensions: use new function for getting first line of string

login
register
mail settings
Submitter phabricator
Date March 25, 2022, 5:38 a.m.
Message ID <differential-rev-PHID-DREV-bocz42iwebmx3mkm4vb6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50752/
State New
Headers show

Comments

phabricator - March 25, 2022, 5:38 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12409

AFFECTED FILES
  mercurial/extensions.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -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