Commits

Anonymous committed bb95b5f

version: improve the check performed by --check

The version string is now split into components and compared correctly against
the remote version.

Comments (0)

Files changed (1)

repoman/commands.py

         except Exception, e:
             raise util.Abort('error getting version info: %s' % str(e))
 
-        if repo_version != remote_version:
+        # parse mercurial version string
+        def splitver(vstr):
+            try:
+                ver = vstr.split('+')
+                if len(ver) > 1:
+                    ver[1] = int(ver[1].split('-')[0])
+                ver[0] = [int(x) for x in ver[0].split('.')]
+                return ver
+            except ValueError:
+                return []
+
+        if splitver(repo_version) < splitver(remote_version):
             ui.warn('RepoMan is out of date; the newest version is %s (local version is %s)\n' %
                     (remote_version, repo_version))
             if download_url: