[session] deprecate `hijack_user` method
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 22 Apr 2013 17:57:46 +0200
changeset 8934 48a6e6b88b16
parent 8933 ac76925268a3
child 8935 a8a9ba6f4cdd
[session] deprecate `hijack_user` method The semantic of this method is wicked and lead to very hard violation of sanity. (multiple transaction using the very same cursors). We deprecated the API to be able to drop it as soon as possible. The method was added long ago for some notification trick. It is not needed since we sent notification on ``postcommit_event``. (closes #2781782)
dbapi.py
doc/3.17.rst
server/session.py
--- a/dbapi.py	Thu Apr 25 12:24:26 2013 +0200
+++ b/dbapi.py	Mon Apr 22 17:57:46 2013 +0200
@@ -411,6 +411,7 @@
         """return the definition of sources used by the repository."""
         return self.cnx.source_defs()
 
+    @deprecated('[3.17] do not use hijack_user. create new Session object')
     def hijack_user(self, user):
         """return a fake request/session using specified user"""
         req = DBAPIRequest(self.vreg)
--- a/doc/3.17.rst	Thu Apr 25 12:24:26 2013 +0200
+++ b/doc/3.17.rst	Mon Apr 22 17:57:46 2013 +0200
@@ -42,6 +42,8 @@
 * ``ldapuser`` have been deprecated. It'll be fully dropped in the next
   version. If you are still using ldapuser switch to ``ldapfeed`` **NOW**!
 
+* ``hijack_user`` have been deprecated. It will be dropped soon.
+
 Deprecated Code Drops
 ----------------------
 
--- a/server/session.py	Thu Apr 25 12:24:26 2013 +0200
+++ b/server/session.py	Mon Apr 22 17:57:46 2013 +0200
@@ -903,6 +903,7 @@
         return transaction(self, free_cnxset)
 
 
+    @deprecated('[3.17] do not use hijack_user. create new Session object')
     def hijack_user(self, user):
         """return a fake request/session using specified user"""
         session = Session(user, self.repo)