[PATCH 2 of 4] Provide a version independent way to use the set datatype

Eric Hopper hopper at omnifarious.org
Tue Jun 12 19:46:15 UTC 2007


# HG changeset patch
# User Eric Hopper <hopper at omnifarious.org>
# Date 1181674374 25200
# Node ID 9b0de5e860bce0bb1f506b5c8454816a11fad085
# Parent  f9c1dd143a0226682fad610b7db77e7043e5bc45
Provide a version independent way to use the set datatype.

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -15,6 +15,13 @@ from i18n import _
 from i18n import _
 import cStringIO, errno, getpass, popen2, re, shutil, sys, tempfile
 import os, threading, time, calendar, ConfigParser, locale, glob
+
+try:
+    hgset = set
+    hgfrozenset = frozenset
+except NameError, e:
+    from sets import Set as hgset
+    from sets import ImmutableSet as hgfrozenset
 
 try:
     _encoding = os.environ.get("HGENCODING")

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20070612/46a7615c/attachment.asc>


More information about the Mercurial-devel mailing list