From patchwork Sat Jan 19 01:30:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: branchmap: display filtername when `updatebranch` fails to do its jobs From: Pierre-Yves David X-Patchwork-Id: 685 Message-Id: To: mercurial-devel@selenic.com Cc: pierre-yves.david@ens-lyon.org Date: Sat, 19 Jan 2013 02:30:19 +0100 # HG changeset patch # User Pierre-Yves David # Date 1358558996 -3600 # Node ID e2da07f2d2f450ee383a26d7d1624581a490a72b # Parent 64848f7fb7642bd1554c97049cc08d049b02941c branchmap: display filtername when `updatebranch` fails to do its jobs We have a very handy assert at the ends of `branchmap.updatecache` that check the resulting branchmap is actually valid. I know we do not like assert in mercurial but this one is very handy for debugging. There is really not reason for `branchmap.updatecache` to have this kind of issue but this happened and handful of time during the development of this or introduction of other related feature. I advice to keep it around until we are a bit more confident with the new code. diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -77,11 +77,11 @@ def updatecache(repo): revs.extend(r for r in extrarevs if r <= partial.tiprev) revs.extend(cl.revs(start=partial.tiprev + 1)) if revs: partial.update(repo, revs) partial.write(repo) - assert partial.validfor(repo) + assert partial.validfor(repo), filtername repo._branchcaches[repo.filtername] = partial class branchcache(dict): """A dict like object that hold branches heads cache"""