[PATCH 11 of 12] rollback: invalidate dirstate through the filecache

Pierre-Yves David pierre-yves.david at logilab.fr
Tue Jan 8 12:00:25 CST 2013


On Mon, Dec 17, 2012 at 05:35:36PM +0200, Idan Kamara wrote:
> # HG changeset patch
> # User Idan Kamara <idankk86 at gmail.com>
> # Date 1355568420 -7200
> # Branch stable
> # Node ID dfe35839906aaf57d18eeebfc529425de7c0ac85
> # Parent  9157ffe3d66d41bb7ea3cfa062d775a87731206a
> rollback: invalidate dirstate through the filecache
> 
> There's no reason to use invalidate on the dirstate instance since .hg/dirstate
> was just replaced and the filecache will spot this and reload it.
> 
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -1009,6 +1009,7 @@
>                        parents[1] not in self.changelog.nodemap)
>          if parentgone:
>              util.rename(self.join('undo.dirstate'), self.join('dirstate'))
> +            self.invalidatedirstate()
>              try:
>                  branch = self.opener.read('undo.branch')
>                  self.dirstate.setbranch(encoding.tolocal(branch))

What is this this extra call for ? You description only talk about the removed call bellow.

> @@ -1017,7 +1018,6 @@
>                            'current branch is still \'%s\'\n')
>                          % self.dirstate.branch())
>  
> -            self.dirstate.invalidate()
>              parents = tuple([p.rev() for p in self.parents()])
>              if len(parents) > 1:
>                  ui.status(_('working directory now based on '

-- 
Pierre-Yves David

http://www.logilab.fr/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130108/e9ca8d5f/attachment.pgp>


More information about the Mercurial-devel mailing list