def firstvalidglobalrevcommit(startrev): output = shlib.hg( "log", "--rev=all()", "--config=globalrevs.startrev=%s" % startrev, "--template={globalrev}\n", ).split("\n") output = list(l for l in output if l) if output: return output[0] return ""
def testlookup(): output = shlib.hg("log", "--rev=all()", "--template={globalrev}\n").split("\n") output = list(int(l) for l in output if l) assert output, "not globalrevs" for globalrev in output: result = getglobalrev("globalrev(%s)" % globalrev) assert result == globalrev, ( "globalrev revset doesn't roundtrip: globalrev(%s) == %s" % (globalrev, result)) result = getglobalrev("m%s" % globalrev) assert result == globalrev, "globalrev revset doesn't roundtrip: m%s == %s" % ( globalrev, result, )
def getglobalrevstr(commit): return shlib.hg("log", "-r", commit, "-T", "{globalrev}")
def getglobalrevstr(commit): commit = "(%s)-obsolete()" % commit return shlib.hg("log", "--hidden", "-r", commit, "-T", "{globalrev}")