Comments
Patch
@@ -910,10 +910,11 @@ class localrepository(object):
renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
rp = report and report or self.ui.warn
vfsmap = {'plain': self.vfs} # root of .hg/
tr = transaction.transaction(rp, self.svfs, vfsmap,
"journal",
+ "undo",
aftertrans(renames),
self.store.createmode)
# note: writing the fncache only during finalize mean that the file is
# outdated when running hooks. As fncache is used for streaming clone,
# this is not expected to break anything that happen during the hooks.
@@ -80,12 +80,12 @@ def _playback(journal, report, opener, v
except (IOError, OSError, util.Abort), inst:
# only pure backup file remains, it is sage to ignore any error
pass
class transaction(object):
- def __init__(self, report, opener, vfsmap, journalname, after=None,
- createmode=None):
+ def __init__(self, report, opener, vfsmap, journalname, undoname=None,
+ after=None, createmode=None):
"""Begin a new transaction
Begins a new transaction that allows rolling back writes in the event of
an exception.
@@ -103,10 +103,11 @@ class transaction(object):
self._vfsmap = vfsmap
self.after = after
self.entries = []
self.map = {}
self.journal = journalname
+ self.undoname = undoname
self._queue = []
# a dict of arguments to be passed to hooks
self.hookargs = {}
self.file = opener.open(self.journal, "w")