--- a/hgext/states.py Wed Sep 14 17:40:24 2011 +0200
+++ b/hgext/states.py Wed Sep 14 17:51:25 2011 +0200
@@ -679,14 +679,17 @@
def wrapmqqimport(orig, queue, repo, *args, **kwargs):
if 'rev' in kwargs:
- # we can take the min as non linear import wil break
- base = min(scmutil.revrange(repo, kwargs['rev']))
- basenode = repo.changelog.node(base)
- state = repo.nodestate(basenode)
- if not state.mutable:
- raise util.Abort(_('can not qimport published changeset %s')
- % node.short(basenode),
- hint=_('see `hg help --extension states` for details'))
+ # we can take the min as non linear import will break
+ # anyway
+ revs = scmutil.revrange(repo, kwargs['rev'])
+ if revs:
+ base = min(revs)
+ basenode = repo.changelog.node(base)
+ state = repo.nodestate(basenode)
+ if not state.mutable:
+ raise util.Abort(_('can not qimport published changeset %s')
+ % node.short(basenode),
+ hint=_('see `hg help --extension states` for details'))
return orig(queue, repo, *args, **kwargs)
@@ -753,7 +756,6 @@
def nodestate(self, node):
"""return the state object associated to the given node"""
rev = self.changelog.rev(node)
-
for state in STATES:
# avoid for untracked heads
if state.next is not None: