Commits

Anonymous committed 1a67e25

Comments (0)

Files changed (1)

mercurial_reviewboard/__init__.py

 import cStringIO
 import operator
 
+from distutils.version import LooseVersion
 from mercurial import cmdutil, hg, ui, mdiff, patch, util
 from mercurial.i18n import _
 
         return repo.findoutgoing(remoterepo)
 
     try:
-        # grab the first two digits of version number and convert to float, so '2.2.1' => 2.2
-        version = float('.'.join(util.version().split('.')[:2]))
-
-        if version >= 2.1:
+        if LooseVersion(util.version()) >= LooseVersion('2.1'):
             outgoing = discovery.findcommonoutgoing(repo, remoterepo)
             return outgoing.missing
         common, outheads = discovery.findcommonoutgoing(repo, remoterepo)