mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
084e15f969
Workaround for dir-changed-to-file updates mentioned in rev c3f3393b9096 doesn't actually work since tests introduced in mentioned changeset prevented dirstate updates even if working directory updates succeded. Make tests more relaxed for dirstate operations not directly accessible from cli. See also issue660. While here, move _dirs existance check from _decpath() to _changepath() for unification.
95 lines
1.3 KiB
Bash
Executable File
95 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
# http://www.selenic.com/mercurial/bts/issue660
|
|
|
|
|
|
hg init a
|
|
cd a
|
|
echo a > a
|
|
mkdir b
|
|
echo b > b/b
|
|
hg commit -A -m "a is file, b is dir"
|
|
|
|
echo % file replaced with directory
|
|
|
|
rm a
|
|
mkdir a
|
|
echo a > a/a
|
|
|
|
echo % should fail - would corrupt dirstate
|
|
hg add a/a
|
|
|
|
echo % removing shadow
|
|
hg rm --after a
|
|
|
|
echo % should succeed - shadow removed
|
|
hg add a/a
|
|
|
|
echo % directory replaced with file
|
|
|
|
rm -r b
|
|
echo b > b
|
|
|
|
echo % should fail - would corrupt dirstate
|
|
hg add b
|
|
|
|
echo % removing shadow
|
|
hg rm --after b/b
|
|
|
|
echo % should succeed - shadow removed
|
|
hg add b
|
|
|
|
echo % look what we got
|
|
hg st
|
|
|
|
echo % revert reintroducing shadow - should fail
|
|
rm -r a b
|
|
hg revert b/b
|
|
|
|
echo % revert all - should succeed
|
|
hg revert --all
|
|
hg st
|
|
|
|
echo % addremove
|
|
|
|
rm -r a b
|
|
mkdir a
|
|
echo a > a/a
|
|
echo b > b
|
|
|
|
hg addremove
|
|
hg st
|
|
|
|
echo % commit
|
|
hg ci -A -m "a is dir, b is file"
|
|
hg st --all
|
|
|
|
echo % long directory replaced with file
|
|
|
|
mkdir d
|
|
mkdir d/d
|
|
echo d > d/d/d
|
|
hg commit -A -m "d is long directory"
|
|
rm -r d
|
|
echo d > d
|
|
|
|
echo % should fail - would corrupt dirstate
|
|
hg add d
|
|
|
|
echo % removing shadow
|
|
hg rm --after d/d/d
|
|
|
|
echo % should succeed - shadow removed
|
|
hg add d
|
|
hg ci -md
|
|
|
|
echo % update should work at least with clean workdir
|
|
|
|
rm -r a b d
|
|
hg up -r 0
|
|
hg st --all
|
|
rm -r a b
|
|
hg up -r 1
|
|
hg st --all
|
|
|
|
exit 0
|