mercurial/util.py
changeset 3566 4d97184a06ad
parent 3564 bb44489b901f
child 3568 23f7d9621783
equal deleted inserted replaced
3565:549cb7b640fb 3566:4d97184a06ad
   126     return False
   126     return False
   127 
   127 
   128 def unique(g):
   128 def unique(g):
   129     """return the uniq elements of iterable g"""
   129     """return the uniq elements of iterable g"""
   130     seen = {}
   130     seen = {}
       
   131     l = []
   131     for f in g:
   132     for f in g:
   132         if f not in seen:
   133         if f not in seen:
   133             seen[f] = 1
   134             seen[f] = 1
   134             yield f
   135             l.append(f)
       
   136     return l
   135 
   137 
   136 class Abort(Exception):
   138 class Abort(Exception):
   137     """Raised if a command needs to print an error and exit."""
   139     """Raised if a command needs to print an error and exit."""
   138 
   140 
   139 def always(fn): return True
   141 def always(fn): return True