comparison hgext/evolve.py @ 420:b6163a85ddac

merge
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 05 Aug 2012 12:02:45 +0200
parents 03672e955bc8 18a0d96ed559
children 3f8c11865ed2
comparison
equal deleted inserted replaced
419:03672e955bc8 420:b6163a85ddac
357 targetnodes = set(noderange(repo, revs)) 357 targetnodes = set(noderange(repo, revs))
358 if not new: 358 if not new:
359 new = [node.nullid] 359 new = [node.nullid]
360 for n in targetnodes: 360 for n in targetnodes:
361 if not repo[n].mutable(): 361 if not repo[n].mutable():
362 ui.warn(_("Can't kill immutable changeset %s") % repo[n]) 362 ui.warn(_("cannot kill immutable changeset %s\n") % repo[n])
363 else: 363 else:
364 for ne in new: 364 for ne in new:
365 repo.addobsolete(ne, n) 365 repo.addobsolete(ne, n)
366 # update to an unkilled parent 366 # update to an unkilled parent
367 wdp = repo['.'] 367 wdp = repo['.']
635 635
636 def graftwrapper(orig, ui, repo, *revs, **kwargs): 636 def graftwrapper(orig, ui, repo, *revs, **kwargs):
637 kwargs = dict(kwargs) 637 kwargs = dict(kwargs)
638 revs = list(revs) + kwargs.get('rev', []) 638 revs = list(revs) + kwargs.get('rev', [])
639 kwargs['rev'] = [] 639 kwargs['rev'] = []
640 obsoleted = kwargs.setdefault('obsolete', [])
640 641
641 lock = repo.lock() 642 lock = repo.lock()
642 try: 643 try:
643 if kwargs.get('old_obsolete'): 644 if kwargs.get('old_obsolete'):
644 obsoleted = kwargs.setdefault('obsolete', []) 645 if kwargs.get('continue'):
645 if kwargs['continue']:
646 obsoleted.extend(repo.opener.read('graftstate').splitlines()) 646 obsoleted.extend(repo.opener.read('graftstate').splitlines())
647 else: 647 else:
648 obsoleted.extend(revs) 648 obsoleted.extend(revs)
649 # convert obsolete target into revs to avoid alias joke 649 # convert obsolete target into revs to avoid alias joke
650 obsoleted = kwargs.setdefault('obsolete', [])
651 obsoleted[:] = [str(i) for i in repo.revs('%lr', obsoleted)] 650 obsoleted[:] = [str(i) for i in repo.revs('%lr', obsoleted)]
652 if obsoleted and len(revs) > 1: 651 if obsoleted and len(revs) > 1:
653 652
654 raise error.Abort(_('Can not graft multiple revision while ' 653 raise error.Abort(_('Can not graft multiple revision while '
655 'obsoleting (for now).')) 654 'obsoleting (for now).'))
660 659
661 def extsetup(ui): 660 def extsetup(ui):
662 try: 661 try:
663 obsolete = extensions.find('obsolete') 662 obsolete = extensions.find('obsolete')
664 except KeyError: 663 except KeyError:
665 raise error.Abort(_('evolution extension require obsolete extension.')) 664 raise error.Abort(_('evolution extension requires obsolete extension.'))
666 try: 665 try:
667 rebase = extensions.find('rebase') 666 rebase = extensions.find('rebase')
668 except KeyError: 667 except KeyError:
669 rebase = None 668 rebase = None
670 raise error.Abort(_('evolution extension require rebase extension.')) 669 raise error.Abort(_('evolution extension requires rebase extension.'))
671 670
672 for cmd in ['amend', 'kill', 'uncommit']: 671 for cmd in ['amend', 'kill', 'uncommit']:
673 entry = extensions.wrapcommand(cmdtable, cmd, 672 entry = extensions.wrapcommand(cmdtable, cmd,
674 obsolete.warnobserrors) 673 obsolete.warnobserrors)
675 674