sapling/eden/hg-server/tests/test-bundle-vs-outgoing.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

145 lines
3.1 KiB
Perl

#chg-compatible
this structure seems to tickle a bug in bundle's search for
changesets, so first we have to recreate it
o 8
|
| o 7
| |
| o 6
|/|
o | 5
| |
o | 4
| |
| o 3
| |
| o 2
|/
o 1
|
o 0
$ mkrev()
> {
> revno=$1
> echo "rev $revno"
> echo "rev $revno" > foo.txt
> hg -q ci -m"rev $revno"
> }
setup test repo1
$ hg init repo1
$ cd repo1
$ echo "rev 0" > foo.txt
$ hg ci -Am"rev 0"
adding foo.txt
$ mkrev 1
rev 1
first branch
$ mkrev 2
rev 2
$ mkrev 3
rev 3
back to rev 1 to create second branch
$ hg up -r6a9ac14c32e0502be005fee0023b823698e3ce41
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ mkrev 4
rev 4
$ mkrev 5
rev 5
merge first branch to second branch
$ hg up -C -r'max(desc(rev))'
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ HGMERGE=internal:local hg merge
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ echo "merge rev 5, rev 3" > foo.txt
$ hg ci -m"merge first branch to second branch"
one more commit following the merge
$ mkrev 7
rev 7
back to "second branch" to make another head
$ hg up -ree67ca2f52ac8c7904cc477b8cf04da764fea594
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ mkrev 8
rev 8
the story so far
$ hg log -G --template "{node}\n"
@ 5f52be4fcfe9ac3202b79e6beb8804d871b98e10
o de61c22a80e9fbe65e3f207212eb55d9c56e491b
o a1e3db6b8fc126320c3bffd4c4b163c0d7f5038f
o ee67ca2f52ac8c7904cc477b8cf04da764fea594
o 4afa705929a3d9af58f4b035944e8ee600c7b571
o 478f191e53f84ddec1d358da2ed34eb796b3ac6f
o c20e19c90a429c37cf2b85b397ebd3f3639ae890
o 6a9ac14c32e0502be005fee0023b823698e3ce41
o 6ae4cca4e39a527c4158d3b0fd73882b50e45484
check that "hg outgoing" really does the right thing
sanity check of outgoing: expect revs 4 5 6 7 8
$ hg clone -r3 . ../repo2
adding changesets
adding manifests
adding file changes
added 4 changesets with 4 changes to 1 files
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
this should (and does) report 5 outgoing revisions: 4 5 6 7 8
$ hg outgoing --template "{node}\n" ../repo2
comparing with ../repo2
searching for changes
4afa705929a3d9af58f4b035944e8ee600c7b571
ee67ca2f52ac8c7904cc477b8cf04da764fea594
a1e3db6b8fc126320c3bffd4c4b163c0d7f5038f
de61c22a80e9fbe65e3f207212eb55d9c56e491b
5f52be4fcfe9ac3202b79e6beb8804d871b98e10
test bundle (destination repo): expect 5 revisions
this should bundle the same 5 revisions that outgoing reported, but it
actually bundles 7
$ hg bundle foo.bundle ../repo2
searching for changes
5 changesets found
test bundle (base revision): expect 5 revisions
this should (and does) give exactly the same result as bundle
with a destination repo... i.e. it's wrong too
$ hg bundle --base 478f191e53f84ddec1d358da2ed34eb796b3ac6f foo.bundle
5 changesets found
$ cd ..