Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.3, 2.0, and 2.0.1

stable graph: Don't assume that there will be nodes

This was causing a "IndexError: list index out of range" e.g. when filtering
the the revisions to a particular branch and you strip the root revision that
the branch was made from.

Changeset d1864584df0a

Parent 1723c563dff4

by Daniel Atallah

Changes to one file · Browse files at d1864584df0a Showing diff from parent 1723c563dff4 Diff from another changeset...

 
348
349
350
351
 
352
353
354
 
348
349
350
 
351
352
353
354
@@ -348,7 +348,7 @@
  def index(self, rev):   if len(self) == 0: # graph is empty, let's build some nodes   self.build_nodes(10) - if rev is not None and rev < self.nodes[-1].rev: + if rev is not None and len(self) > 0 and rev < self.nodes[-1].rev:   self.build_nodes(self.nodes[-1].rev - rev)   if rev in self.nodesdict:   return self.nodes.index(self.nodesdict[rev])