Commits

Yujie Wu committed e16ee63

Fix compatibility bug for count. `revrange' has been moved into the `scmutil' module since v1.9.

  • Participants
  • Parent commits 0649e77

Comments (0)

Files changed (1)

 from mercurial import extensions, commands, cmdutil, help
 from mercurial.node import hex, short
 
+# `revrange' has been moved into module `scmutil' since v1.9.
+try :
+    from mercurial import scmutil
+    revrange = scmutil.revrange
+except :
+    revrange = cmdutil.revrange
+
 CACHE_PATH = ".hg/prompt/cache"
 CACHE_TIMEOUT = timedelta(minutes=15)
 
     def _count(m):
         g = m.groups()
         query = [g[1][1:]] if g[1] else ['all()']
-        return _with_groups(g, str(len(cmdutil.revrange(repo, query))))
+        return _with_groups(g, str(len(revrange(repo, query))))
 
     def _node(m):
         g = m.groups()