[PATCH 2 of 3 evolve-ext] previous: replace call to bookmarks.write by bookmarks.recordchange
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Fri Dec 11 05:24:14 CST 2015
On 12/10/2015 10:53 PM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1449787380 28800
> # Thu Dec 10 14:43:00 2015 -0800
> # Node ID 9e4d6d773ac36fcda9ba729cb34915aac77bfde2
> # Parent db7a2d8f83d876026092a164f59d15ae80f057a7
> previous: replace call to bookmarks.write by bookmarks.recordchange
>
> bookmarks.write is now deprecated, we are moving to the new api:
> bookmarks.recordchange.
>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -2102,15 +2102,19 @@ def cmdprevious(ui, repo, **opts):
> else:
> ret = hg.update(repo, p.rev())
> if not ret:
> + tr = lock = None
> wlock = repo.wlock()
> try:
> + lock = repo.lock()
> + tr = repo.transaction('previous')
> if shouldmove:
> repo._bookmarks[bm] = p.node()
> - repo._bookmarks.write()
> + repo._bookmarks.recordchange(tr)
> else:
> bmdeactivate(repo)
> + tr.close()
> finally:
> - wlock.release()
> + lockmod.release(lock, wlock, tr)
The release order should be the reverse of the acquisition order. I've
fixed it in flight for patch 2 and 3.
There was a pre-existing occurence of this that I also pushed a fix for.
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list