Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
31562:448acdee9161 | 31563:79d98e1b21a7 |
---|---|
5347 Returns 0 on success, 1 if there are unresolved files. | 5347 Returns 0 on success, 1 if there are unresolved files. |
5348 """ | 5348 """ |
5349 if rev and node: | 5349 if rev and node: |
5350 raise error.Abort(_("please specify just one revision")) | 5350 raise error.Abort(_("please specify just one revision")) |
5351 | 5351 |
5352 if ui.configbool('commands', 'update.requiredest', False): | |
5353 if not node and not rev and not date: | |
5354 raise error.Abort(_('you must specify a destination'), | |
5355 hint=_('for example: hg update ".::"')) | |
5356 | |
5352 if rev is None or rev == '': | 5357 if rev is None or rev == '': |
5353 rev = node | 5358 rev = node |
5354 | 5359 |
5355 if date and rev is not None: | 5360 if date and rev is not None: |
5356 raise error.Abort(_("you can't specify a revision and a date")) | 5361 raise error.Abort(_("you can't specify a revision and a date")) |