[PATCH] mq: use an unfiltered property cache for the queue object

Augie Fackler raf at durin42.com
Tue Jul 16 10:20:08 CDT 2013


On Sun, Jul 14, 2013 at 05:29:07PM +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1373815387 -7200
> #      Sun Jul 14 17:23:07 2013 +0200
> # Node ID d4fa058cf19f09424bbc274825724fb78682b0f5
> # Parent  41c4bdd1d585a9196bd6c668fd9fce5e67a1028a
> mq: use an unfiltered property cache for the queue object

Queued, with regret that I had to read mq.py.

>
> The same `queue` object should be used in all situations. This allows to store
> global states on the object (like the reworked shelve extension plans to).  The
> queue object does not need to be distinct for all possible views (no reference
> to the repo/view used at creation time) it's even a bit surprising that mq still
> works with the current code.
>
> diff --git a/hgext/mq.py b/hgext/mq.py
> --- a/hgext/mq.py
> +++ b/hgext/mq.py
> @@ -63,10 +63,11 @@ from mercurial.i18n import _
>  from mercurial.node import bin, hex, short, nullid, nullrev
>  from mercurial.lock import release
>  from mercurial import commands, cmdutil, hg, scmutil, util, revset
>  from mercurial import repair, extensions, error, phases
>  from mercurial import patch as patchmod
> +from mercurial import localrepo
>  import os, re, errno, shutil
>
>  commands.norepo += " qclone"
>
>  seriesopts = [('s', 'summary', None, _('print first line of patch header'))]
> @@ -3408,11 +3409,11 @@ def mqphasedefaults(repo, roots):
>          roots[mqphase].add(qbase.node())
>      return roots
>
>  def reposetup(ui, repo):
>      class mqrepo(repo.__class__):
> -        @util.propertycache
> +        @localrepo.unfilteredpropertycache
>          def mq(self):
>              return queue(self.ui, self.baseui, self.path)
>
>          def abortifwdirpatched(self, errmsg, force=False):
>              if self.mq.applied and not force:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list