Skip to contentSkip to conversation

hg.py: Fixed fetch failure that occurs when SRCREV is a tag.

PATCH New Jon Szymaniak 1 participant 1 message Dec 17, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hg.py: Fixed fetch failure that occurs when SRCREV is a tag.

Removed "-r REV" from hg clone invocation to fetch the entire repo, rather than just the subset at the specified revision. This will ensure that the specified tag exists for successive commands (e.g., the update built on line 149.)

---
 lib/bb/fetch2/hg.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
lib/bb/fetch2/hg.py +6 -1
index 155ae67..be0ef3b 100644
@@ -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":