diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -3518,7 +3518,7 @@ class dirstateguard(object): def __init__(self, repo, name): self._repo = repo self._suffix = '.backup.%s.%d' % (name, id(self)) - repo.dirstate._savebackup(repo.currenttransaction(), self._suffix) + repo.dirstate.savebackup(repo.currenttransaction(), self._suffix) self._active = True self._closed = False @@ -3536,13 +3536,13 @@ class dirstateguard(object): % self._suffix) raise error.Abort(msg) - self._repo.dirstate._clearbackup(self._repo.currenttransaction(), + self._repo.dirstate.clearbackup(self._repo.currenttransaction(), self._suffix) self._active = False self._closed = True def _abort(self): - self._repo.dirstate._restorebackup(self._repo.currenttransaction(), + self._repo.dirstate.restorebackup(self._repo.currenttransaction(), self._suffix) self._active = False diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -1205,7 +1205,7 @@ class dirstate(object): else: return self._filename - def _savebackup(self, tr, suffix): + def savebackup(self, tr, suffix): '''Save current dirstate into backup file with suffix''' filename = self._actualfilename(tr) @@ -1228,7 +1228,7 @@ class dirstate(object): self._opener.write(filename + suffix, self._opener.tryread(filename)) - def _restorebackup(self, tr, suffix): + def restorebackup(self, tr, suffix): '''Restore dirstate by backup file with suffix''' # this "invalidate()" prevents "wlock.release()" from writing # changes of dirstate out after restoring from backup file @@ -1236,7 +1236,7 @@ class dirstate(object): filename = self._actualfilename(tr) self._opener.rename(filename + suffix, filename) - def _clearbackup(self, tr, suffix): + def clearbackup(self, tr, suffix): '''Clear backup file with suffix''' filename = self._actualfilename(tr) self._opener.unlink(filename + suffix)