##// END OF EJS Templates
qimport: use `first` and `last` instead of direct indexing...
Pierre-Yves David -
r22821:5d4c17d1 default
parent child Browse files
Show More
@@ -1992,24 +1992,24 class queue(object):
1992 # If mq patches are applied, we can only import revisions
1992 # If mq patches are applied, we can only import revisions
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.first()))
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.last())
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.first())
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])
2004 if heads != [self.applied[-1].node]:
2004 if heads != [self.applied[-1].node]:
2005 raise util.Abort(_('revision %d is not the parent of '
2005 raise util.Abort(_('revision %d is not the parent of '
2006 'the queue') % rev[0])
2006 'the queue') % rev.first())
2007 base = repo.changelog.rev(self.applied[0].node)
2007 base = repo.changelog.rev(self.applied[0].node)
2008 lastparent = repo.changelog.parentrevs(base)[0]
2008 lastparent = repo.changelog.parentrevs(base)[0]
2009 else:
2009 else:
2010 if heads != [repo.changelog.node(rev[0])]:
2010 if heads != [repo.changelog.node(rev.first())]:
2011 raise util.Abort(_('revision %d has unmanaged children')
2011 raise util.Abort(_('revision %d has unmanaged children')
2012 % rev[0])
2012 % rev.first())
2013 lastparent = None
2013 lastparent = None
2014
2014
2015 diffopts = self.diffopts({'git': git})
2015 diffopts = self.diffopts({'git': git})
General Comments 0
You need to be logged in to leave comments. Login now