Mercurial > hg
diff hgext/bookmarks.py @ 7622:4dd7b28003d2
use dict.iteritems() rather than dict.items()
This should be faster and more future-proof. Calls where the result is to be
sorted using util.sort() have been left unchanged. Calls to .items() on
configparser objects have been left as-is, too.
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Mon, 12 Jan 2009 09:16:03 +0100 |
parents | a9221c7f51a4 |
children | 1d54e2f6c0b7 |
line wrap: on
line diff
--- a/hgext/bookmarks.py Mon Jan 12 09:07:02 2009 +0100 +++ b/hgext/bookmarks.py Mon Jan 12 09:16:03 2009 +0100 @@ -67,7 +67,7 @@ if current(repo) not in refs: setcurrent(repo, None) file = repo.opener('bookmarks', 'w+') - for refspec, node in refs.items(): + for refspec, node in refs.iteritems(): file.write("%s %s\n" % (hex(node), refspec)) file.close() @@ -206,7 +206,7 @@ revisions = _revstostrip(repo.changelog, node) marks = parse(repo) update = [] - for mark, n in marks.items(): + for mark, n in marks.iteritems(): if repo.changelog.rev(n) in revisions: update.append(mark) oldstrip(ui, repo, node, backup)