diff 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
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -7,6 +7,13 @@
 
 import os
 
+def unique(g):
+    seen = {}
+    for f in g:
+        if f not in seen:
+            seen[f] = 1
+            yield f
+
 class CommandError(Exception): pass
 
 def explain_exit(code):