sapling/eden/hg-server/tests/test-lfs-localstore.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

61 lines
1.5 KiB
Perl

#chg-compatible
Test the lfs.localstore config option
$ enable lfs
$ setconfig lfs.url=file://$TESTTMP/remote lfs.threshold=1
$ newrepo
$ drawdag <<'EOS'
> C2
> |
> C1
> EOS
Both commits create LFS files (flag=2000)
$ hg debugfilerevision -r 'all()'
31b5f55a8b18: C1
C1: bin=0 lnk=0 flag=2000 size=2 copied='' chain=c1f06831b8f9
a6f371762961: C2
C2: bin=0 lnk=0 flag=2000 size=2 copied='' chain=cee8fd3a5958
Upload them to remote store
$ hg debuglfsupload -r 'all()'
$ cd $TESTTMP
$ find remote | grep '/../' | sort
remote/96/85eb765661ea3b95f31e1bb3c3b5501d0c2acdf353feeaa4d8fe32f95f77fb
remote/ab/861dc170dc2e43224e45278d3d31a675b9ebc34c9b0f48c066ca1eeaed8ee6
$ cd - &>/dev/null
Remove the local store
$ rm -rf .hg/store/lfs
Checking out would download LFS files from remote store to local store
$ hg up -q $C1
$ find .hg/store/lfs | grep '/../' | sort
.hg/store/lfs/objects/ab/861dc170dc2e43224e45278d3d31a675b9ebc34c9b0f48c066ca1eeaed8ee6
$ hg up -q $C2
$ find .hg/store/lfs | grep '/../' | sort
.hg/store/lfs/objects/96/85eb765661ea3b95f31e1bb3c3b5501d0c2acdf353feeaa4d8fe32f95f77fb
.hg/store/lfs/objects/ab/861dc170dc2e43224e45278d3d31a675b9ebc34c9b0f48c066ca1eeaed8ee6
When configured with localstore=false, checking out would skip writing to local store
$ hg up -q null
$ rm -rf .hg/store/lfs
$ setconfig lfs.localstore=false
$ hg up -q $C1
$ test -d .hg/store/lfs
[1]
$ hg up -q $C2
$ test -d .hg/store/lfs
[1]