tests/test-lock-badness.t
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 06 Sep 2018 14:04:46 -0700
changeset 39568 842cd0bdda75
parent 36643 1e1c1bfb0be4
child 45828 e0dbfbd4062c
permissions -rw-r--r--
util: teach lrucachedict to enforce a max total cost Now that lrucachedict entries can have a numeric cost associated with them and we can easily pop the oldest item in the cache, it now becomes relatively trivial to implement support for enforcing a high water mark on the total cost of items in the cache. This commit teaches lrucachedict instances to have a max cost associated with them. When items are inserted, we pop old items until enough "cost" frees up to make room for the new item. This feature is close to zero cost when not used (modulo the insertion regressed introduced by the previous commit): $ ./hg perflrucachedict --size 4 --gets 1000000 --sets 1000000 --mixed 1000000 ! gets ! wall 0.607444 comb 0.610000 user 0.610000 sys 0.000000 (best of 17) ! wall 0.601653 comb 0.600000 user 0.600000 sys 0.000000 (best of 17) ! inserts ! wall 0.678261 comb 0.680000 user 0.680000 sys 0.000000 (best of 14) ! wall 0.685042 comb 0.680000 user 0.680000 sys 0.000000 (best of 15) ! sets ! wall 0.808770 comb 0.800000 user 0.800000 sys 0.000000 (best of 13) ! wall 0.834241 comb 0.830000 user 0.830000 sys 0.000000 (best of 12) ! mixed ! wall 0.782441 comb 0.780000 user 0.780000 sys 0.000000 (best of 13) ! wall 0.803804 comb 0.800000 user 0.800000 sys 0.000000 (best of 13) $ hg perflrucachedict --size 1000 --gets 1000000 --sets 1000000 --mixed 1000000 ! init ! wall 0.006952 comb 0.010000 user 0.010000 sys 0.000000 (best of 418) ! gets ! wall 0.613350 comb 0.610000 user 0.610000 sys 0.000000 (best of 17) ! wall 0.617415 comb 0.620000 user 0.620000 sys 0.000000 (best of 17) ! inserts ! wall 0.701270 comb 0.700000 user 0.700000 sys 0.000000 (best of 15) ! wall 0.700516 comb 0.700000 user 0.700000 sys 0.000000 (best of 15) ! sets ! wall 0.825720 comb 0.830000 user 0.830000 sys 0.000000 (best of 13) ! wall 0.837946 comb 0.840000 user 0.830000 sys 0.010000 (best of 12) ! mixed ! wall 0.821644 comb 0.820000 user 0.820000 sys 0.000000 (best of 13) ! wall 0.850559 comb 0.850000 user 0.850000 sys 0.000000 (best of 12) I reckon the slight slowdown on insert is due to added if checks. For caches with total cost limiting enabled: $ hg perflrucachedict --size 4 --gets 1000000 --sets 1000000 --mixed 1000000 --costlimit 100 ! gets w/ cost limit ! wall 0.598737 comb 0.590000 user 0.590000 sys 0.000000 (best of 17) ! inserts w/ cost limit ! wall 1.694282 comb 1.700000 user 1.700000 sys 0.000000 (best of 6) ! mixed w/ cost limit ! wall 1.157655 comb 1.150000 user 1.150000 sys 0.000000 (best of 9) $ hg perflrucachedict --size 1000 --gets 1000000 --sets 1000000 --mixed 1000000 --costlimit 10000 ! gets w/ cost limit ! wall 0.598526 comb 0.600000 user 0.600000 sys 0.000000 (best of 17) ! inserts w/ cost limit ! wall 37.838315 comb 37.840000 user 37.840000 sys 0.000000 (best of 3) ! mixed w/ cost limit ! wall 18.060198 comb 18.060000 user 18.060000 sys 0.000000 (best of 3) $ hg perflrucachedict --size 1000 --gets 1000000 --sets 1000000 --mixed 1000000 --costlimit 10000 --mixedgetfreq 90 ! gets w/ cost limit ! wall 0.600024 comb 0.600000 user 0.600000 sys 0.000000 (best of 17) ! inserts w/ cost limit ! wall 37.154547 comb 37.120000 user 37.120000 sys 0.000000 (best of 3) ! mixed w/ cost limit ! wall 4.381602 comb 4.380000 user 4.370000 sys 0.010000 (best of 3) The functions we're benchmarking are slightly different, which could move numbers by a few milliseconds. But the slowdown on insert is too great to be explained by that. The slowness is due to insert heavy operations needing to call popoldest() repeatedly when the cache is at capacity. The next commit will address this. Differential Revision: https://phab.mercurial-scm.org/D4503
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22047
8fb6844a4ff1 tests: change some #ifs to #requires
Matt Mackall <mpm@selenic.com>
parents: 20969
diff changeset
     1
#require unix-permissions no-root no-windows
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
     2
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
     3
Prepare
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
     4
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
     5
  $ hg init a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
     6
  $ echo a > a/a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
     7
  $ hg -R a ci -A -m a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
     8
  adding a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
     9
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
    10
  $ hg clone a b
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
    11
  updating to branch default
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
    12
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2016
ff5c9a92f556 fix backtrace printed when cannot get lock.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    13
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    14
Test that raising an exception in the release function doesn't cause the lock to choke
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    15
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    16
  $ cat > testlock.py << EOF
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 29883
diff changeset
    17
  > from mercurial import error, registrar
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    18
  > 
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    19
  > cmdtable = {}
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 29883
diff changeset
    20
  > command = registrar.command(cmdtable)
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    21
  > 
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    22
  > def acquiretestlock(repo, releaseexc):
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    23
  >     def unlock():
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    24
  >         if releaseexc:
