sapling/tests/test-pushrebase-protection.t
Durham Goode a49358f7cc pushrebase: improve messages when pushing
Summary:
Previously the output just said "searching for changes" then "updating
bookmark", which was kind of terse. It also showed the "adding XX changesets"
output without any context, which is kind of scary to see "adding 100
changesets" when I'm only pushing one commit.

Now we mention how many commits we're pushing, what the hash range is, and how
many commits are being downloaded.

Test Plan: Ran ze tests

Reviewers: #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: mitrandir

Differential Revision: https://phabricator.fb.com/D2594007

Signature: t1:2594007:1446081446:99b77f4982acafc1f1940ba07b094a27dd05e354
2015-10-28 18:19:18 -07:00

73 lines
1.8 KiB
Perl

$ cat >> $HGRCPATH <<EOF
> [ui]
> ssh = python "$RUNTESTDIR/dummyssh"
> username = nobody <no.reply@fb.com>
> [extensions]
> strip =
> EOF
Setup pushrebase required repo
$ hg init server
$ cd server
$ cat >> .hg/hgrc <<EOF
> [extensions]
> pushrebase = $TESTDIR/../pushrebase.py
> [pushrebase]
> blocknonpushrebase = True
> EOF
$ echo a > a && hg commit -Aqm a
$ cd ..
$ hg clone -q server client
$ cd client
$ echo b >> a && hg commit -Aqm b
$ hg book master
Non-pushrebase pushes should be rejected
$ hg push
pushing to $TESTTMP/server
searching for changes
error: prechangegroup.blocknonpushrebase hook failed: this repository requires that you push using 'hg push --to'
abort: this repository requires that you push using 'hg push --to'
[255]
$ hg push -f
pushing to $TESTTMP/server
searching for changes
error: prechangegroup.blocknonpushrebase hook failed: this repository requires that you push using 'hg push --to'
abort: this repository requires that you push using 'hg push --to'
[255]
$ hg push -B master
pushing to $TESTTMP/server
searching for changes
error: prechangegroup.blocknonpushrebase hook failed: this repository requires that you push using 'hg push --to'
abort: this repository requires that you push using 'hg push --to'
[255]
Pushrebase pushes should be allowed
$ hg push --config extensions.pushrebase=$TESTDIR/../pushrebase.py --to master -B master
pushing to $TESTTMP/server
searching for changes
pushing 1 commit:
1846eede8b68 b
exporting bookmark master
Bookmark pushes should not be affected by the block
$ hg book -r .^ master -f
$ hg push -B master
pushing to $TESTTMP/server
searching for changes
no changes found
updating bookmark master
[1]
$ hg -R ../server log -T '{rev} {bookmarks}' -G
o 1
|
@ 0 master