comparison mercurial/util.py @ 556:f6c6fa15ff70

Move dirstate.uniq to util.unique -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Move dirstate.uniq to util.unique manifest hash: 8ac613c30a4471f14ae52f14ed0839d66eeaebb7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCxQAqywK+sNU5EO8RAsTiAJ9E9/cALe+W8ojtfVdiXXre5dB/9gCeOgxr mRnVw/WDplkATW5450Pgsug= =xSfl -----END PGP SIGNATURE-----
author mpm@selenic.com
date Fri, 01 Jul 2005 00:34:50 -0800
parents 0fb8ade0f756
children 31a9aa890016
comparison
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"""