# HG changeset patch # User Sylvain Thénault # Date 1297271173 -3600 # Node ID b172c383dbced80a83ed135984ca0548829c678f # Parent 260f662be12514166d6d9128ee0450b56d661b0e# Parent a6c32edabc8df3137e4b5033431b1fbf7537281d backport stable diff -r 260f662be125 -r b172c383dbce entity.py --- a/entity.py Wed Feb 09 16:16:20 2011 +0100 +++ b/entity.py Wed Feb 09 18:06:13 2011 +0100 @@ -1,4 +1,4 @@ -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. diff -r 260f662be125 -r b172c383dbce hooks/metadata.py --- a/hooks/metadata.py Wed Feb 09 16:16:20 2011 +0100 +++ b/hooks/metadata.py Wed Feb 09 18:06:13 2011 +0100 @@ -1,4 +1,4 @@ -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -44,7 +44,7 @@ edited.setdefault('creation_date', timestamp) edited.setdefault('modification_date', timestamp) if not self._cw.get_shared_data('do-not-insert-cwuri'): - cwuri = u'%seid/%s' % (self._cw.base_url(), self.entity.eid) + cwuri = u'%s%s' % (self._cw.base_url(), self.entity.eid) edited.setdefault('cwuri', cwuri) diff -r 260f662be125 -r b172c383dbce hooks/syncschema.py --- a/hooks/syncschema.py Wed Feb 09 16:16:20 2011 +0100 +++ b/hooks/syncschema.py Wed Feb 09 18:06:13 2011 +0100 @@ -1,4 +1,4 @@ -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. diff -r 260f662be125 -r b172c383dbce misc/migration/3.10.9_Any.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/migration/3.10.9_Any.py Wed Feb 09 18:06:13 2011 +0100 @@ -0,0 +1,12 @@ +if confirm('fix existing cwuri?'): + from logilab.common.shellutils import ProgressBar + from cubicweb.server.session import hooks_control + rset = rql('Any X, XC WHERE X cwuri XC, X cwuri ~= "%/eid/%"') + pb = ProgressBar(nbops=rset.rowcount, size=70) + with hooks_control(session, session.HOOKS_DENY_ALL, 'integrity'): + for i, e in enumerate(rset.entities()): + e.set_attributes(cwuri=e.cwuri.replace('/eid', '')) + if i % 100: # commit every 100 entities to limit memory consumption + commit(ask_confirm=False) + pb.update() + commit(ask_confirm=False) diff -r 260f662be125 -r b172c383dbce server/hook.py --- a/server/hook.py Wed Feb 09 16:16:20 2011 +0100 +++ b/server/hook.py Wed Feb 09 18:06:13 2011 +0100 @@ -1,4 +1,4 @@ -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb.