diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py index 155ae67bbd..b1c8675dd4 100644 --- a/bitbake/lib/bb/fetch2/hg.py +++ b/bitbake/lib/bb/fetch2/hg.py @@ -98,7 +98,12 @@ class Hg(FetchMethod): return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module) options = []; - if ud.revision: + + # Don't specify revision for the fetch; clone the entire repo. + # This avoids an issue if the specified revision is a tag, because + # the tag actually exists in the specified revision + 1, so it won't + # be available when used in any successive commands. + if ud.revision and command != "fetch": options.append("-r %s" % ud.revision) if command == "fetch":