sapling/eden/hg-server/tests/test-mutation-pushrebase.t
Durham Goode 98d9269874 server: copy hg to a new hg-server directory
Summary:
Create a fork of the Mercurial code that we can use to build server
rpms. The hg servers will continue to exist for a few more months while we move
the darkstorm and ediscovery use cases off them. In the mean time, we want to
start making breaking changes to the client, so let's create a stable copy of
the hg code to produce rpms for the hg servers.

The fork is based off c7770c78d, the latest hg release.

This copies the files as is, then adds some minor tweaks to get it to build:
- Disables some lint checks that appear to be bypassed by path
- sed replace eden/scm with eden/hg-server
- Removed a dependency on scm/telemetry from the edenfs-client tests since
  scm/telemetry pulls in the original eden/scm/lib/configparser which conflicts
  with the hg-server conflict parser.

allow-large-files

Reviewed By: quark-zju

Differential Revision: D27632557

fbshipit-source-id: b2f442f4ec000ea08e4d62de068750832198e1f4
2021-04-09 10:09:06 -07:00

205 lines
5.4 KiB
Raku

#chg-compatible
$ configure dummyssh
$ disable treemanifest
$ enable pushrebase amend remotenames
$ setconfig experimental.evolution=obsolete
$ setconfig experimental.narrow-heads=true
$ setconfig visibility.enabled=true
$ setconfig mutation.record=true mutation.enabled=true mutation.date="0 0"
$ setconfig pushrebase.trystackpush=true
Set up server repository
$ hg init server
$ cd server
$ setconfig experimental.narrow-heads=false
$ echo 1 > a
$ echo 2 > b
$ hg commit -Aqm base
$ hg bookmark master
Set up client repository
$ cd ..
$ hg clone ssh://user@dummy/server client -q
Add more commits on the server
$ cd server
$ echo 3 > c
$ hg commit -Aqm s1
$ echo 4 > d
$ hg commit -Aqm s2
$ hg bookmark master
Pushrebase some commits from the client
$ cd ../client
$ echo 5 > e
$ hg commit -Aqm c1
$ echo 6 > f
$ hg commit -Aqm c2
$ echo 6a > f
$ hg amend -qm "c2 (amended)"
$ tglogp
@ e52ebff26308 draft 'c2 (amended)'
o b0c40d8745c8 draft 'c1'
o a7d6a32ae4ec public 'base'
$ hg push --to master
pushing rev e52ebff26308 to destination ssh://user@dummy/server bookmark master
searching for changes
adding changesets
adding manifests
adding file changes
added 4 changesets with 2 changes to 4 files
updating bookmark master
remote: pushing 2 changesets:
remote: b0c40d8745c8 c1
remote: e52ebff26308 c2 (amended)
remote: 4 new changesets from the server will be downloaded
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ tglogp
@ bc165ecd11df public 'c2 (amended)'
o 466bbcaf803c public 'c1'
o 1f850c9f0d59 public 's2'
o 06569a64c141 public 's1'
o a7d6a32ae4ec public 'base'
$ hg debugmutation -r ::tip
* a7d6a32ae4ecf473d6f934e731f1868dda4d3fc9
* 06569a64c14156339463c64337f9cb5dc3a25442
* 1f850c9f0d599261fce148d3d19cdc89d8eb391f
* 466bbcaf803c40b7121013141b842e654ee07f7f pushrebase by test at 1970-01-01T00:00:00 from:
b0c40d8745c83226015263d45e60a0d12722c515
* bc165ecd11df56066a4d73e8294a85ecb255d3cf pushrebase by test at 1970-01-01T00:00:00 from:
e52ebff2630810cbc8bc0e3a8de78cb662f0865f amend by test at 1970-01-01T00:00:00 from:
f558c5855324eea33b5f046b45b85db1fb98bca7
$ cd ../server
$ tglogp
o bc165ecd11df public 'c2 (amended)' master
o 466bbcaf803c public 'c1'
@ 1f850c9f0d59 public 's2'
o 06569a64c141 public 's1'
o a7d6a32ae4ec public 'base'
$ hg debugmutation -r ::tip
* a7d6a32ae4ecf473d6f934e731f1868dda4d3fc9
* 06569a64c14156339463c64337f9cb5dc3a25442
* 1f850c9f0d599261fce148d3d19cdc89d8eb391f
* 466bbcaf803c40b7121013141b842e654ee07f7f pushrebase by test at 1970-01-01T00:00:00 from:
b0c40d8745c83226015263d45e60a0d12722c515
* bc165ecd11df56066a4d73e8294a85ecb255d3cf pushrebase by test at 1970-01-01T00:00:00 from:
e52ebff2630810cbc8bc0e3a8de78cb662f0865f
Test pushing to a server that does not have mutation recording enabled. Synthetic mutation
entries will be contructed from the obsmarkers that pushrebase returns.
$ cd ../server
$ cat >> .hg/hgrc <<EOF
> [mutation]
> record=false
> enabled=false
> EOF
Push an original commit to the server. This doesn't get pushrebased.
$ cd ../client
$ echo 9 > i
$ hg commit -Aqm c3
$ hg push --to master
pushing rev 5cfa12ac15ac to destination ssh://user@dummy/server bookmark master
searching for changes
updating bookmark master
remote: pushing 1 changeset:
remote: 5cfa12ac15ac c3
$ hg debugmutation
* 5cfa12ac15aca3668b5f91e5a7b92aa309b320a9
Add commits on the server to pushrebase over.
$ cd ../server
$ hg up -q master
$ echo 7 > g
$ hg commit -Aqm s3
$ echo 8 > h
$ hg commit -Aqm s4
Add another commit on the client.
$ cd ../client
$ echo 10 > j
$ hg commit -Aqm c4
$ echo 10a > j
$ hg amend -qm "c4 (amended)"
$ tglogp
@ 254a42c0dcef draft 'c4 (amended)'
o 5cfa12ac15ac public 'c3'
o bc165ecd11df public 'c2 (amended)'
o 466bbcaf803c public 'c1'
o 1f850c9f0d59 public 's2'
o 06569a64c141 public 's1'
o a7d6a32ae4ec public 'base'
Push this commit to the server. We should create local mutation information.
$ hg push --to master
pushing rev 254a42c0dcef to destination ssh://user@dummy/server bookmark master
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 2 changes to 3 files
updating bookmark master
remote: pushing 1 changeset:
remote: 254a42c0dcef c4 (amended)
remote: 3 new changesets from the server will be downloaded
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg debugmutation -r ".~4::."
* bc165ecd11df56066a4d73e8294a85ecb255d3cf pushrebase by test at 1970-01-01T00:00:00 from:
e52ebff2630810cbc8bc0e3a8de78cb662f0865f amend by test at 1970-01-01T00:00:00 from:
f558c5855324eea33b5f046b45b85db1fb98bca7
* 5cfa12ac15aca3668b5f91e5a7b92aa309b320a9
* 34295f2adc0954d129b43d9ad2d785376eacc3b6
* b6dffa66e38820804c5eaf4d2c9477718f537ce3
* 56ff167c1749dc765639745247323a6139cd9514 pushrebase by test at 1970-01-01T00:00:00 from:
254a42c0dcef8381419add47e4f0ff6cd50ea8c7 amend by test at 1970-01-01T00:00:00 from:
3f1b3b3d517fcd3c8cef763476c588fb99343c3d