# HG changeset patch # User Pierre-Yves David # Date 1726999563 -7200 # Node ID d892efaa3615c4e3ac184452292709824951b018 # Parent 6d22e9a596c472548a30697a6d2a052c252d091b 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. diff -r 6d22e9a596c4 -r d892efaa3615 hgext3rd/evolve/obshistory.py --- 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"""