mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
c288e6c436
The ability to add hookargs to a bundleoperation object has been added to the core from this extension. Related commits are: https://www.mercurial-scm.org/repo/hg-committed/rev/bf6a06e6310e https://www.mercurial-scm.org/repo/hg-committed/rev/aa97e972460f Differential Revision: https://phab.mercurial-scm.org/D364
78 lines
2.2 KiB
Perl
78 lines
2.2 KiB
Perl
Setup
|
|
|
|
$ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
|
|
$ export PYTHONPATH
|
|
|
|
$ 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/../hgext3rd/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 (glob)
|
|
searching for changes
|
|
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'
|
|
[255]
|
|
|
|
$ hg push -f
|
|
pushing to $TESTTMP/server (glob)
|
|
searching for changes
|
|
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'
|
|
[255]
|
|
|
|
$ hg push -B master
|
|
pushing to $TESTTMP/server (glob)
|
|
searching for changes
|
|
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'
|
|
[255]
|
|
|
|
Pushrebase pushes should be allowed
|
|
|
|
$ hg push --config "extensions.pushrebase=$TESTDIR/../hgext3rd/pushrebase.py" --to master -B master
|
|
pushing to $TESTTMP/server (glob)
|
|
searching for changes
|
|
pushing 1 changeset:
|
|
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 (glob)
|
|
searching for changes
|
|
no changes found
|
|
updating bookmark master
|
|
[1]
|
|
$ hg -R ../server log -T '{rev} {bookmarks}' -G
|
|
o 1
|
|
|
|
|
@ 0 master
|
|
|