sapling/eden/scm/tests/test-hggit-convergedmerge.t
Jan Mazur 1ca5f6bfae quiet git init command not to print out hint
Summary:
Git client was updated and it started outputting a hint that breaks our tests. It has no meaning in tests so just quiet it.

```
➜  fbcode git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
Initialized empty Git repository in /data/users/mzr/fbsource/fbcode/.git/
```

Reviewed By: StanislavGlebik

Differential Revision: D27232853

fbshipit-source-id: 683ebebb36049adb758e7c26f843f12159a45301
2021-03-23 02:28:52 -07:00

78 lines
2.0 KiB
Perl

Load commonly used test logic
$ . "$TESTDIR/hggit/testutil"
$ hg init hgrepo1
$ cd hgrepo1
$ echo A > afile
$ hg add afile
$ hg ci -m "origin"
$ echo B > afile
$ hg ci -m "A->B"
$ echo C > afile
$ hg ci -m "B->C"
$ hg up -r'desc(origin)'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo C > afile
$ hg ci -m "A->C"
$ hg merge -r0dbe4ac1a7586d1642016eea4781390285b7b536
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg ci -m "merge"
$ hg log --graph --style compact
@ eaa21d002113 1970-01-01 00:00 +0000 test
merge
o ea82b67264a1 1970-01-01 00:00 +0000 test
A->C
o 0dbe4ac1a758 1970-01-01 00:00 +0000 test
B->C
o 7205e83b5a3f 1970-01-01 00:00 +0000 test
A->B
o 5d1a6b64f9d0 1970-01-01 00:00 +0000 test
origin
$ cd ..
$ git init -q --bare gitrepo
$ cd hgrepo1
$ hg bookmark -r'desc(merge)' master
$ hg push -r master ../gitrepo
pushing to ../gitrepo
searching for changes
adding objects
added 5 commits with 3 trees and 3 blobs
$ cd ..
$ hg clone gitrepo hgrepo2 | grep -v '^updating'
importing git objects into hg
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
expect the same revision ids as above
$ hg -R hgrepo2 log --graph --style compact
@ [master] b08a922386d5 1970-01-01 00:00 +0000 test
merge
o 8bfd72bff163 1970-01-01 00:00 +0000 test
B->C
o 47fc555571b8 1970-01-01 00:00 +0000 test
A->B
o 8ec5b459b86e 1970-01-01 00:00 +0000 test
A->C
o fd5eb788c3a1 1970-01-01 00:00 +0000 test
origin
$ hg -R hgrepo2 gverify
verifying rev b08a922386d5 against git commit fb8c9e2afe5418cfff337eeed79fad5dd58826f0