rebase: clean up rebasestate from active transaction
Previously, rebase assumes the following pattern:
rebase:
with transaction as tr: # top-level
...
tr.__close__ writes rebasestate
unlink('rebasestate')
However it's possible that "rebase" was called inside a transaction:
with transaction as tr1:
rebase:
with transaction as tr2: # not top-level
...
tr2.__close__ does not write rebasestate
unlink('rebasestate')
tr1.__close__ writes rebasestate
That leaves a rebasestate on disk incorrectly.
This patch adds "removefilegenerator" to notify transaction code that the
state file is no longer needed therefore fixes the issue.
Just exercise debugindexdot
Create a short file history including a merge.
$ hg init t
$ cd t
$ echo a > a
$ hg ci -qAm t1 -d '0 0'
$ echo a >> a
$ hg ci -m t2 -d '1 0'
$ hg up -qC 0
$ echo b >> a
$ hg ci -m t3 -d '2 0'
created new head
$ HGMERGE=true hg merge -q
$ hg ci -m merge -d '3 0'
$ hg debugindexdot .hg/store/data/a.i
digraph G {
-1 -> 0
0 -> 1
0 -> 2
2 -> 3
1 -> 3
}
$ cd ..