sapling/eden/scm/tests/test-permissions.t
Jun Wu e4c9a1ae17 verify: make verify a no-op
Summary:
Verify is tightly coupled with revlog details, and assumes a non-lazy repo.
Revlog is going away and our repo is lazy typically, so let's just make verify
a no-op.

Reviewed By: DurhamG

Differential Revision: D28974546

fbshipit-source-id: 487dc65ceb9a1e445b58d03a53353a8382aefc08
2021-06-10 14:44:27 -07:00

73 lines
1.2 KiB
Perl

#chg-compatible
$ disable treemanifest
#require unix-permissions no-root
$ hg init t
$ cd t
$ echo foo > a
$ hg add a
$ hg commit -m "1"
$ hg verify
warning: verify does not actually check anything in this repo
$ chmod -r .hg/store/data/a.i
$ hg verify
warning: verify does not actually check anything in this repo
$ chmod +r .hg/store/data/a.i
$ hg verify
warning: verify does not actually check anything in this repo
$ chmod -w .hg/store/data/a.i
$ echo barber > a
$ hg commit -m "2"
trouble committing a!
abort: Permission denied: $TESTTMP/t/.hg/store/data/a.i
(current process runs with uid 42)
($TESTTMP/t/.hg/store/data/a.i: mode 0o52, uid 42, gid 42)
($TESTTMP/t/.hg/store/data: mode 0o52, uid 42, gid 42)
[255]
$ chmod -w .
$ hg diff --nodates
diff -r 2a18120dc1c9 a
--- a/a
+++ b/a
@@ -1,1 +1,1 @@
-foo
+barber
$ chmod +w .
$ chmod +w .hg/store/data/a.i
$ mkdir dir
$ touch dir/a
$ hg status
M a
? dir/a
$ chmod -rx dir
#if no-fsmonitor
(fsmonitor makes "hg status" avoid accessing to "dir")
$ hg status
dir: Permission denied (os error 13)
M a
#endif
Reenable perm to allow deletion:
$ chmod +rx dir
$ cd ..