Closed Pagliacii closed 1 year ago
Thanks for the PR! This is indeed a bug. But there has to be a better way to validate this without all the redundant statements. How about something like this:
local version_ok = (function()
if v.major ~= target.major then
return v.major > target.major
elseif v.minor ~= target.minor then
return v.minor > target.minor
elseif v.patch ~= target.patch then
return v.patch > target.patch
end
return true
end)()
Updated
Sure, I will check it at tonight.
Updated.
Today I found that the mercurial has a version likes this:
Mercurial Distributed SCM (version 6.4)
(see https://mercurial-scm.org for more information)
Copyright (C) 2005-2023 Olivia Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
So I use the hg_version
function to extract version info from cli output. And move the version checker to vcs.utils
.
@Pagliacii thanks for fixing this! I ran into it one day, but didn't have time to debug it. The next day it was gone, so probably my version got updated in the meantime :).
Nice to see someone else is using it with mercurial.
Close #363