2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-06-11 05:35:01 +03:00
|
|
|
$ disable treemanifest
|
2016-02-05 09:47:14 +03:00
|
|
|
Setup
|
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ configure dummyssh
|
|
|
|
$ setconfig ui.username="nobody <no.reply@fb.com>"
|
2015-10-29 04:19:15 +03:00
|
|
|
|
|
|
|
Setup pushrebase required repo
|
|
|
|
|
|
|
|
$ hg init server
|
|
|
|
$ cd server
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable pushrebase
|
|
|
|
$ setconfig pushrebase.blocknonpushrebase=true
|
2015-10-29 04:19:15 +03:00
|
|
|
$ 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
|
2016-01-08 05:30:24 +03:00
|
|
|
pushing to $TESTTMP/server (glob)
|
2015-10-29 04:19:15 +03:00
|
|
|
searching for changes
|
2017-06-19 22:48:46 +03:00
|
|
|
error: prechangegroup.blocknonpushrebase hook failed: this repository requires that you enable the pushrebase extension and push using 'hg push --to'
|
|
|
|
abort: this repository requires that you enable the pushrebase extension and push using 'hg push --to'
|
2015-10-29 04:19:15 +03:00
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg push -f
|
2016-01-08 05:30:24 +03:00
|
|
|
pushing to $TESTTMP/server (glob)
|
2015-10-29 04:19:15 +03:00
|
|
|
searching for changes
|
2017-06-19 22:48:46 +03:00
|
|
|
error: prechangegroup.blocknonpushrebase hook failed: this repository requires that you enable the pushrebase extension and push using 'hg push --to'
|
|
|
|
abort: this repository requires that you enable the pushrebase extension and push using 'hg push --to'
|
2015-10-29 04:19:15 +03:00
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg push -B master
|
2016-01-08 05:30:24 +03:00
|
|
|
pushing to $TESTTMP/server (glob)
|
2015-10-29 04:19:15 +03:00
|
|
|
searching for changes
|
2017-06-19 22:48:46 +03:00
|
|
|
error: prechangegroup.blocknonpushrebase hook failed: this repository requires that you enable the pushrebase extension and push using 'hg push --to'
|
|
|
|
abort: this repository requires that you enable the pushrebase extension and push using 'hg push --to'
|
2015-10-29 04:19:15 +03:00
|
|
|
[255]
|
|
|
|
|
|
|
|
Pushrebase pushes should be allowed
|
|
|
|
|
2018-01-09 14:06:09 +03:00
|
|
|
$ hg push --config "extensions.pushrebase=" --to master -B master
|
2016-01-08 05:30:24 +03:00
|
|
|
pushing to $TESTTMP/server (glob)
|
2015-10-29 04:19:15 +03:00
|
|
|
searching for changes
|
2017-07-24 21:42:24 +03:00
|
|
|
pushing 1 changeset:
|
2015-10-29 04:19:18 +03:00
|
|
|
1846eede8b68 b
|
2015-10-29 04:19:15 +03:00
|
|
|
exporting bookmark master
|
|
|
|
|
|
|
|
Bookmark pushes should not be affected by the block
|
|
|
|
|
2016-01-08 05:30:24 +03:00
|
|
|
$ hg book -r ".^" master -f
|
2015-10-29 04:19:15 +03:00
|
|
|
$ hg push -B master
|
2016-01-08 05:30:24 +03:00
|
|
|
pushing to $TESTTMP/server (glob)
|
2015-10-29 04:19:15 +03:00
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
updating bookmark master
|
|
|
|
[1]
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg -R ../server log -T '{bookmarks}' -G
|
|
|
|
o
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2020-10-08 06:58:22 +03:00
|
|
|
@ master
|
2015-10-29 04:19:15 +03:00
|
|
|
|