Mercurial > public > mercurial-scm > hg-stable
diff hgext/record.py @ 8152:08e1baf924ca
replace set-like dictionaries with real sets
Many of the dictionaries created by dict.fromkeys were emulating sets.
These can now be replaced with real sets.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Wed, 22 Apr 2009 00:57:28 +0200 |
parents | 7b813bdbd5d0 |
children | 32a2a1e244f1 |
line wrap: on
line diff
--- a/hgext/record.py Wed Apr 22 00:56:06 2009 +0200 +++ b/hgext/record.py Wed Apr 22 00:57:28 2009 +0200 @@ -422,9 +422,9 @@ chunks = filterpatch(ui, parsepatch(fp)) del fp - contenders = {} + contenders = set() for h in chunks: - try: contenders.update(dict.fromkeys(h.files())) + try: contenders.update(set(h.files())) except AttributeError: pass changed = changes[0] + changes[1] + changes[2] @@ -433,7 +433,7 @@ ui.status(_('no changes to record\n')) return 0 - modified = dict.fromkeys(changes[0]) + modified = set(changes[0]) # 2. backup changed files, so we can restore them in the end backups = {}