mercurial/util.py
changeset 556 f6c6fa15ff70
parent 521 0fb8ade0f756
child 667 31a9aa890016
equal deleted inserted replaced
555:39a1cfb03ebd 556:f6c6fa15ff70
     4 #
     4 #
     5 # This software may be used and distributed according to the terms
     5 # This software may be used and distributed according to the terms
     6 # of the GNU General Public License, incorporated herein by reference.
     6 # of the GNU General Public License, incorporated herein by reference.
     7 
     7 
     8 import os
     8 import os
       
     9 
       
    10 def unique(g):
       
    11     seen = {}
       
    12     for f in g:
       
    13         if f not in seen:
       
    14             seen[f] = 1
       
    15             yield f
     9 
    16 
    10 class CommandError(Exception): pass
    17 class CommandError(Exception): pass
    11 
    18 
    12 def explain_exit(code):
    19 def explain_exit(code):
    13     """return a 2-tuple (desc, code) describing a process's status"""
    20     """return a 2-tuple (desc, code) describing a process's status"""