Mercurial > public > mercurial-scm > hg-stable
diff hgext/histedit.py @ 17759:9c7497cd39fd
histedit: add obsolete support
When the obsolete feature is enabled, histedit creates obsolescence marker
instead of stripping replaced changesets.
For now, we keep stripping temporary nodes created along the way.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Thu, 27 Sep 2012 13:59:48 +0200 |
parents | 5863f0e4cd3a |
children | 1b8e820ef19d |
line wrap: on
line diff
--- a/hgext/histedit.py Thu Oct 11 08:36:50 2012 +0200 +++ b/hgext/histedit.py Thu Sep 27 13:59:48 2012 +0200 @@ -156,6 +156,7 @@ from mercurial import repair from mercurial import scmutil from mercurial import util +from mercurial import obsolete from mercurial import merge as mergemod from mercurial.i18n import _ @@ -508,7 +509,15 @@ if mapping: movebookmarks(ui, repo, mapping, topmost, ntm) # TODO update mq state - cleanupnode(ui, repo, 'replaced', mapping) + if obsolete._enabled: + markers = [] + for prec, succs in mapping.iteritems(): + markers.append((repo[prec], + tuple(repo[s] for s in succs))) + if markers: + obsolete.createmarkers(repo, markers) + else: + cleanupnode(ui, repo, 'replaced', mapping) cleanupnode(ui, repo, 'temp', tmpnodes) os.unlink(os.path.join(repo.path, 'histedit-state'))