[PATCH stable] mq: pass qbase node instead of mq statusentry in phasedefaults

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Jan 22 04:19:00 CST 2012


On 22 janv. 2012, at 05:05, Augie Fackler wrote:

> # HG changeset patch
> # User Augie Fackler <durin42 at gmail.com>
> # Date 1327203567 21600
> # Branch stable
> # Node ID d0facc37bd941d7a26bfce8018e0f514378891c9
> # Parent  e35f10a8d795a1a8919f0db02cbe0ccc69d54c5c
> mq: pass qbase node instead of mq statusentry in phasedefaults
> 
> This was breaking my remotebranches extension in a completely
> mystifying way, because repo.lookup was failing to resolve the
> statusentry. I'm not sure how this works absent my remotebranches
> extension, but doing it this way looks more correct and doesn't break
> anything.

status entry resolved to <hex>:patch_name. I assume the leading <hex> make it
accidentally working but I did not find out how yet.

> 
> diff --git a/hgext/mq.py b/hgext/mq.py
> --- a/hgext/mq.py
> +++ b/hgext/mq.py
> @@ -3133,7 +3133,7 @@
> def mqphasedefaults(repo, roots):
>     """callback used to set mq changeset as secret when no phase data exists"""
>     if repo.mq.applied:
> -        qbase = repo[repo.mq.applied[0]]
> +        qbase = repo[repo.mq.applied[0].node]
>         roots[phases.secret].add(qbase.node())
>     return roots

Consider using:

	roots[phases.secret].add(repo.mq.applied[0].node)

finding a context by it's node to get is node seems suboptimal :-)

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list