mercurial/patch.py
changeset 9681 ac3a68cb16eb
parent 9642 7d17794f08a9
child 9682 bd70f645cfb0
equal deleted inserted replaced
9680:8cea86d73887 9681:ac3a68cb16eb
   340     def findlines(self, l, linenum):
   340     def findlines(self, l, linenum):
   341         # looks through the hash and finds candidate lines.  The
   341         # looks through the hash and finds candidate lines.  The
   342         # result is a list of line numbers sorted based on distance
   342         # result is a list of line numbers sorted based on distance
   343         # from linenum
   343         # from linenum
   344 
   344 
   345         try:
   345         cand = self.hash.get(l, [])
   346             cand = self.hash[l]
       
   347         except:
       
   348             return []
       
   349 
       
   350         if len(cand) > 1:
   346         if len(cand) > 1:
   351             # resort our list of potentials forward then back.
   347             # resort our list of potentials forward then back.
   352             cand.sort(key=lambda x: abs(x - linenum))
   348             cand.sort(key=lambda x: abs(x - linenum))
   353         return cand
   349         return cand
   354 
   350