mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
98d9269874
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
59 lines
2.4 KiB
Perl
59 lines
2.4 KiB
Perl
Load commonly used test logic
|
|
$ . "$TESTDIR/hggit/testutil"
|
|
|
|
$ git init -q gitrepo
|
|
$ cd gitrepo
|
|
$ echo alpha > alpha
|
|
$ git add alpha
|
|
$ fn_git_commit -m 'add alpha'
|
|
$ echo beta > beta
|
|
$ git add beta
|
|
$ fn_git_commit -m 'add beta'
|
|
|
|
This commit is called gamma10 so that its hash will have the same initial digit
|
|
as commit alpha. This lets us test ambiguous abbreviated identifiers.
|
|
|
|
$ echo gamma10 > gamma10
|
|
$ git add gamma10
|
|
$ fn_git_commit -m 'add gamma10'
|
|
|
|
$ cd ..
|
|
|
|
$ hg clone gitrepo hgrepo | grep -v '^updating'
|
|
importing git objects into hg
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ cd hgrepo
|
|
$ echo gamma > gamma
|
|
$ hg add gamma
|
|
$ hg commit -m 'add gamma'
|
|
|
|
Remove the mapfile so we can ensure the gitnode is from the extras not the mapfile.
|
|
|
|
$ mv .hg/git-mapfile .hg/git-mapfile-bak
|
|
$ hg log --template "{node} {node|short} {gitnode} {gitnode|short}\n"
|
|
f5172ebb976873f9e41d2958e3b665a985128b00 f5172ebb9768
|
|
fedf4edd982fb98273f2255d6b97c892ec208427 fedf4edd982f 7e2a5465ff4e3b992c429bb87a392620a0ac97b7 7e2a5465ff4e
|
|
3bb02b6794ddc0b498cdc15f59f2e6724cabfa2f 3bb02b6794dd 9497a4ee62e16ee641860d7677cdb2589ea15554 9497a4ee62e1
|
|
69982ec78c6dd2f24b3b62f3e2baaa79ab48ed93 69982ec78c6d 7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03 7eeab2ea75ec
|
|
$ mv .hg/git-mapfile-bak .hg/git-mapfile
|
|
$ hg log --template "fromgit {node}\n" --rev "fromgit()"
|
|
fromgit 69982ec78c6dd2f24b3b62f3e2baaa79ab48ed93
|
|
fromgit 3bb02b6794ddc0b498cdc15f59f2e6724cabfa2f
|
|
fromgit fedf4edd982fb98273f2255d6b97c892ec208427
|
|
$ hg log --template "gitnode_existsA {node}\n" --rev "gitnode(9497a4ee62e16ee641860d7677cdb2589ea15554)"
|
|
gitnode_existsA 3bb02b6794ddc0b498cdc15f59f2e6724cabfa2f
|
|
$ hg log --template "gitnode_existsB {node}\n" --rev "gitnode(7eeab)"
|
|
gitnode_existsB 69982ec78c6dd2f24b3b62f3e2baaa79ab48ed93
|
|
$ hg log --rev "gitnode(7e)"
|
|
abort: git-mapfile@7e: ambiguous identifier!
|
|
[255]
|
|
$ hg log --template "gitnode_notexists {node}\n" --rev "gitnode(1234567890ab)"
|
|
|
|
Try other extensioins that provide "{gitnode}":
|
|
$ hg log -r 'tip^' --template "{gitnode}\n"
|
|
7e2a5465ff4e3b992c429bb87a392620a0ac97b7
|
|
$ hg log -r 'tip^' --template "{gitnode}\n" --config extensions.fbscmquery=
|
|
7e2a5465ff4e3b992c429bb87a392620a0ac97b7
|
|
$ hg log -r 'tip^' --template "{gitnode}\n" --config extensions.gitrevset=
|
|
7e2a5465ff4e3b992c429bb87a392620a0ac97b7
|