Patchwork [evolve-ext] evolve: clarify code in _singlesuccessor

login
register
mail settings
Submitter Laurent Charignon
Date June 23, 2015, 12:47 a.m.
Message ID <a6b72e1db6ff5743cdb7.1435020478@lcharignon-mbp.local>
Download mbox | patch
Permalink /patch/9758/
State Accepted
Delegated to: Pierre-Yves David
Headers show

Comments

Laurent Charignon - June 23, 2015, 12:47 a.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1435020392 25200
#      Mon Jun 22 17:46:32 2015 -0700
# Node ID a6b72e1db6ff5743cdb7ada37ef7c9d206b683d1
# Parent  4198e2fad6ba08c0798c217e7b643fae9c28e81b
evolve: clarify code in _singlesuccessor

Before this patch we were not very explicit with this while condition in
_singlesuccessor. This patch makes it more legible.
Pierre-Yves David - June 23, 2015, 11:59 p.m.
On 06/22/2015 05:47 PM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon@fb.com>
> # Date 1435020392 25200
> #      Mon Jun 22 17:46:32 2015 -0700
> # Node ID a6b72e1db6ff5743cdb7ada37ef7c9d206b683d1
> # Parent  4198e2fad6ba08c0798c217e7b643fae9c28e81b
> evolve: clarify code in _singlesuccessor

Pushed to main, thanks, (with a small changes)


>
> Before this patch we were not very explicit with this while condition in
> _singlesuccessor. This patch makes it more legible.
>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -1364,7 +1364,7 @@ def _singlesuccessor(repo, p):
>       ui = repo.ui
>       newer = obsolete.successorssets(repo, obs.node())
>       # search of a parent which is not killed
> -    while not newer or newer == [()]:
> +    while newer == []:

I turned that in 'while not newer:'

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -1364,7 +1364,7 @@  def _singlesuccessor(repo, p):
     ui = repo.ui
     newer = obsolete.successorssets(repo, obs.node())
     # search of a parent which is not killed
-    while not newer or newer == [()]:
+    while newer == []:
         ui.debug("stabilize target %s is plain dead,"
                  " trying to stabilize on its parent\n" %
                  obs)