comparison hgext/evolve.py @ 1391:35518d26b549

merge with stable
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 18 Jun 2015 23:45:37 -0700
parents c96e4ab4e5cc 03f202bed47f
children ba95cec18fe9
comparison
equal deleted inserted replaced
1388:c96e4ab4e5cc 1391:35518d26b549
944 def bmdeactivate(repo): 944 def bmdeactivate(repo):
945 try: 945 try:
946 return bookmarks.deactivate(repo) 946 return bookmarks.deactivate(repo)
947 except AttributeError: 947 except AttributeError:
948 return bookmarks.unsetcurrent(repo) 948 return bookmarks.unsetcurrent(repo)
949 def bmactivate(repo, book):
950 try:
951 return bookmarks.activate(repo, book)
952 except AttributeError:
953 return bookmarks.setcurrent(repo, book)
949 954
950 def bmactive(repo): 955 def bmactive(repo):
951 try: 956 try:
952 return repo._activebookmark 957 return repo._activebookmark
953 except AttributeError: 958 except AttributeError:
1518 if not ui.quiet or confirm: 1523 if not ui.quiet or confirm:
1519 repo.ui.write(_('move:')) 1524 repo.ui.write(_('move:'))
1520 displayer.show(orig) 1525 displayer.show(orig)
1521 repo.ui.write(_('atop:')) 1526 repo.ui.write(_('atop:'))
1522 displayer.show(target) 1527 displayer.show(target)
1523 if confirm and ui.prompt('perform evolve? [Ny]') != 'y': 1528 if confirm and ui.prompt('perform evolve? [Ny]', 'n') != 'y':
1524 raise util.Abort(_('evolve aborted by user')) 1529 raise util.Abort(_('evolve aborted by user'))
1525 if progresscb: progresscb() 1530 if progresscb: progresscb()
1526 todo = 'hg rebase -r %s -d %s\n' % (orig, target) 1531 todo = 'hg rebase -r %s -d %s\n' % (orig, target)
1527 if dryrun: 1532 if dryrun:
1528 repo.ui.write(todo) 1533 repo.ui.write(todo)
1556 if not ui.quiet or confirm: 1561 if not ui.quiet or confirm:
1557 repo.ui.write(_('recreate:')) 1562 repo.ui.write(_('recreate:'))
1558 displayer.show(bumped) 1563 displayer.show(bumped)
1559 repo.ui.write(_('atop:')) 1564 repo.ui.write(_('atop:'))
1560 displayer.show(prec) 1565 displayer.show(prec)
1561 if confirm and ui.prompt('perform evolve? [Ny]') != 'y': 1566 if confirm and ui.prompt('perform evolve? [Ny]', 'n') != 'y':
1562 raise util.Abort(_('evolve aborted by user')) 1567 raise util.Abort(_('evolve aborted by user'))
1563 if dryrun: 1568 if dryrun:
1564 todo = 'hg rebase --rev %s --dest %s;\n' % (bumped, prec.p1()) 1569 todo = 'hg rebase --rev %s --dest %s;\n' % (bumped, prec.p1())
1565 repo.ui.write(todo) 1570 repo.ui.write(todo)
1566 repo.ui.write('hg update %s;\n' % prec) 1571 repo.ui.write('hg update %s;\n' % prec)
1689 displayer.show(divergent) 1694 displayer.show(divergent)
1690 ui.write(_('with: ')) 1695 ui.write(_('with: '))
1691 displayer.show(other) 1696 displayer.show(other)
1692 ui.write(_('base: ')) 1697 ui.write(_('base: '))
1693 displayer.show(base) 1698 displayer.show(base)
1694 if confirm and ui.prompt('perform evolve? [Ny]') != 'y': 1699 if confirm and ui.prompt('perform evolve? [Ny]', 'n') != 'y':
1695 raise util.Abort(_('evolve aborted by user')) 1700 raise util.Abort(_('evolve aborted by user'))
1696 if dryrun: 1701 if dryrun:
1697 ui.write('hg update -c %s &&\n' % divergent) 1702 ui.write('hg update -c %s &&\n' % divergent)
1698 ui.write('hg merge %s &&\n' % other) 1703 ui.write('hg merge %s &&\n' % other)
1699 ui.write('hg commit -m "auto merge resolving conflict between ' 1704 ui.write('hg commit -m "auto merge resolving conflict between '
1999 # Active bookmark that we don't want to delete (with -B option) 2004 # Active bookmark that we don't want to delete (with -B option)
2000 # we deactivate and move it before the update and reactivate it 2005 # we deactivate and move it before the update and reactivate it
2001 # after 2006 # after
2002 movebookmark = bookactive and not bookmark 2007 movebookmark = bookactive and not bookmark
2003 if movebookmark: 2008 if movebookmark:
2004 bookmarks.deactivate(repo) 2009 bmdeactivate(repo)
2005 repo._bookmarks[bookactive] = newnode.node() 2010 repo._bookmarks[bookactive] = newnode.node()
2006 repo._bookmarks.write() 2011 repo._bookmarks.write()
2007 commands.update(ui, repo, newnode.rev()) 2012 commands.update(ui, repo, newnode.rev())
2008 ui.status(_('working directory now at %s\n') % newnode) 2013 ui.status(_('working directory now at %s\n') % newnode)
2009 if movebookmark: 2014 if movebookmark:
2010 bookmarks.activate(repo, bookactive) 2015 bmactivate(repo, bookactive)
2011 2016
2012 # update bookmarks 2017 # update bookmarks
2013 if bookmark: 2018 if bookmark:
2014 _deletebookmark(ui, marks, bookmark) 2019 _deletebookmark(ui, marks, bookmark)
2015 2020