sapling/eden/scm/tests/test-commitcloud-lazypull.t
Liubov Dmitrieva f92f4bcbae clean up token code
Summary:
clean up token code

Client Certs based authentification (user_agent based or X.509 certificate
based, the same as for monoke/edenapi services) is now the only supported way to talk to the Commit Cloud service.

Historically, we had another way to access the Commit Cloud Service, via an
interngraph proxy. The proxy has been shut down a while ago. The auth there was
token based. We supported CAT & OAUth tokens there.

The proxy shut down happened here after all traffic has been migrated to the certs: D29934907

Reviewed By: mzr

Differential Revision: D40098326

fbshipit-source-id: 63a3a8705eb14858ac11c7f8e8784202d08fc481
2022-10-05 10:10:47 -07:00

185 lines
4.9 KiB
Perl

#chg-compatible
#debugruntest-compatible
$ setconfig experimental.allowfilepeer=True
$ configure dummyssh mutation-norecord
$ enable amend commitcloud infinitepush rebase remotenames share
$ setconfig infinitepush.branchpattern="re:scratch/.*" commitcloud.hostname=testhost
$ readconfig <<EOF
> [alias]
> trglog = log -G --template "{node|short} '{desc}' {bookmarks} {remotenames}\n"
> descr = log -r '.' --template "{desc}"
> EOF
$ setconfig remotefilelog.reponame=server
$ 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"
$ hg bookmark master
$ cd ..
Make shared part of config
$ cat >> shared.rc << EOF
> [commitcloud]
> servicetype = local
> servicelocation = $TESTTMP
> 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 ..
Test for `hg unamend`
Make a commit in the first client, and sync it
$ cd client1
$ mkcommit "feature1"
$ hg cloud sync
commitcloud: synchronizing 'server' with 'user/test/default'
backing up stack rooted at 1cf4a5a0e8fc
commitcloud: commits synchronized
finished in * (glob)
remote: pushing 1 commit:
remote: 1cf4a5a0e8fc feature1
$ hg amend -m "feature1 renamed"
$ hg cloud sync
commitcloud: synchronizing 'server' with 'user/test/default'
backing up stack rooted at b68dd726c6c6
commitcloud: commits synchronized
finished in * (glob)
remote: pushing 1 commit:
remote: b68dd726c6c6 feature1 renamed
$ cd ..
Sync from the second client and `hg unamend` there
$ cd client2
$ hg cloud sync
commitcloud: synchronizing 'server' with 'user/test/default'
pulling b68dd726c6c6 from ssh://user@dummy/server
searching for changes
adding changesets
adding manifests
adding file changes
commitcloud: commits synchronized
finished in * (glob)
$ tglog
o b68dd726c6c6 'feature1 renamed'
@ d20a80d4def3 'base'
$ hg up b68dd726c6c6
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg unamend
pulling '1cf4a5a0e8fc41ef1289e833ebdb22d754c080ac' from 'ssh://user@dummy/server'
$ tglog
@ 1cf4a5a0e8fc 'feature1'
o d20a80d4def3 'base'
(with mutation and visibility, it's not possible to undo the relationship of
amend, therefore the "has been replaced" message)
$ hg cloud sync
commitcloud: synchronizing 'server' with 'user/test/default'
commitcloud: commits synchronized
finished in * (glob)
$ cd ..
$ cd client1
$ hg cloud sync
commitcloud: synchronizing 'server' with 'user/test/default'
commitcloud: commits synchronized
finished in * (glob)
$ tglog
@ b68dd726c6c6 'feature1 renamed'
│ x 1cf4a5a0e8fc 'feature1'
├─╯
o d20a80d4def3 'base'
Amend twice, unamend, then unhide
$ hg up -q 1cf4a5a0e8fc
$ hg amend -m "feature1 renamed2"
$ hg amend -m "feature1 renamed3"
$ hg unamend
$ hg unhide 74b668b6b779
$ tglog
o 74b668b6b779 'feature1 renamed3'
│ @ cb45bbd0ae75 'feature1 renamed2'
├─╯
o d20a80d4def3 'base'
$ P=1 hg cloud sync
commitcloud: synchronizing 'server' with 'user/test/default'
backing up stack rooted at cb45bbd0ae75
backing up stack rooted at 74b668b6b779
commitcloud: commits synchronized
finished in * sec (glob)
commitcloud: current revision cb45bbd0ae75 has been moved remotely to 74b668b6b779
hint[commitcloud-update-on-move]: if you would like to update to the moved version automatically add
[commitcloud]
updateonmove = true
to your .hgrc config file
hint[hint-ack]: use 'hg hint --ack commitcloud-update-on-move' to silence these hints
remote: pushing 1 commit:
remote: cb45bbd0ae75 feature1 renamed2
remote: pushing 1 commit:
remote: 74b668b6b779 feature1 renamed3
Now cloud sync in the other client. The cycle means we can't reliably pick a destination.
$ cd ../client2
$ hg cloud sync
commitcloud: synchronizing 'server' with 'user/test/default'
pulling cb45bbd0ae75 74b668b6b779 from ssh://user@dummy/server
searching for changes
adding changesets
adding manifests
adding file changes
adding changesets
adding manifests
adding file changes
commitcloud: commits synchronized
finished in * sec (glob)
commitcloud: current revision 1cf4a5a0e8fc has been moved remotely to 74b668b6b779
hint[commitcloud-update-on-move]: if you would like to update to the moved version automatically add
[commitcloud]
updateonmove = true
to your .hgrc config file
hint[hint-ack]: use 'hg hint --ack commitcloud-update-on-move' to silence these hints