profile: close 'fp' on error within '__enter__'
Previously, error when initialying the profiler would forgot to explicitly
close the file. Thank goes to Yuya Nishihara for spotting this.
profile: indent part of '__enter__'
We are about to introduce a try except. We start with adding the indent to make
the next patch clearer.
profile: remove now useless indent
We no longer rely on the value of '_output' so we can remove this conditional.
profile: use explicit logic to control file closing
We make the decision to close 'fp' more explicit instead of relying on the
implication of other variable. This makes the overall logic more robust.
profiling: move 'fp' closing logic into its own function
We are about to make the logic more robust and reuse it in more place, we start
by isolating what we have.
py3: use python3 hg in test-py3-commands.t at places where py2 hg was used
This patch fixes my mistakes where I added test in test-py3-commands.t as
`hg ...` where I forgot hg here refers to Python 2 mercurial.
test-dirstate-race: back out changeset
c82fa7efcbc8
This is non-deterministic. In any case, I switched to using
debugrebuilddirstate in my WIP patches, which makes this moot.