Mercurial > public > mercurial-scm > evolve
diff hgext/evolve.py @ 1427:fcc467ca740e
next/prev: require --merge to move with uncommitted changes
This should previous common mistake.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 23 Jun 2015 15:26:51 -0700 |
parents | 6db55f28c965 |
children | 20a3b0b27bfe |
line wrap: on
line diff
--- a/hgext/evolve.py Tue Jun 23 15:32:47 2015 -0700 +++ b/hgext/evolve.py Tue Jun 23 15:26:51 2015 -0700 @@ -1950,7 +1950,8 @@ @command('^previous', [('B', 'move-bookmark', False, - _('Move active bookmark after update'))], + _('Move active bookmark after update')), + ('', 'merge', False, _('bring uncommited change along'))], '[-B]') def cmdprevious(ui, repo, **opts): """update to parent and display summary lines""" @@ -1958,6 +1959,12 @@ wparents = wkctx.parents() if len(wparents) != 1: raise util.Abort('merge in progress') + if not opts['merge']: + try: + cmdutil.bailifchanged(repo) + except error.Abort, exc: + exc.hint = _('do you want --merge?') + raise parents = wparents[0].parents() displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate}) @@ -1982,7 +1989,8 @@ @command('^next', [('B', 'move-bookmark', False, - _('Move active bookmark after update'))], + _('Move active bookmark after update')), + ('', 'merge', False, _('bring uncommited change along'))], '[-B]') def cmdnext(ui, repo, **opts): """update to child and display summary lines""" @@ -1990,6 +1998,12 @@ wparents = wkctx.parents() if len(wparents) != 1: raise util.Abort('merge in progress') + if not opts['merge']: + try: + cmdutil.bailifchanged(repo) + except error.Abort, exc: + exc.hint = _('do you want --merge?') + raise children = [ctx for ctx in wparents[0].children() if not ctx.obsolete()] displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})