| 1 |
$ cat <<EOF >> $HGRCPATH |
| 2 |
> [extensions] |
| 3 |
> hooklib = |
| 4 |
> |
| 5 |
> [phases] |
| 6 |
> publish = False |
| 7 |
> EOF |
| 8 |
$ hg init a |
| 9 |
$ hg --cwd a debugbuilddag '.:parent.*parent' |
| 10 |
$ hg --cwd a log -G |
| 11 |
o changeset: 2:fa942426a6fd |
| 12 |
| tag: tip |
| 13 |
| parent: 0:1ea73414a91b |
| 14 |
| user: debugbuilddag |
| 15 |
| date: Thu Jan 01 00:00:02 1970 +0000 |
| 16 |
| summary: r2 |
| 17 |
| |
| 18 |
| o changeset: 1:66f7d451a68b |
| 19 |
|/ user: debugbuilddag |
| 20 |
| date: Thu Jan 01 00:00:01 1970 +0000 |
| 21 |
| summary: r1 |
| 22 |
| |
| 23 |
o changeset: 0:1ea73414a91b |
| 24 |
tag: parent |
| 25 |
user: debugbuilddag |
| 26 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 27 |
summary: r0 |
| 28 |
|
| 29 |
$ hg init b |
| 30 |
$ cat <<EOF >> b/.hg/hgrc |
| 31 |
> [hooks] |
| 32 |
> pretxnclose.reject_new_heads = \ |
| 33 |
> python:hgext.hooklib.reject_new_heads.hook |
| 34 |
> EOF |
| 35 |
$ hg --cwd b pull ../a |
| 36 |
pulling from ../a |
| 37 |
requesting all changes |
| 38 |
adding changesets |
| 39 |
adding manifests |
| 40 |
adding file changes |
| 41 |
error: pretxnclose.reject_new_heads hook failed: Changes on branch 'default' resulted in multiple heads |
| 42 |
transaction abort! |
| 43 |
rollback completed |
| 44 |
abort: Changes on branch 'default' resulted in multiple heads |
| 45 |
[255] |
| 46 |
$ hg --cwd b pull ../a -r 1ea73414a91b |
| 47 |
pulling from ../a |
| 48 |
adding changesets |
| 49 |
adding manifests |
| 50 |
adding file changes |
| 51 |
added 1 changesets with 0 changes to 0 files |
| 52 |
new changesets 1ea73414a91b (1 drafts) |
| 53 |
(run 'hg update' to get a working copy) |
| 54 |
|
| 55 |
Test pushing zero changesets |
| 56 |
|
| 57 |
$ hg init c |
| 58 |
$ hg --cwd c debugbuilddag '.' |
| 59 |
$ hg --cwd c log -G |
| 60 |
o changeset: 0:1ea73414a91b |
| 61 |
tag: tip |
| 62 |
user: debugbuilddag |
| 63 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 64 |
summary: r0 |
| 65 |
|
| 66 |
$ cat <<EOF >> c/.hg/hgrc |
| 67 |
> [hooks] |
| 68 |
> pretxnclose.reject_new_heads = \ |
| 69 |
> python:hgext.hooklib.reject_new_heads.hook |
| 70 |
> EOF |
| 71 |
$ hg init d |
| 72 |
$ hg --cwd c push ../d |
| 73 |
pushing to ../d |
| 74 |
searching for changes |
| 75 |
adding changesets |
| 76 |
adding manifests |
| 77 |
adding file changes |
| 78 |
added 1 changesets with 0 changes to 0 files |
| 79 |
$ hg --cwd c push ../d |
| 80 |
pushing to ../d |
| 81 |
searching for changes |
| 82 |
no changes found |
| 83 |
[1] |