D6731: exchange: abort on pushing bookmarks pointing to secret changesets (issue6159)

navaneeth.suresh (Navaneeth Suresh) phabricator at mercurial-scm.org
Thu Aug 22 08:26:33 EDT 2019


navaneeth.suresh added inline comments.
navaneeth.suresh marked 2 inline comments as done.

INLINE COMMENTS

> navaneeth.suresh wrote in exchange.py:1044
> `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.

@pulkit i have updated as you suggested to get rid of all returns. sorry for being vague, thanks for the suggestion.

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