[PATCH 6 of 6 v2] localrepo: assert that commitctx() hasn't been wrapped

Dan Villiom Podlaski Christiansen danchr at gmail.com
Sun Jan 8 07:37:56 CST 2012


# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1326029628 -3600
# Node ID cf2679354041244cf290116ea0fb6efdb9269fa8
# Parent  9ef9b0ecd653e9c1eedb75ec5a9cfe05b38eb939
localrepo: assert that commitctx() hasn't been wrapped.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1206,6 +1206,10 @@ class localrepository(repo.repository):
         extensions. This method may be used part of a conversion where it's
         important that `ctx' is committed to the repository as-is.
         """
+        assert self.commitctx.__module__ == __name__, (
+            "commitctx should not be wrapped or specialized; please wrap "
+            "commitworkingctx instead."
+        )
 
         tr = lock = None
         removed = list(ctx.removed())


More information about the Mercurial-devel mailing list