[PATCH 1 of 9] record extension: removed 'has_key' usage

Renato Cunha renatoc at gmail.com
Wed Jul 14 21:18:34 CDT 2010


# HG changeset patch
# User Renato Cunha <renatoc at gmail.com>
# Date 1279159109 10800
# Branch stable
# Node ID 21e794287623b1ae539d0213be2c8720797e256d
# Parent  6f44bd4cc4f2277fcdc0a5d3e7f58c26234a70cf
record extension: 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.

diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -485,7 +485,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:


More information about the Mercurial-devel mailing list