mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
906035f526
Summary: Super-basic implementation of generating changegroup part in getbundle. All it does is sending changelog entries - so no manifest and no filelog entries. While it's very simple, it may actually be enough for a real production use-case. With treemanifest and remotefilelog we don't need to pull anything except for changelog entries, everything else will be downloaded on demand. Reviewed By: jsgf Differential Revision: D6748070 fbshipit-source-id: 1dcd802a4b3b111f935e713e7696d58f05861b77
170 lines
3.6 KiB
Perl
170 lines
3.6 KiB
Perl
$ . $TESTDIR/library.sh
|
|
|
|
setup configuration
|
|
|
|
$ hg init mononoke-config
|
|
$ cd mononoke-config
|
|
$ mkdir repos
|
|
$ cat > repos/repo <<CONFIG
|
|
> path="$TESTTMP/repo"
|
|
> repotype="blob:files"
|
|
> CONFIG
|
|
$ hg add repos
|
|
adding repos/repo
|
|
$ hg ci -ma
|
|
$ hg bookmark test-config
|
|
$ hg log
|
|
changeset: 0:* (glob)
|
|
bookmark: test-config
|
|
tag: tip
|
|
user: test
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
summary: a
|
|
|
|
|
|
$ cd $TESTTMP
|
|
|
|
setup common configuration
|
|
$ cat >> $HGRCPATH <<EOF
|
|
> [ui]
|
|
> ssh="$DUMMYSSH"
|
|
> EOF
|
|
|
|
|
|
setup repo
|
|
|
|
$ hg init repo-hg
|
|
|
|
Init treemanifest and remotefilelog
|
|
$ cd repo-hg
|
|
$ cat >> .hg/hgrc <<EOF
|
|
> [extensions]
|
|
> treemanifest=
|
|
> remotefilelog=
|
|
> [treemanifest]
|
|
> server=True
|
|
> [remotefilelog]
|
|
> server=True
|
|
> shallowtrees=True
|
|
> EOF
|
|
|
|
$ touch a
|
|
$ hg add a
|
|
$ hg ci -ma
|
|
$ hg log
|
|
changeset: 0:3903775176ed
|
|
tag: tip
|
|
user: test
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
summary: a
|
|
|
|
$ cd $TESTTMP
|
|
|
|
setup repo2
|
|
$ cat >> $HGRCPATH <<EOF
|
|
> [extensions]
|
|
> remotefilelog=
|
|
> [remotefilelog]
|
|
> cachepath=$TESTTMP/cachepath
|
|
> EOF
|
|
$ hgcloneshallow ssh://user@dummy/repo-hg repo2 --noupdate
|
|
requesting all changes
|
|
adding changesets
|
|
adding manifests
|
|
adding file changes
|
|
added 1 changesets with 0 changes to 0 files
|
|
new changesets 3903775176ed
|
|
|
|
$ cd repo2
|
|
$ cat >> .hg/hgrc <<EOF
|
|
> [extensions]
|
|
> treemanifest=
|
|
> remotefilelog=
|
|
> [treemanifest]
|
|
> server=False
|
|
> treeonly=True
|
|
> [remotefilelog]
|
|
> server=False
|
|
> reponame=repo
|
|
> EOF
|
|
$ hg pull
|
|
pulling from ssh://user@dummy/repo-hg
|
|
searching for changes
|
|
no changes found
|
|
|
|
$ cd $TESTTMP
|
|
$ cd repo-hg
|
|
$ touch b
|
|
$ hg add b
|
|
$ hg ci -mb
|
|
$ hg log
|
|
changeset: 1:0e067c57feba
|
|
tag: tip
|
|
user: test
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
summary: b
|
|
|
|
changeset: 0:3903775176ed
|
|
user: test
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
summary: a
|
|
|
|
$ cd ..
|
|
$ blobimport --blobstore files --linknodes repo-hg repo > /dev/null 2>&1
|
|
|
|
blobimport currently doesn't handle bookmarks, but server requires the directory.
|
|
$ mkdir -p repo/books
|
|
|
|
Need a place for the socket to live
|
|
$ mkdir -p repo/.hg
|
|
|
|
start mononoke
|
|
|
|
$ mononoke -P $TESTTMP/mononoke-config -B test-config
|
|
$ wait_for_mononoke $TESTTMP/repo
|
|
$ hgmn debugwireargs ssh://user@dummy/repo one two --three three
|
|
one two three None None
|
|
|
|
$ cd repo2
|
|
$ hg up 0
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ hgmn pull ssh://user@dummy/repo --traceback
|
|
pulling from ssh://user@dummy/repo
|
|
searching for changes
|
|
adding changesets
|
|
adding manifests
|
|
adding file changes
|
|
added 1 changesets with 0 changes to 0 files
|
|
new changesets 0e067c57feba
|
|
(run 'hg update' to get a working copy)
|
|
$ hg log -r 0e067c57feba
|
|
changeset: 1:0e067c57feba
|
|
tag: tip
|
|
user: test
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
summary: b
|
|
|
|
$ ls
|
|
a
|
|
$ hg up 0e067c57feba
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ ls
|
|
a
|
|
b
|
|
|
|
Create a new bookmark and try and send it over the wire
|
|
Test commented while we have no bookmark support in blobimport or easy method
|
|
to create a fileblob bookmark
|
|
# $ cd ../repo
|
|
# $ hg bookmark test-bookmark
|
|
# $ hg bookmarks
|
|
# * test-bookmark 0:3903775176ed
|
|
# $ cd ../repo2
|
|
# $ hgmn pull ssh://user@dummy/repo
|
|
# pulling from ssh://user@dummy/repo
|
|
# searching for changes
|
|
# no changes found
|
|
# adding remote bookmark test-bookmark
|
|
# $ hg bookmarks
|
|
# test-bookmark 0:3903775176ed
|