Mercurial > evolve
changeset 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 (current diff) 03f202bed47f (diff) |
children | ba95cec18fe9 |
files | hgext/evolve.py tests/test-stabilize-result.t |
diffstat | 2 files changed, 30 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/evolve.py Thu Jun 18 17:57:11 2015 -0700 +++ b/hgext/evolve.py Thu Jun 18 23:45:37 2015 -0700 @@ -946,6 +946,11 @@ return bookmarks.deactivate(repo) except AttributeError: return bookmarks.unsetcurrent(repo) +def bmactivate(repo, book): + try: + return bookmarks.activate(repo, book) + except AttributeError: + return bookmarks.setcurrent(repo, book) def bmactive(repo): try: @@ -1520,7 +1525,7 @@ displayer.show(orig) repo.ui.write(_('atop:')) displayer.show(target) - if confirm and ui.prompt('perform evolve? [Ny]') != 'y': + if confirm and ui.prompt('perform evolve? [Ny]', 'n') != 'y': raise util.Abort(_('evolve aborted by user')) if progresscb: progresscb() todo = 'hg rebase -r %s -d %s\n' % (orig, target) @@ -1558,7 +1563,7 @@ displayer.show(bumped) repo.ui.write(_('atop:')) displayer.show(prec) - if confirm and ui.prompt('perform evolve? [Ny]') != 'y': + if confirm and ui.prompt('perform evolve? [Ny]', 'n') != 'y': raise util.Abort(_('evolve aborted by user')) if dryrun: todo = 'hg rebase --rev %s --dest %s;\n' % (bumped, prec.p1()) @@ -1691,7 +1696,7 @@ displayer.show(other) ui.write(_('base: ')) displayer.show(base) - if confirm and ui.prompt('perform evolve? [Ny]') != 'y': + if confirm and ui.prompt('perform evolve? [Ny]', 'n') != 'y': raise util.Abort(_('evolve aborted by user')) if dryrun: ui.write('hg update -c %s &&\n' % divergent) @@ -2001,13 +2006,13 @@ # after movebookmark = bookactive and not bookmark if movebookmark: - bookmarks.deactivate(repo) + bmdeactivate(repo) repo._bookmarks[bookactive] = newnode.node() repo._bookmarks.write() commands.update(ui, repo, newnode.rev()) ui.status(_('working directory now at %s\n') % newnode) if movebookmark: - bookmarks.activate(repo, bookactive) + bmactivate(repo, bookactive) # update bookmarks if bookmark:
--- a/tests/test-stabilize-result.t Thu Jun 18 17:57:11 2015 -0700 +++ b/tests/test-stabilize-result.t Thu Jun 18 23:45:37 2015 -0700 @@ -32,6 +32,12 @@ $ hg evolve -v --confirm move:[2] changea atop:[4] changea + perform evolve? [Ny] n + abort: evolve aborted by user + [255] + $ echo y | hg evolve -v --confirm --config ui.interactive=True + move:[2] changea + atop:[4] changea perform evolve? [Ny] y hg rebase -r cce2c55b8965 -d fb9d051ec0a4 resolving manifests @@ -162,6 +168,12 @@ $ hg evolve --any --confirm recreate:[12] newer a atop:[8] newer a + perform evolve? [Ny] n + abort: evolve aborted by user + [255] + $ echo y | hg evolve --any --confirm --config ui.interactive=True + recreate:[12] newer a + atop:[8] newer a perform evolve? [Ny] y rebasing to destination parent: 66719795a494 computing new diff @@ -236,7 +248,14 @@ Stabilize it - $ hg evolve -qn --traceback --confirm + $ hg evolve -qn --confirm + merge:[19] More addition + with: [17] More addition + base: [15] More addition + perform evolve? [Ny] n + abort: evolve aborted by user + [255] + $ echo y | hg evolve -qn --confirm --config ui.interactive=True merge:[19] More addition with: [17] More addition base: [15] More addition