clone: check update rev for being True
In
30be3aeb5344, there was an attempt to fallback to looking up the update
revision assuming it was always a rev but the documentation states:
True means update to default rev, anything else is treated as a revision
Therefore, we should only fallback to looking up the update rev if it is not
True. This bug was found in hg-git and I couldn't think of a test that does
this in pure Mercurial since the source repository is checked for the revision
as well (and therefore gracefully falls back).
--- a/mercurial/hg.py Thu Sep 24 15:47:23 2015 -0700
+++ b/mercurial/hg.py Thu Sep 24 15:52:11 2015 -0700
@@ -582,10 +582,11 @@
try:
uprev = destrepo.lookup(checkout)
except error.RepoLookupError:
- try:
- uprev = destrepo.lookup(update)
- except error.RepoLookupError:
- pass
+ if update is not True:
+ try:
+ uprev = destrepo.lookup(update)
+ except error.RepoLookupError:
+ pass
if uprev is None:
try:
uprev = destrepo._bookmarks['@']