Rework the Mercurial version checking to not break.

Review Request #3805 — Created Jan. 28, 2013 and submitted — Latest diff uploaded

Information

Review Board
release-1.7.x

Reviewers

Rework the Mercurial version checking to not break.

The Mercurial version checking was breaking in weird ways. This change
attempts to do a better job at checking the version.

First, we use their own version() function, if available.

If we can't import that, we'll try getting __version__ again, but in a
different way. We'll import the module and not the constant within it.

If that doesn't work, or if we get a version of None, we set it to an
empty string, which will result in the 'if <= 1.2' check passing.
Unit tests pass.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2
reviewboard/scmtools/hg.py
Loading...