D6731: exchange: abort on pushing bookmarks pointing to secret changesets (issue6159)
navaneeth.suresh (Navaneeth Suresh)
phabricator at mercurial-scm.org
Tue Aug 20 13:57:56 UTC 2019
navaneeth.suresh added inline comments.
INLINE COMMENTS
> pulkit wrote in exchange.py:1044
> You won't need `ctx = pushop.repo[node]` anymore then.
>
> In general, I suggest understanding the error as why are they are happening and you will find a fix.
`ctx = pushop.repo[node]` is needed to check the phase of the ctx. also, iiuc, if i write `if a and b: pass` in python, both a and b are evaluated before performing the comparison. iiuc, when ctx is `None`, `ctx.phase()` won't exist as `ctx = repo[None]` is not actually a changeset but, the uncommitted changes in the working directory instead. if we need to skip the return, we need to have the `ctx = pushop.repo[node]` inside the `if` statement. but, for me, skipping the further evaluation earlier using a `return` without the nested `if` with more alignment sounds good.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D6731/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D6731
To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, mercurial-devel
More information about the Mercurial-devel
mailing list