# HG changeset patch # User Bernhard Urban # Date 1408454046 -7200 # Node ID bf499b4d86e9610ee8113995ba1e2ade780b091f # Parent 2270852ee1ef2205bb226faf2bc52eb0056ac8f4 mx: fix release tag detection for -dev suffix diff -r 2270852ee1ef -r bf499b4d86e9 mx/mx_graal.py --- a/mx/mx_graal.py Tue Aug 19 14:59:29 2014 +0200 +++ b/mx/mx_graal.py Tue Aug 19 15:14:06 2014 +0200 @@ -685,17 +685,19 @@ # extract latest release tag for graal try: tags = [x.split() for x in subprocess.check_output(['hg', '-R', _graal_home, 'tags']).split('\n') if x.startswith("graal-")] - current_revision = subprocess.check_output(['hg', '-R', _graal_home, 'id', '-i']).strip() + current_id = subprocess.check_output(['hg', '-R', _graal_home, 'log', '--template', '{rev}\n', '--rev', 'tip']).strip() except: # not a mercurial repository or hg commands are not available. tags = None - if tags and current_revision: + if tags and current_id: sorted_tags = sorted(tags, key=lambda e: [int(x) for x in e[0][len("graal-"):].split('.')], reverse=True) most_recent_tag_name, most_recent_tag_revision = sorted_tags[0] + most_recent_tag_id = most_recent_tag_revision[:most_recent_tag_revision.index(":")] most_recent_tag_version = most_recent_tag_name[len("graal-"):] - if current_revision == most_recent_tag_revision: + # tagged commit is one-off with commit that tags it + if int(current_id) - int(most_recent_tag_id) <= 1: cached_graal_version = most_recent_tag_version else: major, minor = map(int, most_recent_tag_version.split('.'))