Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 31563:79d98e1b21a7
update: add flag to require update destination
In some mercurial workflows, the default destination for update does not
always work well and can lead to confusing behavior. With this flag enabled,
every update command will require passing an explicit destination, eliminating
this confusion.
author | Ryan McElroy <rmcelroy@fb.com> |
---|---|
date | Tue, 14 Mar 2017 17:43:18 -0700 |
parents | 2abba5068aa1 |
children | 37a0ad669051 |
line wrap: on
line diff
--- a/mercurial/commands.py Mon Mar 20 11:38:37 2017 +0900 +++ b/mercurial/commands.py Tue Mar 14 17:43:18 2017 -0700 @@ -5349,6 +5349,11 @@ if rev and node: raise error.Abort(_("please specify just one revision")) + if ui.configbool('commands', 'update.requiredest', False): + if not node and not rev and not date: + raise error.Abort(_('you must specify a destination'), + hint=_('for example: hg update ".::"')) + if rev is None or rev == '': rev = node