2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-06-11 03:33:43 +03:00
|
|
|
$ configure dummyssh mutation-norecord
|
2020-01-20 13:42:49 +03:00
|
|
|
$ disable treemanifest
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable amend arcdiff commitcloud infinitepush rebase remotenames share
|
|
|
|
$ setconfig extensions.arcconfig="$TESTDIR/../edenscm/hgext/extlib/phabricator/arcconfig.py"
|
|
|
|
$ setconfig infinitepush.branchpattern="re:scratch/.*" commitcloud.hostname=testhost
|
|
|
|
$ readconfig <<EOF
|
2018-08-24 15:44:19 +03:00
|
|
|
> [alias]
|
|
|
|
> trglog = log -G --template "{node|short} '{desc}' {bookmarks} {remotenames}\n"
|
|
|
|
> descr = log -r '.' --template "{desc}"
|
|
|
|
> EOF
|
|
|
|
|
2019-05-10 19:56:31 +03:00
|
|
|
$ setconfig remotefilelog.reponame=server
|
|
|
|
|
2018-08-24 15:44:19 +03:00
|
|
|
$ mkcommit() {
|
|
|
|
> echo "$1" > "$1"
|
|
|
|
> hg commit -Aqm "$1"
|
|
|
|
> }
|
|
|
|
|
|
|
|
$ hg init server
|
|
|
|
$ cd server
|
|
|
|
$ cat >> .hg/hgrc << EOF
|
|
|
|
> [infinitepush]
|
|
|
|
> server = yes
|
|
|
|
> indextype = disk
|
|
|
|
> storetype = disk
|
|
|
|
> reponame = testrepo
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
$ mkcommit "base"
|
2020-06-29 23:51:53 +03:00
|
|
|
$ hg bookmark master
|
2018-08-24 15:44:19 +03:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Make shared part of config
|
|
|
|
$ cat >> shared.rc << EOF
|
|
|
|
> [commitcloud]
|
|
|
|
> servicetype = local
|
|
|
|
> servicelocation = $TESTTMP
|
2020-07-31 20:14:47 +03:00
|
|
|
> token_enforced = False
|
2018-08-24 15:44:19 +03:00
|
|
|
> EOF
|
|
|
|
|
|
|
|
Make the first clone of the server
|
|
|
|
$ hg clone ssh://user@dummy/server client1 -q
|
|
|
|
$ cd client1
|
|
|
|
$ cat ../shared.rc >> .hg/hgrc
|
|
|
|
$ hg cloud join -q
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Make the second clone of the server
|
|
|
|
$ hg clone ssh://user@dummy/server client2 -q
|
|
|
|
$ cd client2
|
|
|
|
$ cat ../shared.rc >> .hg/hgrc
|
|
|
|
$ hg cloud join -q
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Make the third clone of the server
|
|
|
|
$ hg clone ssh://user@dummy/server client3 -q
|
|
|
|
$ cd client3
|
|
|
|
$ cat ../shared.rc >> .hg/hgrc
|
|
|
|
$ hg cloud join -q
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Test for `hg diff --since-last-submit`
|
|
|
|
|
|
|
|
$ cd client1
|
|
|
|
$ echo '{}' > .arcrc
|
2020-10-29 16:11:27 +03:00
|
|
|
$ echo '{"config" : {"default" : "https://a.com/api"}, "hosts" : {"https://a.com/api/" : { "user" : "testuser", "oauth" : "garbage_cert"}}}' > .arcconfig
|
2018-08-24 15:44:19 +03:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ cd client2
|
|
|
|
$ echo '{}' > .arcrc
|
2020-10-29 16:11:27 +03:00
|
|
|
$ echo '{"config" : {"default" : "https://a.com/api"}, "hosts" : {"https://a.com/api/" : { "user" : "testuser", "oauth" : "garbage_cert"}}}' > .arcconfig
|
2018-08-24 15:44:19 +03:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ cd client3
|
|
|
|
$ echo '{}' > .arcrc
|
2020-10-29 16:11:27 +03:00
|
|
|
$ echo '{"config" : {"default" : "https://a.com/api"}, "hosts" : {"https://a.com/api/" : { "user" : "testuser", "oauth" : "garbage_cert"}}}' > .arcconfig
|
2018-08-24 15:44:19 +03:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ cd client1
|
|
|
|
|
|
|
|
$ echo "Hello feature2" > feature2.body.txt
|
|
|
|
$ hg add feature2.body.txt
|
|
|
|
|
|
|
|
$ hg ci -Aqm 'Differential Revision: https://phabricator.fb.com/D1'
|
|
|
|
$ hg log -r '.' -T '{node}'
|
2020-10-29 16:11:27 +03:00
|
|
|
162e0a8b5732f1fa168b0a6d8cf9809053ae272a (no-eol)
|
2018-08-24 15:44:19 +03:00
|
|
|
$ hg cloud sync
|
2019-05-09 16:50:03 +03:00
|
|
|
commitcloud: synchronizing 'server' with 'user/test/default'
|
2020-10-29 16:11:27 +03:00
|
|
|
backing up stack rooted at 162e0a8b5732
|
2019-05-09 16:50:03 +03:00
|
|
|
commitcloud: commits synchronized
|
2019-02-21 02:20:11 +03:00
|
|
|
finished in * (glob)
|
2020-02-28 04:51:13 +03:00
|
|
|
remote: pushing 1 commit:
|
2020-10-29 16:11:27 +03:00
|
|
|
remote: 162e0a8b5732 Differential Revision: https://phabricator.fb.com/
|
2018-08-24 15:44:19 +03:00
|
|
|
|
|
|
|
$ cat > $TESTTMP/mockduit << EOF
|
|
|
|
> [{"data": {"query": [{"results": {"nodes": [{
|
|
|
|
> "number": 1,
|
|
|
|
> "diff_status_name": "Needs Review",
|
|
|
|
> "latest_active_diff": {
|
|
|
|
> "local_commit_info": {
|
|
|
|
> "nodes": [
|
2020-10-29 16:11:27 +03:00
|
|
|
> {"property_value": "{\"lolwut\": {\"time\": 0, \"commit\": \"162e0a8b5732f1fa168b0a6d8cf9809053ae272a\"}}"}
|
2018-08-24 15:44:19 +03:00
|
|
|
> ]
|
|
|
|
> }
|
|
|
|
> },
|
|
|
|
> "differential_diffs": {"count": 1},
|
|
|
|
> "is_landing": false,
|
|
|
|
> "created_time": 123,
|
|
|
|
> "updated_time": 222
|
|
|
|
> }]}}]}}]
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
$ echo "Hello feature2 update" > feature2.body.txt
|
|
|
|
$ hg amend
|
|
|
|
|
|
|
|
$ hg cloud sync
|
2019-05-09 16:50:03 +03:00
|
|
|
commitcloud: synchronizing 'server' with 'user/test/default'
|
2020-10-29 16:11:27 +03:00
|
|
|
backing up stack rooted at 1166f984c176
|
2019-05-09 16:50:03 +03:00
|
|
|
commitcloud: commits synchronized
|
2019-02-21 02:20:11 +03:00
|
|
|
finished in * (glob)
|
2020-02-28 04:51:13 +03:00
|
|
|
remote: pushing 1 commit:
|
2020-10-29 16:11:27 +03:00
|
|
|
remote: 1166f984c176 Differential Revision: https://phabricator.fb.com/
|
2018-08-24 15:44:19 +03:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ cd client2
|
|
|
|
|
|
|
|
$ hg cloud sync
|
2019-05-09 16:50:03 +03:00
|
|
|
commitcloud: synchronizing 'server' with 'user/test/default'
|
2020-10-29 16:11:27 +03:00
|
|
|
pulling 1166f984c176 from ssh://user@dummy/server
|
2018-08-24 15:44:19 +03:00
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 3 changes to 3 files
|
2019-05-09 16:50:03 +03:00
|
|
|
commitcloud: commits synchronized
|
2019-02-21 02:20:11 +03:00
|
|
|
finished in * (glob)
|
2018-08-24 15:44:19 +03:00
|
|
|
|
2020-10-29 16:11:27 +03:00
|
|
|
$ hg up 1166f984c176
|
2018-08-24 15:44:19 +03:00
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ HG_ARC_CONDUIT_MOCK=$TESTTMP/mockduit hg diff --since-last-submit --config extensions.commitcloud=!
|
2020-10-29 16:11:27 +03:00
|
|
|
pulling '162e0a8b5732f1fa168b0a6d8cf9809053ae272a' from 'ssh://user@dummy/server'
|
|
|
|
diff -r 162e0a8b5732 -r 1166f984c176 feature2.body.txt
|
2020-06-11 03:33:43 +03:00
|
|
|
--- a/feature2.body.txt Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/feature2.body.txt Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -1,1 +1,1 @@
|
|
|
|
-Hello feature2
|
|
|
|
+Hello feature2 update
|
2018-08-24 15:44:19 +03:00
|
|
|
|
|
|
|
$ HG_ARC_CONDUIT_MOCK=$TESTTMP/mockduit hg diff --since-last-submit
|
2020-10-29 16:11:27 +03:00
|
|
|
diff -r 162e0a8b5732 -r 1166f984c176 feature2.body.txt
|
2018-08-24 15:44:19 +03:00
|
|
|
--- a/feature2.body.txt Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/feature2.body.txt Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -1,1 +1,1 @@
|
|
|
|
-Hello feature2
|
|
|
|
+Hello feature2 update
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ cd client3
|
|
|
|
|
|
|
|
$ hg cloud sync
|
2019-05-09 16:50:03 +03:00
|
|
|
commitcloud: synchronizing 'server' with 'user/test/default'
|
2020-10-29 16:11:27 +03:00
|
|
|
pulling 1166f984c176 from ssh://user@dummy/server
|
2018-08-24 15:44:19 +03:00
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 3 changes to 3 files
|
2019-05-09 16:50:03 +03:00
|
|
|
commitcloud: commits synchronized
|
2019-02-21 02:20:11 +03:00
|
|
|
finished in * (glob)
|
2018-08-24 15:44:19 +03:00
|
|
|
|
2020-10-29 16:11:27 +03:00
|
|
|
$ hg up 1166f984c176
|
2018-08-24 15:44:19 +03:00
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ HG_ARC_CONDUIT_MOCK=$TESTTMP/mockduit hg log -r 'lastsubmitted(.)' -T '{node} {desc}' --config extensions.commitcloud=!
|
2020-10-29 16:11:27 +03:00
|
|
|
pulling '162e0a8b5732f1fa168b0a6d8cf9809053ae272a' from 'ssh://user@dummy/server'
|
|
|
|
162e0a8b5732f1fa168b0a6d8cf9809053ae272a Differential Revision: https://phabricator.fb.com/D1 (no-eol)
|
2018-08-24 15:44:19 +03:00
|
|
|
|
2020-04-10 20:56:22 +03:00
|
|
|
$ HG_ARC_CONDUIT_MOCK=$TESTTMP/mockduit hg log --hidden -r 'lastsubmitted(.)' -T '{node} {desc}'
|
2020-10-29 16:11:27 +03:00
|
|
|
162e0a8b5732f1fa168b0a6d8cf9809053ae272a Differential Revision: https://phabricator.fb.com/D1 (no-eol)
|