Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 40476:fbd5e2f0bba7 stable
update: do not pass in user revspec as default destination (issue6044)
When the revsingle() was introduced at 61c0df2b089a, it couldn't handle
revspec=0 (not '0') properly. That's probably why the default was set to
rev.
This is technically BC since "hg update ''" was identical to "hg update '.'"
whereas "hg update -r ''" is "hg update", but I believe that's a bug given
no test fails with this change.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 02 Jan 2019 09:41:04 +0900 |
parents | 3bc2e550f2bd |
children | 074c72a38423 |
comparison
equal
deleted
inserted
replaced
40475:7542466b94e2 | 40476:fbd5e2f0bba7 |
---|---|
6036 | 6036 |
6037 # if we defined a bookmark, we have to remember the original name | 6037 # if we defined a bookmark, we have to remember the original name |
6038 brev = rev | 6038 brev = rev |
6039 if rev: | 6039 if rev: |
6040 repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn') | 6040 repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn') |
6041 ctx = scmutil.revsingle(repo, rev, rev) | 6041 ctx = scmutil.revsingle(repo, rev, default=None) |
6042 rev = ctx.rev() | 6042 rev = ctx.rev() |
6043 hidden = ctx.hidden() | 6043 hidden = ctx.hidden() |
6044 overrides = {('ui', 'forcemerge'): opts.get(r'tool', '')} | 6044 overrides = {('ui', 'forcemerge'): opts.get(r'tool', '')} |
6045 with ui.configoverride(overrides, 'update'): | 6045 with ui.configoverride(overrides, 'update'): |
6046 ret = hg.updatetotally(ui, repo, rev, brev, clean=clean, | 6046 ret = hg.updatetotally(ui, repo, rev, brev, clean=clean, |