mononoke: add tests for replacing a file with a dir

Reviewed By: quark-zju

Differential Revision: D18854541

fbshipit-source-id: b2dbe59ae5e50770725efa0eec6afe3087eca5e1
This commit is contained in:
Kostia Balytskyi 2019-12-06 11:49:03 -08:00 committed by Facebook Github Bot
parent b642c322b8
commit 8d2136b088
2 changed files with 49 additions and 0 deletions

View File

@ -238,3 +238,27 @@ Pushrebase with a rename between a shifted and a non-shifted behavior
ls: cannot access smallrepofolder/filetomove: No such file or directory
[2]
$ verify_wc master_bookmark
Pushrebase, which replaces a file with a directory
$ cd "$TESTTMP/small-hg-client"
$ REPONAME=small-mon hgmn up -q master_bookmark
$ hg rm subdir
$ mkdir subdir
$ createfile subdir/greatfile && hg ci -qm "Replace a file with a directory"
$ REPONAME=small-mon hgmn push --to master_bookmark | grep updating
updating bookmark master_bookmark
$ log -r master_bookmark
@ Replace a file with a directory [public;rev=14;4d2fda63b03e] default/master_bookmark
|
~
-- this should also be present in a large repo, once we pull
$ cd "$TESTTMP/large-hg-client"
$ REPONAME=large-mon hgmn pull -q
$ REPONAME=large-mon hgmn up -q master_bookmark
$ ls smallrepofolder/subdir
greatfile
$ log -r master_bookmark
@ Replace a file with a directory [public;rev=15;81b97bd0337e] default/master_bookmark
|
~
$ verify_wc master_bookmark

View File

@ -423,3 +423,28 @@ Test non-fast-forward force pushrebase
remote: "Forced push blocked because it contains mutation metadata.\nYou can remove the metadata from a commit with `hg amend --config mutation.record=false`.\nFor more help, please contact the Source Control team at https://fburl.com/27qnuyl2"
abort: stream ended unexpectedly (got 0 bytes, expected 4)
[255]
Check that we can replace a file with a directory
$ cd "$TESTTMP/repo2"
$ hgmn up default/newbook -q
$ hg rm A -q
$ mkdir A
$ echo hello > A/hello
$ hgmn add A/hello -q
$ hgmn ci -qm "replace a file with a dir"
$ hgmn push --to newbook
pushing rev 4e5fec14573f to destination ssh://user@dummy/repo bookmark newbook
searching for changes
adding changesets
adding manifests
adding file changes
added 0 changesets with 0 changes to 0 files
updating bookmark newbook
$ ls A
hello
$ log -r "30"
@ replace a file with a dir [public;rev=30;4e5fec14573f] default/newbook
|
~