sapling/tests/test-infinitepush-pullback-evolve.t
Stanislau Hlebik 12a13d9b3a infinitepush: do not backup extinct heads
Summary:
Previously we backed up extinct node if bookmark pointed to them. But this not
is not present in the bundle because `findcommonoutgoing()` intentionally skips
extinct and secret commits. In this case we'll have infinitepush bookmark that
points to non-existent infinitepush commit. To fix it let's filter extinct heads

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D4803322

Tasks: 15389402
2017-04-05 00:56:28 -07:00

65 lines
1.5 KiB
Perl

$ . $TESTDIR/require-ext.sh evolve
$ setupevolve() {
> cat << EOF >> .hg/hgrc
> [extensions]
> evolve=
> [experimental]
> evolution=createmarkers
> evolutioncommands=obsolete
> EOF
> }
$ . "$TESTDIR/library.sh"
$ . "$TESTDIR/library-infinitepush.sh"
$ setupcommon
Setup server
$ hg init repo
$ cd repo
$ setupserver
$ cd ..
Setup backupsource
$ hg clone ssh://user@dummy/repo backupsource -q
$ cd backupsource
$ setupevolve
Do a normal backup
$ mkcommit first
$ hg pushbackup
starting backup .* (re)
searching for changes
remote: pushing 1 commit:
remote: b75a450e74d5 first
finished in \d+\.(\d+)? seconds (re)
Make a commit, than prune a commit, than create a bookmark on top of it.
Do a backup and try to restore. Make sure it doesn't fail
$ hg up -q null
$ mkcommit tobepruned
created new head
$ hg log -r . -T '{node}\n'
edb281c9cc7e2e51c382b6f254d1967fdfa5e6ff
$ hg prune .
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
working directory now at 000000000000
1 changesets pruned
$ hg --hidden book -r edb281c9cc7e2e51c382b6f254d1967fdfa5e6ff newbookonpruned
$ hg pushbackup
starting backup .* (re)
nothing to backup
finished in \d+\.(\d+)? seconds (re)
Restore the repo
$ cd ..
$ hg clone ssh://user@dummy/repo restored -q
$ cd restored
$ hg pullbackup
pulling from ssh://user@dummy/repo
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)