Mercurial > public > mercurial-scm > hg
comparison mercurial/branchmap.py @ 18451:d6b3b36f1db2
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.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Sat, 19 Jan 2013 02:29:56 +0100 |
parents | a4ab37ca887b |
children | 3e92772d5383 |
comparison
equal
deleted
inserted
replaced
18450:4f9a52858512 | 18451:d6b3b36f1db2 |
---|---|
77 revs.extend(r for r in extrarevs if r <= partial.tiprev) | 77 revs.extend(r for r in extrarevs if r <= partial.tiprev) |
78 revs.extend(cl.revs(start=partial.tiprev + 1)) | 78 revs.extend(cl.revs(start=partial.tiprev + 1)) |
79 if revs: | 79 if revs: |
80 partial.update(repo, revs) | 80 partial.update(repo, revs) |
81 partial.write(repo) | 81 partial.write(repo) |
82 assert partial.validfor(repo) | 82 assert partial.validfor(repo), filtername |
83 repo._branchcaches[repo.filtername] = partial | 83 repo._branchcaches[repo.filtername] = partial |
84 | 84 |
85 class branchcache(dict): | 85 class branchcache(dict): |
86 """A dict like object that hold branches heads cache""" | 86 """A dict like object that hold branches heads cache""" |
87 | 87 |