36643
1e1c1bfb0be4 py3: add some b'' to make test-lock-badness.t happy
Yuya Nishihara <yuya@tcha.org>
parents: 35209
diff changeset
    25
  >             raise error.Abort(b'expected release exception')
1e1c1bfb0be4 py3: add some b'' to make test-lock-badness.t happy
Yuya Nishihara <yuya@tcha.org>
parents: 35209
diff changeset
    26
  >     l = repo._lock(repo.vfs, b'testlock', False, unlock, None, b'test lock')
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    27
  >     return l
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    28
  > 
33097
fce4ed2912bb py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
    29
  > @command(b'testlockexc')
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    30
  > def testlockexc(ui, repo):
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    31
  >     testlock = acquiretestlock(repo, True)
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    32
  >     try:
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    33
  >         testlock.release()
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    34
  >     finally:
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    35
  >         try:
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    36
  >             testlock = acquiretestlock(repo, False)
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    37
  >         except error.LockHeld:
36643
1e1c1bfb0be4 py3: add some b'' to make test-lock-badness.t happy
Yuya Nishihara <yuya@tcha.org>
parents: 35209
diff changeset
    38
  >             raise error.Abort(b'lockfile on disk even after releasing!')
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    39
  >         testlock.release()
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    40
  > EOF
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    41
  $ cat >> $HGRCPATH << EOF
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    42
  > [extensions]
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    43
  > testlock=$TESTTMP/testlock.py
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    44
  > EOF
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    45
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    46
  $ hg -R b testlockexc
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    47
  abort: expected release exception
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    48
  [255]
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
    49
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
    50
One process waiting for another
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
    51
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
    52
  $ cat > hooks.py << EOF
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
    53
  > import time
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
    54
  > def sleepone(**x): time.sleep(1)
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
    55
  > def sleephalf(**x): time.sleep(0.5)
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
    56
  > EOF
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
    57
  $ echo b > b/b
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
    58
  $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout &
29008
38292b227deb tests: test-lock-badness.t message could come later
timeless <timeless@mozdev.org>
parents: 26587
diff changeset
    59
  $ hg -R b up -q --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    60
  > > preup-stdout 2>preup-stderr
29008
38292b227deb tests: test-lock-badness.t message could come later
timeless <timeless@mozdev.org>
parents: 26587
diff changeset
    61
  $ wait
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    62
  $ cat preup-stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    63
  $ cat preup-stderr
29883
0c8c388c7d62 lock: show more detail for new-style locks in lock waiting message (issue4752)
Mark Ignacio <mignacio@fb.com>
parents: 29008
diff changeset
    64
  waiting for lock on working directory of b held by process '*' on host '*' (glob)
29008
38292b227deb tests: test-lock-badness.t message could come later
timeless <timeless@mozdev.org>
parents: 26587
diff changeset
    65
  got lock after * seconds (glob)
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
    66
  $ cat stdout
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
    67
  adding b
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
    68
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    69
On processs waiting on another, warning after a long time.
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    70
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    71
  $ echo b > b/c
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    72
  $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout &
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    73
  $ hg -R b up -q --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    74
  > --config ui.timeout.warn=250 \
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    75
  > > preup-stdout 2>preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    76
  $ wait
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    77
  $ cat preup-stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    78
  $ cat preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    79
  $ cat stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    80
  adding c
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    81
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    82
On processs waiting on another, warning disabled.
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    83
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    84
  $ echo b > b/d
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    85
  $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout &
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    86
  $ hg -R b up -q --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    87
  > --config ui.timeout.warn=-1 \
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    88
  > > preup-stdout 2>preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    89
  $ wait
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    90
  $ cat preup-stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    91
  $ cat preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    92
  $ cat stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    93
  adding d
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    94
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    95
check we still print debug output
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    96
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    97
On processs waiting on another, warning after a long time (debug output on)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    98
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
    99
  $ echo b > b/e
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   100
  $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout &
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   101
  $ hg -R b up --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   102
  > --config ui.timeout.warn=250 --debug\
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   103
  > > preup-stdout 2>preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   104
  $ wait
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   105
  $ cat preup-stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   106
  calling hook pre-update: hghook_pre-update.sleephalf
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   107
  waiting for lock on working directory of b held by process '*' on host '*' (glob)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   108
  got lock after * seconds (glob)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   109
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   110
  $ cat preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   111
  $ cat stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   112
  adding e
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   113
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   114
On processs waiting on another, warning disabled, (debug output on)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   115
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   116
  $ echo b > b/f
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   117
  $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout &
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   118
  $ hg -R b up --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   119
  > --config ui.timeout.warn=-1 --debug\
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   120
  > > preup-stdout 2>preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   121
  $ wait
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   122
  $ cat preup-stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   123
  calling hook pre-update: hghook_pre-update.sleephalf
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   124
  waiting for lock on working directory of b held by process '*' on host '*' (glob)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   125
  got lock after * seconds (glob)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   126
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   127
  $ cat preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   128
  $ cat stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   129
  adding f
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
   130
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
   131
Pushing to a local read-only repo that can't be locked
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
   132
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
   133
  $ chmod 100 a/.hg/store
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
   134
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
   135
  $ hg -R b push a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
   136
  pushing to a
20969
7a679918ee2b localrepo: add unbundle support
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20653
diff changeset
   137
  searching for changes
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
   138
  abort: could not lock repository a: Permission denied
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12071
diff changeset
   139
  [255]
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
   140
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
   141
  $ chmod 700 a/.hg/store