-
-
-
This check will fail for such versions as 2.0.0 or 1.6.3. We'd need to be more specific in our checks. Since it's going to be a bit longer, I'd recommend creating a utility function that checks if a version is at least the version passed. For example: def check_version(version, expected): return (expected[0] > version[0]) or \ (expected[0] == version[0] and expected[1] > version[1]) or \ (expected[0] == version[0] and expected[1] == version[1] and \ expected[3] >= version[3])) version and expected should be tuples of (major, minor, micro). It would be good to document that in the function. Then your check would become: if not check_version((version_parts.group(1), version_parts.group(2), version_parts.group(2)), (1, 5, 4)): die(...)
-
I'd rather not have the "post-review failed: " prefix here. If we want a prefix to identify failure, we should put it in die(). Maybe just prefix "fatal: "
Make post-review warn if installed version of git-svn is too old
Review Request #343 — Created April 4, 2008 and submitted
I installed git-svn the other day with an out-of-date MacPorts index, and wound up with version 1.5.3.7 installed. It turns out that 'git svn info', which is used by post-review to find repository information, wasn't added until git 1.5.4 (see http://www.kernel.org/pub/software/scm/git/docs/RelNotes-1.5.4.txt ). This adds a version check for git-svn which is run if git svn info fails, and which lets the user know that the git-svn version is out of date.
Tested against my old 1.5.3.7 install and my new, hotter 1.5.4.4 install.