mercurial/util.py
changeset 6762 f67d1468ac50
parent 6746 1dca460e7d1e
child 6836 c016dc1a8e91
equal deleted inserted replaced
6761:cb981fc955fb 6762:f67d1468ac50
   249     return False
   249     return False
   250 
   250 
   251 def unique(g):
   251 def unique(g):
   252     """return the uniq elements of iterable g"""
   252     """return the uniq elements of iterable g"""
   253     return dict.fromkeys(g).keys()
   253     return dict.fromkeys(g).keys()
       
   254 
       
   255 def sort(l):
       
   256     if not isinstance(l, list):
       
   257         l = list(l)
       
   258     l.sort()
       
   259     return l
   254 
   260 
   255 class Abort(Exception):
   261 class Abort(Exception):
   256     """Raised if a command needs to print an error and exit."""
   262     """Raised if a command needs to print an error and exit."""
   257 
   263 
   258 class UnexpectedOutput(Abort):
   264 class UnexpectedOutput(Abort):