Mercurial > hg
view tests/test-revset-outgoing.t @ 20275:2123d27ff75d
backout: avoid update on simple case.
Before the changeset the backout process was:
1) go to <target>
2) revert to <target> parent
3) update back to changeset we came from
The two update steps can takes a very long time to move back and forth unrelated
file change between <target> and current working directory.
The new process is just merging current working directory with the parent of
<target> using <target> as ancestor. This give the very same result but skip
the two updates. On big repo with a lot of files and changes that save a lots of
time (x20 for one week window).
The "merge" version (hg backout --merge) is still done with upgrades. We could
imagine using in memory commit to speed it up but this is another fish.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 08 Jan 2014 14:53:46 -0800 |
parents | aa9385f983fa |
children | 82b2ba904e3e |
line wrap: on
line source
$ cat >> $HGRCPATH <<EOF > [alias] > tlog = log --template "{rev}:{node|short}: '{desc}' {branches}\n" > tglog = tlog -G > tout = out --template "{rev}:{node|short}: '{desc}' {branches}\n" > EOF $ hg init a $ cd a $ echo a > a $ hg ci -Aqm0 $ echo foo >> a $ hg ci -Aqm1 $ hg up -q 0 $ hg branch stable marked working directory as branch stable (branches are permanent and global, did you want a bookmark?) $ echo bar >> a $ hg ci -qm2 $ hg tglog @ 2:7bee6c3bea3a: '2' stable | | o 1:3560197d8331: '1' |/ o 0:f7b1eb17ad24: '0' $ cd .. $ hg clone -q a#stable b $ cd b $ cat .hg/hgrc [paths] default = $TESTTMP/a#stable (glob) $ echo red >> a $ hg ci -qm3 $ hg up -q default $ echo blue >> a $ hg ci -qm4 $ hg tglog @ 3:f0461977a3db: '4' | | o 2:1d4099801a4e: '3' stable | | | o 1:7bee6c3bea3a: '2' stable |/ o 0:f7b1eb17ad24: '0' $ hg tout comparing with $TESTTMP/a (glob) searching for changes 2:1d4099801a4e: '3' stable $ hg tlog -r 'outgoing()' 2:1d4099801a4e: '3' stable $ hg tout ../a#default comparing with ../a searching for changes 3:f0461977a3db: '4' $ hg tlog -r 'outgoing("../a#default")' 3:f0461977a3db: '4' $ echo "green = ../a#default" >> .hg/hgrc $ cat .hg/hgrc [paths] default = $TESTTMP/a#stable (glob) green = ../a#default $ hg tout green comparing with $TESTTMP/a (glob) searching for changes 3:f0461977a3db: '4' $ hg tlog -r 'outgoing("green")' 3:f0461977a3db: '4' $ cd ..