Mercurial > hg
changeset 19929:ab2362e1672e
merge: exit early during a no-op update (BC)
hg update . (or equivalents) are effectively no-ops in just about all
circumstances. These sorts of updates can be especially common in a
bookmark-oriented workflow. This saves us a status check and a manifest
decompression, which means that on a repo with over 210,000 files, this brings
hg update . down from 2.5 seconds to 0.15.
There is one change in behavior: a file that was added, not committed, and then
deleted but not removed used to be removed from the dirstate. With this patch
it isn't. This is what causes the change in test-mq-qpush-exact.t. This seems
like it's enough of an edge case to not be worth handling.
The output of test-empty.t changes because those files are not yet created.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 01 Oct 2013 17:43:54 -0700 |
parents | d1ac3790e10a |
children | b8316878a685 |
files | mercurial/merge.py tests/test-empty.t tests/test-mq-qpush-exact.t |
diffstat | 3 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/merge.py Thu Oct 17 21:45:17 2013 +0900 +++ b/mercurial/merge.py Tue Oct 01 17:43:54 2013 -0700 @@ -719,6 +719,12 @@ "subrepository '%s'") % s) elif not overwrite: + if p1 == p2: # no-op update + # call the hooks and exit early + repo.hook('preupdate', throw=True, parent1=xp2, parent2='') + repo.hook('update', parent1=xp2, parent2='', error=0) + return 0, 0, 0, 0 + if pa not in (p1, p2): # nolinear dirty = wc.dirty(missing=True) if dirty or onode is None: