tests/test-debugcommands.t
author Mateusz Kwapich <mitrandir@fb.com>
Thu, 06 Nov 2014 14:20:05 -0800
changeset 23255 76effa770ff9
parent 20543 01df3660eb11
child 23256 1c11393d5dfb
permissions -rw-r--r--
revlog: add config variable for limiting delta-chain length The current heuristic for deciding between storing delta and full texts is based on ratio of (sizeofdeltas)/(sizeoffulltext). In some cases (for example a manifest for ahuge repo) this approach can result in extremely long delta chains (~30,000) which are very slow to read. (In the case of a manifest ~500ms are added to every hg command because of that). This commit introduces "revlog.maxchainlength" configuration variable that will limit delta chain length.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17188
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     1
  $ hg init debugrevlog
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     2
  $ cd debugrevlog
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     3
  $ echo a > a
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     4
  $ hg ci -Am adda
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     5
  adding a
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     6
  $ hg debugrevlog -m
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     7
  format : 1
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     8
  flags  : inline
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     9
  
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    10
  revisions     :  1
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    11
      merges    :  0 ( 0.00%)
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    12
      normal    :  1 (100.00%)
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    13
  revisions     :  1
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    14
      full      :  1 (100.00%)
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    15
      deltas    :  0 ( 0.00%)
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    16
  revision size : 44
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    17
      full      : 44 (100.00%)
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    18
      deltas    :  0 ( 0.00%)
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    19
  
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    20
  avg chain length  : 0
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    21
  compression ratio : 0
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    22
  
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    23
  uncompressed data size (min/max/avg) : 43 / 43 / 43
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    24
  full revision size (min/max/avg)     : 44 / 44 / 44
76e55914c303 debugrevlog: handle numrevs == numfull case (issue3537)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    25
  delta size (min/max/avg)             : 0 / 0 / 0
20244
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    26
23255
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    27
Test max chain len
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    28
  $ cat >> $HGRCPATH << EOF
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    29
  > [revlog]
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    30
  > maxchainlen=4
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    31
  > EOF
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    32
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    33
  $ echo "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    34
  $ hg ci -m a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    35
  $ echo "b\n" >> a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    36
  $ hg ci -m a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    37
  $ echo "c\n" >> a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    38
  $ hg ci -m a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    39
  $ echo "d\n" >> a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    40
  $ hg ci -m a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    41
  $ echo "e\n" >> a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    42
  $ hg ci -m a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    43
  $ echo "f\n" >> a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    44
  $ hg ci -m a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    45
  $ echo 'g\n' >> a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    46
  $ hg ci -m a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    47
  $ echo 'h\n' >> a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    48
  $ hg ci -m a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    49
  $ hg debugrevlog -d a
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    50
  # rev p1rev p2rev start   end deltastart base   p1   p2 rawsize totalsize compression heads chainlen
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    51
      0    -1    -1     0   ???          0    0    0    0     ???      ????           ?     1        0 (glob)
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    52
      1     0    -1   ???   ???          0    0    0    0     ???      ????           ?     1        1 (glob)
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    53
      2     1    -1   ???   ???        ???  ???  ???    0     ???      ????           ?     1        2 (glob)
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    54
      3     2    -1   ???   ???        ???  ???  ???    0     ???      ????           ?     1        3 (glob)
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    55
      4     3    -1   ???   ???        ???  ???  ???    0     ???      ????           ?     1        4 (glob)
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    56
      5     4    -1   ???   ???        ???  ???  ???    0     ???      ????           ?     1        0 (glob)
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    57
      6     5    -1   ???   ???        ???  ???  ???    0     ???      ????           ?     1        1 (glob)
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    58
      7     6    -1   ???   ???        ???  ???  ???    0     ???      ????           ?     1        2 (glob)
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    59
      8     7    -1   ???   ???        ???  ???  ???    0     ???      ????           ?     1        3 (glob)
76effa770ff9 revlog: add config variable for limiting delta-chain length
Mateusz Kwapich <mitrandir@fb.com>
parents: 20543
diff changeset
    60
  $ cd ..
20244
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    61
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    62
Test internal debugstacktrace command
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    63
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    64
  $ cat > debugstacktrace.py << EOF
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    65
  > from mercurial.util import debugstacktrace, dst, sys
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    66
  > def f():
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    67
  >     dst('hello world')
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    68
  > def g():
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    69
  >     f()
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    70
  >     debugstacktrace(skip=-5, f=sys.stdout)
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    71
  > g()
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    72
  > EOF
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    73
  $ python debugstacktrace.py
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    74
  hello world at:
20543
01df3660eb11 tests: backout a82de9dc4f77, debugstacktrace is now stable, drop workaround
Mads Kiilerich <madski@unity3d.com>
parents: 20382
diff changeset
    75
   debugstacktrace.py:7 in * (glob)
20244
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    76
   debugstacktrace.py:5 in g
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    77
   debugstacktrace.py:3 in f
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    78
  stacktrace at:
20543
01df3660eb11 tests: backout a82de9dc4f77, debugstacktrace is now stable, drop workaround
Mads Kiilerich <madski@unity3d.com>
parents: 20382
diff changeset
    79
   debugstacktrace.py:7 *in * (glob)
01df3660eb11 tests: backout a82de9dc4f77, debugstacktrace is now stable, drop workaround
Mads Kiilerich <madski@unity3d.com>
parents: 20382
diff changeset
    80
   debugstacktrace.py:6 *in g (glob)
20244
47d0843647d1 util: introduce util.debugstacktrace for showing a stack trace without crashing
Mads Kiilerich <madski@unity3d.com>
parents: 17188
diff changeset
    81
   */util.py:* in debugstacktrace (glob)