Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 18 Mar 2019 19:31:45 +0300] rev 42004
branchcache: introduce hasbranch()
This will be used to check whether a branch exists or not. This will optimized
in future.
Differential Revision: https://phab.mercurial-scm.org/D6154
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 18 Mar 2019 19:11:55 +0300] rev 42003
branchmap: drop branchcache.setdefault() (API)
All the callers are updated to call setdefault of branchcache.entries
Differential Revision: https://phab.mercurial-scm.org/D6153
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 18 Mar 2019 19:01:29 +0300] rev 42002
branchcache: rename itervalues() to iterheads()
The itervalues() exists because branchcache() had a dict interface. Since it no
longer has a dict interface, it makes sense to have better function names.
If a person does not understand how branchcache stores info, it will be hard for
them to guess what itervalues() does.
Differential Revision: https://phab.mercurial-scm.org/D6152
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 18 Mar 2019 18:59:38 +0300] rev 42001
branchmap: remove the dict interface from the branchcache class (API)
The current branchmap computation involves reading the whole branchmap from
disk, validating all the nodes even if they are not required. This leads to a
lot of time on repos which have large branchmap or a lot of branches. On large
repos, this can validate around 1000's of nodes.
On some operations, like finding whether a branch exists or not, we don't need
to validate all the nodes. Or updating heads for a single branch.
Before this patch, branchcache class was having dict interface and it was hard
to keep track of reads.
This patch removes the dict interface. Upcoming patches will implement lazy
loading and validation of data and implement better API's.
Differential Revision: https://phab.mercurial-scm.org/D6151