dirstate: make dirstate.write() callers pass transaction object to it
Now, 'dirstate.write(tr)' delays writing in-memory changes out, if a
transaction is running.
This may cause treating this revision as "the first bad one" at
bisecting in some cases using external hook process inside transaction
scope, because some external hooks and editor process are still
invoked without HG_PENDING and pending changes aren't visible to them.
'dirstate.write()' callers below in localrepo.py explicitly use 'None'
as 'tr', because they can assume that no transaction is running:
- just before starting transaction
- at closing transaction, or
- at unlocking wlock
dirstate: remove layering violation around writing dirstate out
This violation, which passes repo object to dirstate, was introduced
by
09bb1ee7e73e.
This patch uses 'False' instead of 'None' as default value of 'tr'
argument, to distinguish "None as repo.currenttransaction() result"
from "legacy invocation without explicit tr passing".
dirstateguard: remove layering violation around saving/restoring backup
This violation, which passes 'repo' object to dirstate, was introduced
by
59b5e8844eb0 and
020b12d591f3.
rebase: reduce scope of try catch in restorestate
Refactoring by reduce the scope of the try catch block so that it only captures
what it needs. I could have made it smaller but another patch in the series
will add onto it.
rebase: on abort delete rebase state file no matter what
When a user's repository is in an unfinished rebase state and they choose to
abort, at a minimum, the repo should be out of that state. We've found
situations where the user could not leave the state unless manually deleting the
rebasestate file. This fix ensures that no matter what exception may be raised
during the abort, the rebase state file will be deleted, the user will be out of
the rebase state and they can get their repository into a workable condition.
contrib: make editmerge look for merge markers at the beginning of the line
This fix adds a caret to the start of the regex looking for merge markers. This
avoids the issue arises when you've real merge conflicts in a file that tests
for the existance of merge markers in test output. Editmerge will not open on
the fake/tested merge markers because they'll be indented in.
commit: abort when a committemplate is not changed
If a committemplate is provided and no message is provided on the
command line, and no edits are made to the commit template, then abort
the commit.
localrepo.commit: disallow commit when driver-resolved files exist
This code will not currently be activated because there's no code to mark
files as driver-resolved in core. This point is also somewhat hard to plug into
from extensions.