Show More
@@ -5349,6 +5349,11 b' def update(ui, repo, node=None, rev=None' | |||||
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 |
@@ -414,6 +414,15 b' effect and style see :hg:`help color`.' | |||||
414 | a different color mode than the pager (activated via the "pager" |
|
414 | a different color mode than the pager (activated via the "pager" | |
415 | extension). |
|
415 | extension). | |
416 |
|
416 | |||
|
417 | ``commands`` | |||
|
418 | ---------- | |||
|
419 | ||||
|
420 | ``update.requiredest`` | |||
|
421 | Require that the user pass a destination when running ``hg update``. | |||
|
422 | For example, ``hg update .::`` will be allowed, but a plain ``hg update`` | |||
|
423 | will be disallowed. | |||
|
424 | (default: False) | |||
|
425 | ||||
417 | ``committemplate`` |
|
426 | ``committemplate`` | |
418 | ------------------ |
|
427 | ------------------ | |
419 |
|
428 |
@@ -88,3 +88,19 b' Test that warning is printed if cwd is d' | |||||
88 | (consider changing to repo root: $TESTTMP/r1/r4) |
|
88 | (consider changing to repo root: $TESTTMP/r1/r4) | |
89 |
|
89 | |||
90 | #endif |
|
90 | #endif | |
|
91 | ||||
|
92 | $ cd $TESTTMP | |||
|
93 | $ cat >> $HGRCPATH <<EOF | |||
|
94 | > [commands] | |||
|
95 | > update.requiredest = True | |||
|
96 | > EOF | |||
|
97 | $ hg init dest | |||
|
98 | $ cd dest | |||
|
99 | $ echo a >> a | |||
|
100 | $ hg commit -qAm aa | |||
|
101 | $ hg up | |||
|
102 | abort: you must specify a destination | |||
|
103 | (for example: hg update ".::") | |||
|
104 | [255] | |||
|
105 | $ hg up . | |||
|
106 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now