Help me with mercurial extension exportfiles
Question: i'm trying to use
[exportfiles](http://bitbucket.org/albert_brand/hgexportfiles/) extension for
mercurial but I'm getting this error:

    
    
    c:\xampp\htdocs\dev>hg exportfiles -r 1 /tmp/export
    ** unknown exception encountered, please report by visiting
    **  http://mercurial.selenic.com/wiki/BugTracker
    ** Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
    ** Mercurial Distributed SCM (version 1.9+10-e9264b45237d)
    ** Extensions loaded: exportfiles
    Traceback (most recent call last):
      File "hg", line 42, in <module>
      File "mercurial\dispatch.pyo", line 27, in run
      File "mercurial\dispatch.pyo", line 64, in dispatch
      File "mercurial\dispatch.pyo", line 87, in _runcatch
      File "mercurial\dispatch.pyo", line 675, in _dispatch
      File "mercurial\dispatch.pyo", line 454, in runcommand
      File "mercurial\dispatch.pyo", line 729, in _runcommand
      File "mercurial\dispatch.pyo", line 683, in checkargs
      File "mercurial\dispatch.pyo", line 672, in <lambda>
      File "mercurial\util.pyo", line 385, in check
      File "C:\Users\Sasa/exportfiles.py", line 39, in exportfiles
        rng = cmdutil.revrange(repo, opts['rev'])
    AttributeError: 'module' object has no attribute 'revrange'
    

I'm using TortiseHG 2.1.1 for Windows 32-bit with Mercurial 1.9+10

Could you help me please to solve this and use exportfiles extension?

Thanks in advance!


Answer: [Mercurial's API changed after version
1.8.](http://mercurial.selenic.com/wiki/ApiChanges#Changes_after_1.8)

> Various functions have been moved from cmdutil.py to scmutil.py, including
> revrange/revsingle/revpair and match/matchall/matchfiles

Assuming
[this](https://bitbucket.org/albert_brand/hgexportfiles/src/ac8754d1d7ef/exportfiles.py)
is the source of the extension you're using, line 11 should be

    
    
    from mercurial import util, scmutil
    

and line 39 should be

    
    
    rng = scmutil.revrange(repo, opts['rev'])
    

