Hi,
I've run into this as well... I'm trying to perform a task which can
take an argument and then run develop. The develop command still seems
to get my command line option even though I've tried popping it from
the bunch, here's the code:
options(
setup=....
),
install_revision=Bunch(
revision='tip'
)
)
@task
@cmdopts([
("revision=", "r", "Revision (number or short id)")
])
def install_revision():
"""Change the working copy to a specific revision"""
rev = options.install_revision.pop('revision')
import pdb; pdb.set_trace()
try:
sh("hg up -r %s" % rev)
sh('hg revert -r tip pavement.py')
call_task("develop")
except Exception, e:
print e
This chokes if I specify the revision:
paver install_revision -r 90
---> install_revision
hg up -r 90
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
error in command line: command 'develop' has no such option 'revision'
But seems ok if not (even though there's a default one):
---> install_revision
hg up -r tip
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
---> develop
---> egg_info
writing twodsearch.egg-info/PKG-INFO
writing top-level names to twodsearch.egg-info/top_level.txt
writing dependency_links to twodsearch.egg-info/dependency_links.txt
warning: manifest_maker: standard file 'paver' not found
reading manifest file 'twodsearch.egg-info/SOURCES.txt'
writing manifest file 'twodsearch.egg-info/SOURCES.txt'
---> build_ext
Creating /home/ben/dev/virtuals/search/lib/python2.5/site-packages/
twodsearch.egg-link (link to .)
twodsearch 96-035067865bcb is already the active version in easy-
install.pth
Installed /home/ben/dev/virtuals/search/src/search
Processing dependencies for twodsearch==96-035067865bcb
Finished processing dependencies for twodsearch==96-035067865bcb
This part of the relevant pdb seems instructive:
...
/home/ben/dev/virtuals/search/lib/python2.5/site-packages/Paver-0.8.1-
py2.5.egg/paver/setuputils.py(144)run_command()
-> ns = self._current_namespace
(Pdb) s
> /home/ben/dev/virtuals/search/lib/python2.5/site-packages/Paver-0.8.1-py2.5.egg/paver/setuputils.py(146)run_command()
-> cmd_obj = self.get_command_obj(command)
(Pdb) ns
[Bunch(revision=('command line', '90'))]
At this point cmd_obj.distribution.command_options looks like:
{'aliases': Bunch(),
'easy_install': Bunch(),
'install_revision': Bunch(revision=('command line', '90'))}
Hope this is enough detail. If you can give me any pointers as to why
this happens and how to fix it, I'll be happy to take a stab at it!
Cheers,
Ben