2014-11-08 03:27:47 +03:00
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [ui]
|
2015-10-01 23:03:03 +03:00
|
|
|
> ssh = python "$RUNTESTDIR/dummyssh"
|
2014-11-08 03:27:47 +03:00
|
|
|
> username = nobody <no.reply@fb.com>
|
|
|
|
> [extensions]
|
|
|
|
> strip =
|
|
|
|
> EOF
|
|
|
|
$ alias commit='hg commit -d "0 0" -A -m'
|
2015-06-26 04:49:48 +03:00
|
|
|
$ alias log='hg log -G -T "{desc} [{phase}:{node|short}] {bookmarks}"'
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
Set up server repository
|
|
|
|
|
|
|
|
$ hg init server
|
|
|
|
$ cd server
|
|
|
|
$ echo foo > a
|
|
|
|
$ echo foo > b
|
|
|
|
$ commit 'initial'
|
|
|
|
adding a
|
|
|
|
adding b
|
|
|
|
|
|
|
|
Set up client repository
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ hg clone ssh://user@dummy/server client -q
|
|
|
|
$ cd client
|
|
|
|
$ echo "[extensions]" >> .hg/hgrc
|
|
|
|
$ echo "pushrebase = $TESTDIR/../pushrebase.py" >> .hg/hgrc
|
|
|
|
|
|
|
|
Without server extension
|
|
|
|
|
|
|
|
$ cd ../server
|
|
|
|
$ echo 'bar' > a
|
|
|
|
$ commit 'a => bar'
|
|
|
|
|
|
|
|
$ cd ../client
|
2015-07-24 00:11:58 +03:00
|
|
|
$ hg rm b
|
|
|
|
$ commit 'b => xxx'
|
2014-11-08 03:27:47 +03:00
|
|
|
$ echo 'baz' > b
|
2015-07-24 00:11:58 +03:00
|
|
|
$ hg add b
|
2014-11-08 03:27:47 +03:00
|
|
|
$ commit 'b => baz'
|
|
|
|
$ hg push
|
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
|
|
|
remote has heads on branch 'default' that are not known locally: add0c792bfce
|
2015-07-24 00:11:58 +03:00
|
|
|
abort: push creates new remote head 0e3997dc0733!
|
2014-11-08 03:27:47 +03:00
|
|
|
(pull and merge or see "hg help push" for details about pushing new heads)
|
|
|
|
[255]
|
|
|
|
|
2015-06-26 21:05:46 +03:00
|
|
|
$ hg --config experimental.bundle2-exp=False push --to default
|
2014-11-08 03:27:47 +03:00
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
|
|
|
abort: bundle2 needs to be enabled on client
|
|
|
|
[255]
|
|
|
|
|
|
|
|
$ echo "[experimental]" >> .hg/hgrc
|
|
|
|
$ echo "bundle2-exp = True" >> .hg/hgrc
|
2015-06-26 21:05:46 +03:00
|
|
|
$ hg push --to default
|
2014-11-08 03:27:47 +03:00
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
2015-04-17 23:49:35 +03:00
|
|
|
abort: no server support for 'b2x:rebase'
|
2014-11-08 03:27:47 +03:00
|
|
|
[255]
|
|
|
|
|
|
|
|
$ echo "[experimental]" >> ../server/.hg/hgrc
|
|
|
|
$ echo "bundle2-exp = True" >> ../server/.hg/hgrc
|
2015-06-26 21:05:46 +03:00
|
|
|
$ hg push --to default
|
2014-11-08 03:27:47 +03:00
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
|
|
|
abort: no server support for 'b2x:rebase'
|
|
|
|
[255]
|
|
|
|
|
|
|
|
Stack of non-conflicting commits should be accepted
|
|
|
|
|
|
|
|
$ cd ../server
|
|
|
|
$ echo "[extensions]" >> .hg/hgrc
|
|
|
|
$ echo "pushrebase = $TESTDIR/../pushrebase.py" >> .hg/hgrc
|
|
|
|
$ log
|
|
|
|
@ a => bar [draft:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [draft:2bb9d20e471c]
|
|
|
|
|
|
|
|
|
|
|
|
$ cd ../client
|
|
|
|
$ log
|
2015-07-24 00:11:58 +03:00
|
|
|
@ b => baz [draft:0e3997dc0733]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [draft:46a2df24e272]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
2015-10-01 21:15:37 +03:00
|
|
|
$ hg push --to default --config devel.bundle2.debug=1 --debug | tee stuff | grep -v bundle2-
|
2014-11-08 03:27:47 +03:00
|
|
|
pushing to ssh://user@dummy/server
|
2015-10-06 05:20:15 +03:00
|
|
|
running python * user@dummy 'hg -R server serve --stdio' (glob)
|
2015-10-01 21:15:37 +03:00
|
|
|
sending hello command
|
|
|
|
sending between command
|
|
|
|
remote: 362
|
|
|
|
remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream bundle2=HG20%0Ab2x%253Arebase%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
|
|
|
|
remote: 1
|
|
|
|
query 1; heads
|
|
|
|
sending batch command
|
2014-11-08 03:27:47 +03:00
|
|
|
searching for changes
|
2015-10-01 21:15:37 +03:00
|
|
|
taking quick initial sample
|
|
|
|
query 2; still undecided: 2, sample size is: 2
|
|
|
|
sending known command
|
|
|
|
2 total queries
|
|
|
|
preparing listkeys for "phases"
|
|
|
|
sending listkeys command
|
|
|
|
received listkey for "phases": 58 bytes
|
|
|
|
checking for updated bookmarks
|
|
|
|
preparing listkeys for "bookmarks"
|
|
|
|
sending listkeys command
|
|
|
|
received listkey for "bookmarks": 0 bytes
|
|
|
|
validated revset for rebase
|
|
|
|
2 changesets found
|
|
|
|
list of changesets:
|
|
|
|
46a2df24e27273bb06dbf28b085fcc2e911bf986
|
|
|
|
0e3997dc073308e42715a44d345466690abfd09a
|
|
|
|
sending unbundle command
|
2015-10-29 04:19:18 +03:00
|
|
|
remote: pushing 2 commits:
|
|
|
|
remote: 46a2df24e272 b => xxx
|
|
|
|
remote: 0e3997dc0733 b => baz
|
|
|
|
remote: 3 new commits from the server will be downloaded
|
2015-06-21 00:27:30 +03:00
|
|
|
adding changesets
|
2015-10-01 21:15:37 +03:00
|
|
|
add changeset add0c792bfce
|
|
|
|
add changeset 6a6d9484552c
|
|
|
|
add changeset 4cfedb0dc25f
|
2015-06-21 00:27:30 +03:00
|
|
|
adding manifests
|
|
|
|
adding file changes
|
2015-10-01 21:15:37 +03:00
|
|
|
adding a revisions
|
|
|
|
adding b revisions
|
2015-06-21 00:27:30 +03:00
|
|
|
added 3 changesets with 1 changes to 2 files (+1 heads)
|
2015-10-01 21:15:37 +03:00
|
|
|
preparing listkeys for "phases"
|
|
|
|
sending listkeys command
|
|
|
|
received listkey for "phases": 15 bytes
|
|
|
|
updating the branch cache
|
|
|
|
|
|
|
|
Check that we did not generate any check:heads parts
|
|
|
|
|
|
|
|
$ grep check:heads stuff
|
|
|
|
[1]
|
|
|
|
$ rm stuff
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
$ cd ../server
|
|
|
|
$ hg update default
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ log
|
2015-07-24 00:11:58 +03:00
|
|
|
@ b => baz [public:4cfedb0dc25f]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [public:6a6d9484552c]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
|
o a => bar [public:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
|
|
|
|
|
|
|
$ cd ../client
|
|
|
|
$ hg strip 1
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2015-07-24 00:11:58 +03:00
|
|
|
saved backup bundle to $TESTTMP/client/.hg/strip-backup/46a2df24e272-1b034f5b-backup.hg (glob)
|
2014-11-08 03:27:47 +03:00
|
|
|
$ hg pull
|
|
|
|
pulling from ssh://user@dummy/server
|
|
|
|
searching for changes
|
pushrebase: enable pushback always
Test Plan: ##run-tests.py##
Reviewers: durham, pyd, sid0
Reviewed By: sid0
Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham
Differential Revision: https://phabricator.fb.com/D1743234
Signature: t1:1743234:1418762853:e406ef2b4a22601596e0629e4561b2a7ca9a0df3
2014-12-16 22:44:45 +03:00
|
|
|
no changes found
|
2014-11-08 03:27:47 +03:00
|
|
|
$ hg update default
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
Regular commits should go through without changing hash
|
|
|
|
|
|
|
|
$ cd ../client
|
2014-11-19 03:36:46 +03:00
|
|
|
$ echo '[experimental]' >> .hg/hgrc
|
|
|
|
$ echo 'bundle2.pushback = True' >> .hg/hgrc
|
|
|
|
|
2014-11-08 03:27:47 +03:00
|
|
|
$ echo 'quux' > b
|
|
|
|
$ commit 'b => quux'
|
|
|
|
$ log -r tip
|
2015-07-24 00:11:58 +03:00
|
|
|
@ b => quux [draft:741fd2094512]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
|
|
2015-06-26 21:05:46 +03:00
|
|
|
$ hg push --to default
|
2014-11-08 03:27:47 +03:00
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
2015-10-29 04:19:18 +03:00
|
|
|
remote: pushing 1 commit:
|
|
|
|
remote: 741fd2094512 b => quux
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
$ cd ../server
|
|
|
|
$ hg update default
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ log
|
2015-07-24 00:11:58 +03:00
|
|
|
@ b => quux [public:741fd2094512]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => baz [public:4cfedb0dc25f]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [public:6a6d9484552c]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
|
o a => bar [public:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
|
|
|
|
|
|
|
Stack with conflict in tail should abort
|
|
|
|
|
|
|
|
$ cd ../server
|
|
|
|
$ echo 'baz' > a
|
|
|
|
$ commit 'a => baz'
|
|
|
|
|
|
|
|
$ cd ../client
|
|
|
|
$ echo 'quux' > a
|
|
|
|
$ commit 'a => quux'
|
|
|
|
$ echo 'foofoo' > b
|
|
|
|
$ commit 'b => foofoo'
|
2015-06-26 21:05:46 +03:00
|
|
|
$ hg push --to default
|
2014-11-08 03:27:47 +03:00
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
2015-10-29 04:19:20 +03:00
|
|
|
abort: conflicting changes in:
|
|
|
|
a
|
|
|
|
|
2014-11-08 03:27:47 +03:00
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg strip 5
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2015-07-24 00:11:58 +03:00
|
|
|
saved backup bundle to $TESTTMP/client/.hg/strip-backup/11a6a93eb344-7140e689-backup.hg (glob)
|
2014-11-08 03:27:47 +03:00
|
|
|
$ cd ../server
|
|
|
|
$ log
|
2015-07-24 00:11:58 +03:00
|
|
|
@ a => baz [draft:fb983dc509b6]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => quux [public:741fd2094512]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => baz [public:4cfedb0dc25f]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [public:6a6d9484552c]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
|
o a => bar [public:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
|
|
|
|
|
|
|
Stack with conflict in head should abort
|
|
|
|
|
|
|
|
$ cd ../client
|
|
|
|
$ echo 'foofoo' > b
|
|
|
|
$ commit 'b => foofoo'
|
|
|
|
$ echo 'quux' > a
|
|
|
|
$ commit 'a => quux'
|
2015-06-26 21:05:46 +03:00
|
|
|
$ hg push --to default
|
2014-11-08 03:27:47 +03:00
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
2015-10-29 04:19:20 +03:00
|
|
|
abort: conflicting changes in:
|
|
|
|
a
|
|
|
|
|
2014-11-08 03:27:47 +03:00
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg strip 5
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2015-07-24 00:11:58 +03:00
|
|
|
saved backup bundle to $TESTTMP/client/.hg/strip-backup/98788efd81b0-93572e45-backup.hg (glob)
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
$ cd ../server
|
|
|
|
$ log
|
2015-07-24 00:11:58 +03:00
|
|
|
@ a => baz [draft:fb983dc509b6]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => quux [public:741fd2094512]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => baz [public:4cfedb0dc25f]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [public:6a6d9484552c]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
|
o a => bar [public:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
2015-06-26 04:49:48 +03:00
|
|
|
Pushing a merge should rebase only the latest side of the merge
|
|
|
|
|
|
|
|
$ hg book master -r tip
|
|
|
|
$ cd ../client
|
|
|
|
$ hg pull -q > /dev/null
|
|
|
|
$ hg strip -q -r tip
|
2015-07-29 23:32:51 +03:00
|
|
|
$ hg up 741fd2094512
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo "tux" > other
|
|
|
|
$ hg add other
|
|
|
|
$ hg commit -qm "branch left"
|
2015-06-26 04:49:48 +03:00
|
|
|
$ hg book master -r tip
|
2015-07-29 23:32:51 +03:00
|
|
|
moving bookmark 'master' forward from 741fd2094512
|
2015-06-26 04:49:48 +03:00
|
|
|
$ hg up -q 2
|
|
|
|
$ echo branched > c
|
|
|
|
$ hg commit -Aqm "branch start"
|
|
|
|
$ echo branched2 > c
|
|
|
|
$ hg commit -qm "branch middle"
|
|
|
|
$ hg merge -q master
|
|
|
|
$ hg commit -qm "merge"
|
|
|
|
$ echo ontopofmerge > c
|
|
|
|
$ hg commit -qm "on top of merge"
|
|
|
|
$ hg book master -r tip
|
2015-07-29 23:32:51 +03:00
|
|
|
moving bookmark 'master' forward from e6b7549904cd
|
2015-06-26 04:49:48 +03:00
|
|
|
$ log
|
2015-07-29 23:32:51 +03:00
|
|
|
@ on top of merge [draft:9007d6a204f8] master
|
2015-06-26 04:49:48 +03:00
|
|
|
|
|
2015-07-29 23:32:51 +03:00
|
|
|
o merge [draft:2c0c699d7086]
|
2015-06-26 04:49:48 +03:00
|
|
|
|\
|
2015-07-24 00:11:58 +03:00
|
|
|
| o branch middle [draft:5a0cbf3df4ef]
|
2015-06-26 04:49:48 +03:00
|
|
|
| |
|
2015-07-24 00:11:58 +03:00
|
|
|
| o branch start [draft:add5ec74853d]
|
2015-06-26 04:49:48 +03:00
|
|
|
| |
|
2015-07-29 23:32:51 +03:00
|
|
|
o | branch left [draft:e6b7549904cd]
|
|
|
|
| |
|
2015-07-24 00:11:58 +03:00
|
|
|
o | b => quux [public:741fd2094512]
|
2015-06-26 04:49:48 +03:00
|
|
|
| |
|
2015-07-24 00:11:58 +03:00
|
|
|
o | b => baz [public:4cfedb0dc25f]
|
2015-06-26 04:49:48 +03:00
|
|
|
|/
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [public:6a6d9484552c]
|
2015-06-26 04:49:48 +03:00
|
|
|
|
|
|
|
|
o a => bar [public:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
2015-06-26 21:05:46 +03:00
|
|
|
$ hg push --to master -B master
|
2015-06-26 04:49:48 +03:00
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
2015-10-29 04:19:18 +03:00
|
|
|
remote: pushing 5 commits:
|
|
|
|
remote: e6b7549904cd branch left
|
|
|
|
remote: add5ec74853d branch start
|
|
|
|
remote: 5a0cbf3df4ef branch middle
|
|
|
|
remote: 2c0c699d7086 merge
|
|
|
|
remote: 9007d6a204f8 on top of merge
|
|
|
|
remote: 6 new commits from the server will be downloaded
|
2015-06-26 04:49:48 +03:00
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
2015-07-29 23:32:51 +03:00
|
|
|
added 4 changesets with 1 changes to 3 files (+1 heads)
|
2015-06-26 04:49:48 +03:00
|
|
|
updating bookmark master
|
|
|
|
$ cd ../server
|
|
|
|
$ log
|
2015-08-11 08:15:03 +03:00
|
|
|
o on top of merge [public:7548c79a5591] master
|
2015-06-26 04:49:48 +03:00
|
|
|
|
|
2015-08-11 08:15:03 +03:00
|
|
|
o merge [public:93a3cc822f6a]
|
2015-06-26 04:49:48 +03:00
|
|
|
|\
|
2015-07-24 00:11:58 +03:00
|
|
|
| o branch middle [public:5a0cbf3df4ef]
|
2015-06-26 04:49:48 +03:00
|
|
|
| |
|
2015-07-24 00:11:58 +03:00
|
|
|
| o branch start [public:add5ec74853d]
|
2015-06-26 04:49:48 +03:00
|
|
|
| |
|
2015-07-29 23:32:51 +03:00
|
|
|
o | branch left [public:cf07bdf4226e]
|
|
|
|
| |
|
2015-07-24 00:11:58 +03:00
|
|
|
@ | a => baz [public:fb983dc509b6]
|
2015-06-26 04:49:48 +03:00
|
|
|
| |
|
2015-07-24 00:11:58 +03:00
|
|
|
o | b => quux [public:741fd2094512]
|
2015-06-26 04:49:48 +03:00
|
|
|
| |
|
2015-07-24 00:11:58 +03:00
|
|
|
o | b => baz [public:4cfedb0dc25f]
|
2015-06-26 04:49:48 +03:00
|
|
|
|/
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [public:6a6d9484552c]
|
2015-06-26 04:49:48 +03:00
|
|
|
|
|
|
|
|
o a => bar [public:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
2015-08-11 08:15:03 +03:00
|
|
|
- Verify the content of the merge files is correct
|
|
|
|
$ hg cat -r master^ c
|
|
|
|
branched2
|
|
|
|
$ hg cat -r master^ other
|
|
|
|
tux
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
$ hg strip -r add5ec74853d -q
|
2015-06-26 04:49:48 +03:00
|
|
|
$ cd ../client
|
2015-07-24 00:11:58 +03:00
|
|
|
$ hg strip -r add5ec74853d -q
|
2015-06-26 04:49:48 +03:00
|
|
|
$ hg book -d master
|
|
|
|
$ hg -R ../server book -d master
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
With evolution enabled, should set obsolescence markers
|
|
|
|
|
2015-06-13 02:34:35 +03:00
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [extensions]
|
|
|
|
> rebase =
|
|
|
|
>
|
|
|
|
> [experimental]
|
|
|
|
> evolution = all
|
|
|
|
> EOF
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
$ cd ../client
|
2015-07-24 00:11:58 +03:00
|
|
|
$ hg strip -qr fb983dc509b6
|
2015-07-29 23:32:51 +03:00
|
|
|
$ hg strip -qr e6b7549904cd2a7991ef25bc2e0fd910801af2cd
|
2015-07-24 00:11:58 +03:00
|
|
|
$ hg up -q 741fd2094512
|
2015-07-24 19:38:01 +03:00
|
|
|
$ hg mv b k
|
|
|
|
$ commit 'b => k'
|
|
|
|
$ hg mv k b
|
2014-11-08 03:27:47 +03:00
|
|
|
$ echo 'foobar' > b
|
|
|
|
$ commit 'b => foobar'
|
|
|
|
$ log
|
2015-07-24 19:38:01 +03:00
|
|
|
@ b => foobar [draft:e73acfaeee82]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 19:38:01 +03:00
|
|
|
o b => k [draft:9467a8ee5d0d]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => quux [public:741fd2094512]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => baz [public:4cfedb0dc25f]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [public:6a6d9484552c]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
|
o a => bar [public:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
2015-06-26 21:05:46 +03:00
|
|
|
$ hg push --to default
|
2014-11-08 03:27:47 +03:00
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
2015-10-29 04:19:18 +03:00
|
|
|
remote: pushing 2 commits:
|
|
|
|
remote: 9467a8ee5d0d b => k
|
|
|
|
remote: e73acfaeee82 b => foobar
|
|
|
|
remote: 4 new commits from the server will be downloaded
|
2015-06-21 00:27:30 +03:00
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
2015-07-29 23:32:51 +03:00
|
|
|
added 4 changesets with 2 changes to 4 files (+1 heads)
|
2015-06-21 00:27:30 +03:00
|
|
|
2 new obsolescence markers
|
2014-11-19 03:36:46 +03:00
|
|
|
|
|
|
|
$ hg pull
|
|
|
|
pulling from ssh://user@dummy/server
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
2015-06-13 02:34:35 +03:00
|
|
|
$ hg debugobsolete | sort
|
|
|
|
9467a8ee5d0d993ba68d94946c9d4a3cae8d31ff 0d76868c25e6789734c06e056f235e1fa223da74 * (glob)
|
|
|
|
e73acfaeee82005b2379f82efb73123cbb74a733 d53a62ed14be0980584e1f92f9c47031ef806a62 * (glob)
|
|
|
|
$ hg up d53a62ed14be
|
2015-07-29 23:32:51 +03:00
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2014-11-08 03:27:47 +03:00
|
|
|
$ log
|
2015-07-29 23:32:51 +03:00
|
|
|
@ b => foobar [public:d53a62ed14be]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-29 23:32:51 +03:00
|
|
|
o b => k [public:0d76868c25e6]
|
|
|
|
|
|
|
|
|
o branch left [public:cf07bdf4226e]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o a => baz [public:fb983dc509b6]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => quux [public:741fd2094512]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => baz [public:4cfedb0dc25f]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [public:6a6d9484552c]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
|
o a => bar [public:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
|
|
|
|
|
|
|
$ cd ../server
|
2015-07-30 21:14:14 +03:00
|
|
|
$ hg log -r 0d76868c25e6 -T '{file_copies}\n'
|
|
|
|
k (b)
|
2014-11-08 03:27:47 +03:00
|
|
|
$ log
|
2015-07-29 23:32:51 +03:00
|
|
|
o b => foobar [public:d53a62ed14be]
|
|
|
|
|
|
|
|
|
o b => k [public:0d76868c25e6]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-29 23:32:51 +03:00
|
|
|
o branch left [public:cf07bdf4226e]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
@ a => baz [public:fb983dc509b6]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => quux [public:741fd2094512]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => baz [public:4cfedb0dc25f]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
2015-07-24 00:11:58 +03:00
|
|
|
o b => xxx [public:6a6d9484552c]
|
2014-11-08 03:27:47 +03:00
|
|
|
|
|
|
|
|
o a => bar [public:add0c792bfce]
|
|
|
|
|
|
|
|
|
o initial [public:2bb9d20e471c]
|
|
|
|
|
2015-07-25 01:23:16 +03:00
|
|
|
Test pushing master bookmark, fast forward
|
|
|
|
|
|
|
|
$ hg book -r fb983dc509b6 master
|
|
|
|
$ cd ../client
|
|
|
|
$ hg book master
|
|
|
|
$ echo 'babar' > b
|
|
|
|
$ commit 'b => babar'
|
|
|
|
$ hg log -r master -T"{node}\n"
|
2015-07-29 23:32:51 +03:00
|
|
|
56b2e094996609874ae1c9aae1626bfba61d07d8
|
2015-07-25 01:23:16 +03:00
|
|
|
$ hg push --to master
|
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
2015-10-29 04:19:18 +03:00
|
|
|
remote: pushing 1 commit:
|
|
|
|
remote: 56b2e0949966 b => babar
|
2015-07-25 01:23:16 +03:00
|
|
|
updating bookmark master
|
|
|
|
$ hg log -r master -R ../server -T"{node}\n"
|
2015-07-29 23:32:51 +03:00
|
|
|
56b2e094996609874ae1c9aae1626bfba61d07d8
|
2015-07-25 01:23:16 +03:00
|
|
|
|
|
|
|
Test pushing bookmark with no new commit
|
|
|
|
|
|
|
|
$ hg book stable -r fb983dc509b6
|
|
|
|
$ hg book stable -r fb983dc509b6^ -R ../server
|
|
|
|
$ hg push -r stable --to stable
|
|
|
|
pushing to ssh://user@dummy/server
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
updating bookmark stable
|
|
|
|
[1]
|
|
|
|
$ hg log -r stable -R ../server
|
|
|
|
changeset: 5:fb983dc509b6
|
|
|
|
bookmark: stable
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: a => baz
|
|
|
|
|
2015-09-25 06:03:02 +03:00
|
|
|
|
2015-10-06 04:56:46 +03:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Test that the prepushrebase hook can run against the bundle repo
|
|
|
|
|
|
|
|
$ cat >> $TESTTMP/prerebase.sh <<EOF
|
|
|
|
> hg log -r tip
|
|
|
|
> echo "Checking if lock exists (it should not):"
|
|
|
|
> ls -l .hg/store/lock
|
|
|
|
> EOF
|
|
|
|
$ chmod a+x $TESTTMP/prerebase.sh
|
|
|
|
$ hg init prepushrebaseserver
|
|
|
|
$ cd prepushrebaseserver
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [hooks]
|
|
|
|
> prepushrebase = $TESTTMP/prerebase.sh
|
|
|
|
> [extensions]
|
|
|
|
> pushrebase = $TESTDIR/../pushrebase.py
|
|
|
|
> [experimental]
|
|
|
|
> bundle2lazylocking = True
|
|
|
|
> EOF
|
|
|
|
$ touch a && hg add a && hg commit -qm a
|
|
|
|
$ hg book master
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hg clone ssh://user@dummy/prepushrebaseserver prepushrebaseclient
|
|
|
|
requesting all changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
updating to branch default
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd prepushrebaseclient
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> pushrebase = $TESTDIR/../pushrebase.py
|
|
|
|
> EOF
|
|
|
|
$ touch b && hg add b && hg commit -qm b
|
|
|
|
$ hg push --to master
|
|
|
|
pushing to ssh://user@dummy/prepushrebaseserver
|
|
|
|
searching for changes
|
|
|
|
remote: changeset: 1:0e067c57feba
|
|
|
|
remote: tag: tip
|
|
|
|
remote: user: test
|
|
|
|
remote: date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
remote: summary: b
|
|
|
|
remote:
|
|
|
|
remote: Checking if lock exists (it should not):
|
|
|
|
remote: ls: cannot access .hg/store/lock: No such file or directory
|
2015-10-18 04:59:46 +03:00
|
|
|
abort: prepushrebase hook exited with status 2
|
|
|
|
[255]
|
2015-10-06 04:56:46 +03:00
|
|
|
|
2015-09-25 06:03:02 +03:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Test that hooks are fired with the correct variables
|
|
|
|
|
|
|
|
$ hg init hookserver
|
|
|
|
$ cd hookserver
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [hooks]
|
2015-10-01 23:03:03 +03:00
|
|
|
> changegroup = python "$RUNTESTDIR/printenv.py" changegroup
|
|
|
|
> incoming = python "$RUNTESTDIR/printenv.py" incoming
|
|
|
|
> outgoing = python "$RUNTESTDIR/printenv.py" outgoing
|
|
|
|
> prechangegroup = python "$RUNTESTDIR/printenv.py" prechangegroup
|
|
|
|
> preoutgoing = python "$RUNTESTDIR/printenv.py" preoutgoing
|
|
|
|
> pretxnchangegroup = python "$RUNTESTDIR/printenv.py" pretxnchangegroup
|
|
|
|
> txnclose = python "$RUNTESTDIR/printenv.py" txnclose
|
|
|
|
> pretxnclose = python "$RUNTESTDIR/printenv.py" pretxnclose
|
2015-10-06 04:56:46 +03:00
|
|
|
> prepushrebase = python "$RUNTESTDIR/printenv.py" prepushrebase
|
2015-09-25 06:03:02 +03:00
|
|
|
> [extensions]
|
|
|
|
> pushrebase = $TESTDIR/../pushrebase.py
|
|
|
|
> EOF
|
|
|
|
$ touch file && hg ci -Aqm initial
|
2015-10-01 23:03:03 +03:00
|
|
|
pretxnclose hook: HG_PENDING=$TESTTMP/hookserver HG_PHASES_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
|
|
|
|
txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
|
2015-09-25 06:03:02 +03:00
|
|
|
$ hg bookmark master
|
2015-10-01 23:03:03 +03:00
|
|
|
pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_PENDING=$TESTTMP/hookserver HG_TXNID=TXN:* HG_TXNNAME=bookmark (glob)
|
|
|
|
txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=bookmark (glob)
|
2015-09-25 06:03:02 +03:00
|
|
|
$ cd ../
|
|
|
|
|
|
|
|
$ hg clone hookserver hookclient
|
2015-10-01 23:03:03 +03:00
|
|
|
preoutgoing hook: HG_SOURCE=clone
|
|
|
|
outgoing hook: HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone
|
2015-09-25 06:03:02 +03:00
|
|
|
updating to branch default
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd hookclient
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> pushrebase = $TESTDIR/../pushrebase.py
|
|
|
|
> EOF
|
|
|
|
$ echo >> file && hg ci -Aqm first
|
|
|
|
$ hg push --to master
|
|
|
|
pushing to $TESTTMP/hookserver
|
|
|
|
searching for changes
|
2015-11-05 01:11:03 +03:00
|
|
|
prepushrebase hook: HG_BUNDLE2=1 HG_HOOK_BUNDLEPATH=* HG_NODE=4fcee35c508c1019667f72cae9b843efa8908701 HG_PENDING=$TESTTMP/hookserver HG_SOURCE=push (glob)
|
|
|
|
prechangegroup hook: HG_BUNDLE2=1 HG_PENDING=$TESTTMP/hookserver HG_SOURCE=push HG_TXNID=TXN:* HG_URL=push (glob)
|
2015-10-29 04:19:18 +03:00
|
|
|
pushing 1 commit:
|
|
|
|
4fcee35c508c first
|
2015-10-01 23:03:03 +03:00
|
|
|
pretxnchangegroup hook: HG_BUNDLE2=1 HG_NODE=4fcee35c508c1019667f72cae9b843efa8908701 HG_PENDING=$TESTTMP/hookserver HG_SOURCE=push HG_TXNID=TXN:* HG_URL=push (glob)
|
|
|
|
pretxnclose hook: HG_BUNDLE2=1 HG_NODE=4fcee35c508c1019667f72cae9b843efa8908701 HG_PENDING=$TESTTMP/hookserver HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:* HG_TXNNAME=push HG_URL=push (glob)
|
|
|
|
txnclose hook: HG_BUNDLE2=1 HG_NODE=4fcee35c508c1019667f72cae9b843efa8908701 HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:* HG_TXNNAME=push HG_URL=push (glob)
|
|
|
|
changegroup hook: HG_BUNDLE2=1 HG_NODE=4fcee35c508c1019667f72cae9b843efa8908701 HG_SOURCE=push HG_TXNID=TXN:* HG_URL=push (glob)
|
|
|
|
incoming hook: HG_BUNDLE2=1 HG_NODE=4fcee35c508c1019667f72cae9b843efa8908701 HG_SOURCE=push HG_TXNID=TXN:* HG_URL=push (glob)
|
2015-09-28 01:45:31 +03:00
|
|
|
$ cd ../
|
2015-10-18 04:59:46 +03:00
|
|
|
|
|
|
|
Test date rewriting
|
|
|
|
|
|
|
|
$ hg init rewritedate
|
|
|
|
$ cd rewritedate
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> pushrebase = $TESTDIR/../pushrebase.py
|
|
|
|
> [pushrebase]
|
|
|
|
> rewritedates = True
|
|
|
|
> EOF
|
|
|
|
$ touch a && hg commit -Aqm a
|
|
|
|
$ touch b && hg commit -Aqm b
|
|
|
|
$ hg book master
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hg clone rewritedate rewritedateclient
|
|
|
|
updating to branch default
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd rewritedateclient
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> pushrebase = $TESTDIR/../pushrebase.py
|
|
|
|
> EOF
|
|
|
|
$ hg up 0
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ touch c && hg commit -Aqm c
|
|
|
|
|
|
|
|
$ cat > $TESTTMP/daterewrite.py <<EOF
|
|
|
|
> import sys, time
|
|
|
|
> from mercurial import extensions
|
|
|
|
> def extsetup(ui):
|
|
|
|
> def faketime(orig):
|
|
|
|
> return 1000000000
|
|
|
|
> extensions.wrapfunction(time, 'time', faketime)
|
|
|
|
> EOF
|
|
|
|
$ cat >> ../rewritedate/.hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> daterewrite=$TESTTMP/daterewrite.py
|
|
|
|
> EOF
|
|
|
|
$ hg push --to master
|
|
|
|
pushing to $TESTTMP/rewritedate
|
|
|
|
searching for changes
|
2015-10-29 04:19:18 +03:00
|
|
|
pushing 1 commit:
|
|
|
|
d5e255ef74f8 c
|
|
|
|
1 new commit from the server will be downloaded
|
2015-10-18 04:59:46 +03:00
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 0 changes to 1 files
|
|
|
|
1 new obsolescence markers
|
|
|
|
$ hg log -G -T '{desc} {date|isodate}'
|
|
|
|
o c 2001-09-09 01:46 +0000
|
|
|
|
|
|
|
|
|
| @ c 1970-01-01 00:00 +0000
|
|
|
|
| |
|
|
|
|
o | b 1970-01-01 00:00 +0000
|
|
|
|
|/
|
|
|
|
o a 1970-01-01 00:00 +0000
|
|
|
|
|
2015-10-29 04:19:12 +03:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Test force pushes
|
|
|
|
$ hg init forcepushserver
|
|
|
|
$ cd forcepushserver
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> pushrebase = $TESTDIR/../pushrebase.py
|
|
|
|
> EOF
|
|
|
|
$ echo a > a && hg commit -Aqm a
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hg clone forcepushserver forcepushclient
|
|
|
|
updating to branch default
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd forcepushserver
|
|
|
|
$ echo a >> a && hg commit -Aqm aa
|
|
|
|
|
|
|
|
$ cd ../forcepushclient
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> pushrebase = $TESTDIR/../pushrebase.py
|
|
|
|
> EOF
|
|
|
|
$ hg up 0
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo b >> a && hg commit -Aqm b
|
|
|
|
$ hg book master
|
|
|
|
$ hg push -f --to master -B master
|
|
|
|
pushing to $TESTTMP/forcepushserver
|
|
|
|
searching for changes
|
2015-10-29 04:19:18 +03:00
|
|
|
pushing 1 commit:
|
|
|
|
1846eede8b68 b
|
2015-10-29 04:19:12 +03:00
|
|
|
exporting bookmark master
|
|
|
|
$ hg pull
|
|
|
|
pulling from $TESTTMP/forcepushserver
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files (+1 heads)
|
|
|
|
(run 'hg heads' to see heads, 'hg merge' to merge)
|
|
|
|
$ hg log -G -T '{rev} {desc} {bookmarks}'
|
|
|
|
o 2 aa
|
|
|
|
|
|
|
|
|
| @ 1 b master
|
|
|
|
|/
|
|
|
|
o 0 a
|
|
|
|
|