sapling/tests/test-pull-createmarkers-hide-later.t
Jun Wu 99386e40fd inhibit: update existing code to work with the rewritten version
Summary:
debuginhibit was removed since we no longer have a separate inhibit state.

smartlog hack about changing "o" to "x" was removed since "obsolete()"
revset is correct and the hack is unnecessary now.

directaccess was removed from tests since inhibit does not depend on it.

`- obsolete()` was added to some revsets to avoid divergence and other
surprises.

Use `inhibit.revive` API in infinitepush and reset to revive changesets
properly.

Remove various hacky code that mangle inhibit state in corner cases.

Most test changes are `o` changed to `x` in output since we draw
`obsolete()` state correctly now. `test-infinitepush-backup-remotefilelog.t`
change was because output could be `bytes/sec` instead of `KB/sec`.

Test Plan: arc unit

Reviewers: #mercurial, kulshrax

Reviewed By: kulshrax

Subscribers: kulshrax, medson, mjpieters

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

Signature: t1:5391361:1499722618:d3c1cf629f0c59ecdf1dfd5e653c1eb6176646b8
2017-07-10 15:45:31 -07:00

189 lines
5.2 KiB
Perl

$ . $TESTDIR/require-ext.sh remotenames
Setup
$ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
$ export PYTHONPATH
Test that hg pull creates obsolescence markers for landed diffs
$ cat >> $HGRCPATH <<EOF
> [ui]
> username = nobody <no.reply@fb.com>
> ssh = python "$RUNTESTDIR/dummyssh"
> [experimental]
> evolution= createmarkers
> rebaseskipobsolete=True
> [extensions]
> inhibit=$TESTDIR/../hgext3rd/inhibit.py
> fbamend=$TESTDIR/../hgext3rd/fbamend
> strip=
> rebase=
> remotenames =
> bundle2hooks=$TESTDIR/../hgext3rd/bundle2hooks.py
> pushrebase=$TESTDIR/../hgext3rd/pushrebase.py
> pullcreatemarkers= $TESTDIR/../hgext3rd/pullcreatemarkers.py
> [fbamend]
> safestrip=false
> [remotenames]
> allownonfastforward=True
> EOF
$ hg init server
$ mkcommit() {
> echo "$1" > "$1"
> hg add "$1"
> echo "add $1" > msg
> echo "" >> msg
> [ -z "$2" ] || echo "Differential Revision: https://phabricator.fb.com/D$2" >> msg
> hg ci -l msg
> }
$ land_amend() {
> hg log -r. -T'{desc}\n' > msg
> echo "Reviewed By: someone" >> msg
> hg ci --amend -l msg
> }
Set up server repository
$ cd server
$ mkcommit initial
$ mkcommit secondcommit
$ hg book master
$ cd ..
Set up a client repository, and work on 3 diffs
$ hg clone ssh://user@dummy/server client -q
$ cd client
$ mkcommit b 123 # 123 is the phabricator rev number (see function above)
$ mkcommit c 124
$ mkcommit d 131
$ hg log -G -T '{rev} "{desc}" {remotebookmarks}' -r 'all()'
@ 4 "add d
|
| Differential Revision: https://phabricator.fb.com/D131"
o 3 "add c
|
| Differential Revision: https://phabricator.fb.com/D124"
o 2 "add b
|
| Differential Revision: https://phabricator.fb.com/D123"
o 1 "add secondcommit" default/master
|
o 0 "add initial"
Now land the first two diff, but with amended commit messages, as would happen
when a diff is landed with landcastle.
$ hg update -r 1
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
$ hg graft -r 2
grafting 2:948715751816 "add b"
$ land_amend
$ hg graft -r 3
grafting 3:0e229072f723 "add c"
$ land_amend
$ hg push -r . --to master
pushing rev cc68f5e5f8d6 to destination ssh://user@dummy/server bookmark master
searching for changes
remote: pushing 2 changsets:
remote: e0672eeeb97c add b
remote: cc68f5e5f8d6 add c
updating bookmark master
Strip the commits we just landed.
$ hg update -r 1
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg strip -r 6
saved backup bundle to $TESTTMP/client/.hg/strip-backup/e0672eeeb97c-d1aa7ddd-backup.hg (glob)
Here pull should now detect commits 2 and 3 as landed, but it won't be able to
hide them since there is a non-hidden successor.
$ hg pull
pulling from ssh://user@dummy/server
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 0 changes to 2 files (+1 heads)
(run 'hg heads .' to see heads, 'hg merge' to merge)
$ hg log -G -T '{rev} "{desc}" {remotebookmarks}' -r 'all()'
o 7 "add c
|
| Differential Revision: https://phabricator.fb.com/D124
| Reviewed By: someone" default/master
o 6 "add b
|
| Differential Revision: https://phabricator.fb.com/D123
| Reviewed By: someone"
| o 4 "add d
| |
| | Differential Revision: https://phabricator.fb.com/D131"
| x 3 "add c
| |
| | Differential Revision: https://phabricator.fb.com/D124"
| x 2 "add b
|/
| Differential Revision: https://phabricator.fb.com/D123"
@ 1 "add secondcommit"
|
o 0 "add initial"
$ hg log -T '{rev}\n' -r 'allsuccessors(2)'
6
$ hg log -T '{rev}\n' -r 'allsuccessors(3)'
7
Now land the last diff.
$ hg update -r 7
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg graft -r 4
grafting 4:e4b5974890c0 "add d"
$ land_amend
$ hg push -r . --to master
pushing rev 296f9d37d5c1 to destination ssh://user@dummy/server bookmark master
searching for changes
remote: pushing 1 changset:
remote: 296f9d37d5c1 add d
updating bookmark master
And strip the commit we just landed.
$ hg update -r 7
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg strip -r 9
saved backup bundle to $TESTTMP/client/.hg/strip-backup/296f9d37d5c1-9c9e6ffd-backup.hg (glob)
Here pull should now detect commit 4 has been landed. It should hide this
commit, and should also hide 3 and 2, which were previously landed, but up
until now had non-hidden successors.
$ hg pull
pulling from ssh://user@dummy/server
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 0 changes to 1 files (+1 heads)
(run 'hg heads .' to see heads, 'hg merge' to merge)
$ hg log -G -T '{rev} "{desc}" {remotebookmarks}' -r 'all()'
o 9 "add d
|
| Differential Revision: https://phabricator.fb.com/D131
| Reviewed By: someone" default/master
@ 7 "add c
|
| Differential Revision: https://phabricator.fb.com/D124
| Reviewed By: someone"
o 6 "add b
|
| Differential Revision: https://phabricator.fb.com/D123
| Reviewed By: someone"
o 1 "add secondcommit"
|
o 0 "add initial"