Rework the Mercurial version checking to not break.

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

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.
Description From Last Updated

This is desperately in need of some commenting.

daviddavid
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/scmtools/hg.py
      Ignored Files:
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/scmtools/hg.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues
    This is desperately in need of some commenting.
  3. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/scmtools/hg.py
      Ignored Files:
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-1.7.x (e882c41b8469084a8ec06632ac0a090ac6b064f7)