simplemerge: add optional context parameters to simplemerge
Rename the existing parameters for clarity.
These will, in subsequent patches, allow callers to redirect reads (of the
three sides of the merge) and writes (of the result) to the given contexts,
instead of using the filesystem.
While in most cases, the writes will go to a workingfilectx, this opens the
door for it to be a memfilectx in the case of an in-memory merge.
Repo will be necessary in a subsequent comit.
Differential Revision: https://phab.mercurial-scm.org/D372
simplemerge: extract verifytext as a helper function
This will be used in a subsequent commit.
Differential Revision: https://phab.mercurial-scm.org/D371
commit: use context manager with dirstateguard
When I wrote
5ac845ca059a (commit: don't let failed commit with
--addremove update dirstate (
issue5645), 2017-07-31), Durham's
609606d21765 (rebase: use one dirstateguard for when using
rebase.singletransaction, 2017-07-20) had not yet landed, so I had to
write it in the old-fashioned way. Now that Durham's patch is in, we
can simplify by using a context manager.
Differential Revision: https://phab.mercurial-scm.org/D406
commit: move dirstateguard creation out of try-block
This is just a simple refactoring to make the next patch simpler. If
the dirstateguard constructor raises an exception, the finally-block
won't do anything anyway, so this is functionally equivalent (and
there is no except-block).
Differential Revision: https://phab.mercurial-scm.org/D405