Mercurial > hg
view tests/test-pull-update.t @ 20713:6a1a4c212d50
revset: improve head revset performance
Previously the head() revset would iterate over every item in the subset and
check if it was a head. Since the subset is often the entire repo, this was
slow on large repos. Now we iterate over each item in the head list and check if
it's in the subset, which results in much less work.
hg log -r 'head()' on a large repo:
Before: 0.95s
After: 0.28s
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 13 Mar 2014 13:47:21 -0700 |
parents | 76df01e56e7f |
children | 216cc65cf227 |
line wrap: on
line source
$ hg init t $ cd t $ echo 1 > foo $ hg ci -Am m adding foo $ cd .. $ hg clone t tt updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd tt $ echo 1.1 > foo $ hg ci -Am m $ cd ../t $ echo 1.2 > foo $ hg ci -Am m Should not update: $ hg pull -u ../tt pulling from ../tt searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) not updating: not a linear update (merge or update --check to force update) $ cd ../tt Should not update: $ hg pull -u ../t pulling from ../t searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) not updating: not a linear update (merge or update --check to force update) $ HGMERGE=true hg merge merging foo 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -mm $ cd ../t Should work: $ hg pull -u ../tt pulling from ../tt searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (-1 heads) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ..