sapling/eden/scm/tests/test-symlink-placeholder.t
Muir Manders 1bcc7abff8 tests: enable rust status for debugruntest tests
Summary:
The new status doesn't work w/ legacy repos, so the tests need to be migrated. For each test, first I tried migrating to eagerepo, but in many cases that didn't work. Next I tried a remotefilelog repo (AKA "newclientrepo"). If I still couldn't get the test to work I just disabled rust status. This was mostly in tests that disabled treemanifest or were explicitly coupled with revlogs somehow.

Some tests had acute "hg status" discrepancies, so I left a FIXME(status) and disabled rust status.

I added a new "eagerepo" tinit.sh function that turns on eager format (for client repos). With this, tests doing "hg init" might just work with features that expect a modern repo.

Reviewed By: quark-zju

Differential Revision: D43839499

fbshipit-source-id: ce6d3b2747b90d31bd246c30551bdb55c446112f
2023-03-16 10:58:55 -07:00

73 lines
1.5 KiB
Perl

#chg-compatible
#debugruntest-compatible
#require symlink
$ eagerepo
$ hg init unix-repo
$ cd unix-repo
$ echo foo > a
$ ln -s a b
$ hg ci -Am0
adding a
adding b
$ cd ..
Simulate a checkout shared on NFS/Samba:
$ hg clone -q unix-repo shared
$ cd shared
$ rm b
$ echo foo > b
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg status --debug
ignoring suspect symlink placeholder "b" (?)
Make a clone using placeholders:
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg clone . ../win-repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ../win-repo
$ cat b
a (no-eol)
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg st --debug
Empty placeholder:
$ rm b
$ touch b
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg st --debug
ignoring suspect symlink placeholder "b" (?)
Write binary data to the placeholder:
>>> _ = open('b', 'w').write('this is a binary\0')
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg st --debug
ignoring suspect symlink placeholder "b" (?)
Write a long string to the placeholder:
>>> _ = open('b', 'w').write('this' * 1000)
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg st --debug
ignoring suspect symlink placeholder "b" (?)
Commit shouldn't succeed:
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg ci -m1
nothing changed
[1]
Write a valid string to the placeholder:
>>> open('b', 'w').write('this')
4
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg st --debug
M b
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg ci -m1
$ hg manifest tip --verbose
644 a
644 @ b
$ cd ..