Mercurial > evolve
changeset 387:0e87a890d84b
obsolete: rely on core for rollback support
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Wed, 25 Jul 2012 19:28:46 +0200 |
parents | a3797de26544 |
children | 97b75bbfacc5 |
files | hgext/obsolete.py |
diffstat | 1 files changed, 0 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/obsolete.py Wed Jul 25 19:26:01 2012 +0200 +++ b/hgext/obsolete.py Wed Jul 25 19:28:46 2012 +0200 @@ -674,7 +674,6 @@ if not util.safehasattr(repo.opener, 'tryread'): raise util.Abort('Obsolete extension require Mercurial 2.2 (or later)') opush = repo.push - o_rollback = repo._rollback o_updatebranchcache = repo.updatebranchcache # /!\ api change in Hg 2.2 (97efd26eb9576f39590812ea9) /!\ @@ -825,38 +824,6 @@ return result - ### rollback support - - # /!\ api change in Hg 2.2 (97efd26eb9576f39590812ea9) /!\ - def _journalfiles(self): - return o_journalfiles() + (self.sjoin('journal.obsstore'),) - - def _writejournal(self, desc): - """wrapped version of _writejournal that save obsolete data""" - o_writejournal(desc) - filename = 'obsstore' - filepath = self.sjoin(filename) - if os.path.exists(filepath): - journalname = 'journal.' + filename - journalpath = self.sjoin(journalname) - util.copyfile(filepath, journalpath) - - - def _rollback(self, dryrun, force): - """wrapped version of _rollback that restore obsolete data""" - ret = o_rollback(dryrun, force) - if not (ret or dryrun): #rollback did not failed - src = self.sjoin('undo.obsstore') - dst = self.sjoin('obsstore') - if os.path.exists(src): - util.rename(src, dst) - elif os.path.exists(dst): - # If no state was saved because the file did not existed before. - os.unlink(dst) - # invalidate cache - self.__dict__.pop('obsstore', None) - return ret - repo.__class__ = obsoletingrepo for arg in sys.argv: if 'debugc' in arg: