branchmap: Save changectx creation during update
The newly introduced `branchmap` function allows us to skip the
creation of changectx objects. This speeds up the construction of
the branchmap.
On the mozilla repository (117293 changesets, 15490 mutable)
Before:
! impactable 19.9
! mutable 0.576
! unserved 3.16
After:
! impactable 7.03 (2.8x faster)
! mutable 0.352 (1.6x)
! unserved 1.15 (2.7x)
On the cpython repository (81418 changesets, 6418 mutable)
Before:
! impactable 15.9
! mutable 0.451
! unserved 0.861
After:
! impactable 6.55 (2.4x faster)
! mutable 0.170 (2.6x faster)
! unserved 0.289 (2.9x faster)
On the pypy repository (58852 changesets)
Before:
! impactable 13.6
After:
! impactable 6.17 (2.2x faster)
On my Mercurial repository (18295 changesets, 2210 mutable)
Before:
! impactable 23.9
! mutable 0.368
! unserved 0.057
After:
! impactable 1.31 (18x faster)
! mutable 0.042 (8.7x)
! unserved 0.025 (2.2x)
http://mercurial.selenic.com/bts/issue619
$ hg init
$ echo a > a
$ hg ci -Ama
adding a
$ echo b > b
$ hg branch b
marked working directory as branch b
(branches are permanent and global, did you want a bookmark?)
$ hg ci -Amb
adding b
$ hg co -C 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
Fast-forward:
$ hg merge b
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg ci -Ammerge
Bogus fast-forward should fail:
$ hg merge b
abort: merging with a working directory ancestor has no effect
[255]