record: removed 'has_key' usage
authorRenato Cunha <renatoc@gmail.com>
Wed, 14 Jul 2010 22:58:29 -0300
changeset 11564 9bbfeba33aa3
parent 11563 cd6884231db8
child 11565 7546d4a272c8
record: removed 'has_key' usage Py3k has removed the dictionary has_key method. This patch implements a one argument function that can be used as a callback by hg.revert in the record extension.
hgext/record.py
--- a/hgext/record.py	Wed Jul 14 21:30:50 2010 +0200
+++ b/hgext/record.py	Wed Jul 14 22:58:29 2010 -0300
@@ -486,7 +486,8 @@
 
             # 3a. apply filtered patch to clean repo  (clean)
             if backups:
-                hg.revert(repo, repo.dirstate.parents()[0], backups.has_key)
+                hg.revert(repo, repo.dirstate.parents()[0],
+                          lambda key: key in backups)
 
             # 3b. (apply)
             if dopatch: