changeset 6851:d892efaa3615

obslog: clean up a condition and reorder its branches The `is True` check is discouraged, and we move the tiny branch first for clarity. This precludes a larger cleanup and refactoring.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 22 Sep 2024 12:06:03 +0200
parents 6d22e9a596c4
children 120f0ad4646c
files hgext3rd/evolve/obshistory.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obshistory.py	Sat Sep 28 16:09:03 2024 +0400
+++ b/hgext3rd/evolve/obshistory.py	Sun Sep 22 12:06:03 2024 +0200
@@ -681,7 +681,9 @@
         _patchavailable = patchavailable(node, repo, nodes,
                                          successive=successive)
 
-        if _patchavailable[0] is True:
+        if not _patchavailable[0]:
+            fm.data(nopatchreason=_patchavailable[1])
+        else:
             diffnode = _patchavailable[1]
 
             if successive:
@@ -729,8 +731,6 @@
                     linestart = True
                 ui.write(chunk, label=label)
             fm.data(patch=ui.popbuffer())
-        else:
-            fm.data(nopatchreason=_patchavailable[1])
 
 def _prepare_hunk(hunk):
     """Drop all information but the username and patch"""