comparison hgext/mq.py @ 22819:602aa2b98628

mq: use `last` instead of direct indexing This makes it compatible with all smartset classes.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 07 Oct 2014 00:14:53 -0700
parents 31a591c3fecc
children 5d4c17d11d7e
comparison
equal deleted inserted replaced
22818:d7b114493315 22819:602aa2b98628
1993 # that form a linear path to qbase. 1993 # that form a linear path to qbase.
1994 # Otherwise, they should form a linear path to a head. 1994 # Otherwise, they should form a linear path to a head.
1995 heads = repo.changelog.heads(repo.changelog.node(rev[-1])) 1995 heads = repo.changelog.heads(repo.changelog.node(rev[-1]))
1996 if len(heads) > 1: 1996 if len(heads) > 1:
1997 raise util.Abort(_('revision %d is the root of more than one ' 1997 raise util.Abort(_('revision %d is the root of more than one '
1998 'branch') % rev[-1]) 1998 'branch') % rev.last())
1999 if self.applied: 1999 if self.applied:
2000 base = repo.changelog.node(rev[0]) 2000 base = repo.changelog.node(rev[0])
2001 if base in [n.node for n in self.applied]: 2001 if base in [n.node for n in self.applied]:
2002 raise util.Abort(_('revision %d is already managed') 2002 raise util.Abort(_('revision %d is already managed')
2003 % rev[0]) 2003 % rev[0])