D6664: transaction: leave unfinished without crashing when not properly released
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Wed Jul 31 19:46:57 EDT 2019
Closed by commit rHG36c692eb28d3: transaction: leave unfinished without crashing when not properly released (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
CHANGES SINCE LAST UPDATE
CHANGES SINCE LAST ACTION
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
@@ -1893,6 +1893,12 @@
def releasefn(tr, success):
repo = reporef()
+ if repo is None:
+ # If the repo has been GC'd (and this release function is being
+ # called from transaction.__del__), there's not much we can do,
+ # so just leave the unfinished transaction there and let the
+ # user run `hg recover`.
# this should be explicitly invoked here, because
# in-memory changes aren't written out at closing
To: martinvonz, #hg-reviewers
More information about the Mercurial-devel