comparison 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
comparison
equal deleted inserted replaced
17758:5863f0e4cd3a 17759:9c7497cd39fd
154 from mercurial import lock as lockmod 154 from mercurial import lock as lockmod
155 from mercurial import node 155 from mercurial import node
156 from mercurial import repair 156 from mercurial import repair
157 from mercurial import scmutil 157 from mercurial import scmutil
158 from mercurial import util 158 from mercurial import util
159 from mercurial import obsolete
159 from mercurial import merge as mergemod 160 from mercurial import merge as mergemod
160 from mercurial.i18n import _ 161 from mercurial.i18n import _
161 162
162 cmdtable = {} 163 cmdtable = {}
163 command = cmdutil.command(cmdtable) 164 command = cmdutil.command(cmdtable)
506 507
507 if not keep: 508 if not keep:
508 if mapping: 509 if mapping:
509 movebookmarks(ui, repo, mapping, topmost, ntm) 510 movebookmarks(ui, repo, mapping, topmost, ntm)
510 # TODO update mq state 511 # TODO update mq state
511 cleanupnode(ui, repo, 'replaced', mapping) 512 if obsolete._enabled:
513 markers = []
514 for prec, succs in mapping.iteritems():
515 markers.append((repo[prec],
516 tuple(repo[s] for s in succs)))
517 if markers:
518 obsolete.createmarkers(repo, markers)
519 else:
520 cleanupnode(ui, repo, 'replaced', mapping)
512 521
513 cleanupnode(ui, repo, 'temp', tmpnodes) 522 cleanupnode(ui, repo, 'temp', tmpnodes)
514 os.unlink(os.path.join(repo.path, 'histedit-state')) 523 os.unlink(os.path.join(repo.path, 'histedit-state'))
515 if os.path.exists(repo.sjoin('undo')): 524 if os.path.exists(repo.sjoin('undo')):
516 os.unlink(repo.sjoin('undo')) 525 os.unlink(repo.sjoin('undo'))