307c307,312
< wctx = repo.workingctx()
---
> try:
> wctx = repo.workingctx()
> except:
> from mercurial import context
> wctx = context.workingctx(repo)
>