annotate tests/test-permissions @ 1877:d314a89fa4f1

change lock format to let us detect and break stale locks. old style: symlink to pid new style: symlink to hostname:pid if lock code finds new-style lock, it breaks lock if locking pid is on same machine and pid is not alive. otherwise, lock is left alone. this makes locking code safe with old-style locks and with locks on other machines. new code makes server part of mercurial more robust in case machine crashes, power fails, or crazy user does kill -9.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 10 Mar 2006 08:31:31 -0800
parents f0b13c019b04
children 7544700fd931
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1497
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
1 #!/bin/sh
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
2
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
3 hg init
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
4 echo foo > a
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
5 hg add a
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
6 hg commit -m "1" -d "0 0"
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
7 hg verify
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
8 chmod -r .hg/data/a.d
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
9 hg verify 2>/dev/null || echo verify failed
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
10 chmod +r .hg/data/a.d
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
11 hg verify 2>/dev/null || echo verify failed
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
12 chmod -w .hg/data/a.d
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
13 echo barber > a
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
14 hg commit -m "2" -d "0 0" 2>/dev/null || echo commit failed
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
15