mercurial/util.py
changeset 30745 c1b7b2285522
parent 30736 d9e5b0aeeb90
child 30761 7283719e2bfd
--- a/mercurial/util.py	Thu Jan 05 17:16:07 2017 +0000
+++ b/mercurial/util.py	Tue Jan 10 16:15:21 2017 +0000
@@ -138,6 +138,12 @@
 def safehasattr(thing, attr):
     return getattr(thing, attr, _notset) is not _notset
 
+def bitsfrom(container):
+    bits = 0
+    for bit in container:
+        bits |= bit
+    return bits
+
 DIGESTS = {
     'md5': hashlib.md5,
     'sha1': hashlib.sha1,