tests/test-issue660.t
author Gregory Szorc <gregory.szorc@gmail.com>
Sun, 06 Dec 2015 19:04:10 -0800
changeset 27371 45d996a566d7
parent 26420 2fc86d92c4a9
child 35400 4441705b7111
permissions -rw-r--r--
util: reimplement lrucachedict As part of attempting to more aggressively use the existing lrucachedict, collections.deque operations were frequently showing up in profiling output, negating benefits of caching. Searching the internet seems to tell me that the most efficient way to implement an LRU cache in Python is to have a dict indexing the cached entries and then to use a doubly linked list to track freshness of each entry. So, this patch replaces our existing lrucachedict with a version using such a pattern. The recently introduced perflrucachedict command reveals the following timings for 10,000 operations for the following cache sizes for the existing cache: n=4 init=0.004079 gets=0.003632 sets=0.005188 mixed=0.005402 n=8 init=0.004045 gets=0.003998 sets=0.005064 mixed=0.005328 n=16 init=0.004011 gets=0.004496 sets=0.005021 mixed=0.005555 n=32 init=0.004064 gets=0.005611 sets=0.005188 mixed=0.006189 n=64 init=0.003975 gets=0.007684 sets=0.005178 mixed=0.007245 n=128 init=0.004121 gets=0.012005 sets=0.005422 mixed=0.009471 n=256 init=0.004143 gets=0.020295 sets=0.005227 mixed=0.013612 n=512 init=0.004039 gets=0.036703 sets=0.005243 mixed=0.020685 n=1024 init=0.004193 gets=0.068142 sets=0.005251 mixed=0.033064 n=2048 init=0.004070 gets=0.133383 sets=0.005160 mixed=0.050359 n=4096 init=0.004053 gets=0.265194 sets=0.004868 mixed=0.048352 n=8192 init=0.004087 gets=0.542218 sets=0.004562 mixed=0.032753 n=16384 init=0.004106 gets=1.064055 sets=0.004179 mixed=0.020367 n=32768 init=0.004034 gets=2.097620 sets=0.004260 mixed=0.013031 n=65536 init=0.004108 gets=4.106390 sets=0.004268 mixed=0.010191 As the data shows, the existing cache's retrieval performance diminishes linearly with cache size. (Keep in mind the microbenchmark is testing 100% cache hit rate.) The new cache implementation reveals the following: n=4 init=0.006665 gets=0.006541 sets=0.005733 mixed=0.006876 n=8 init=0.006649 gets=0.006374 sets=0.005663 mixed=0.006899 n=16 init=0.006570 gets=0.006504 sets=0.005799 mixed=0.007057 n=32 init=0.006854 gets=0.006459 sets=0.005747 mixed=0.007034 n=64 init=0.006580 gets=0.006495 sets=0.005740 mixed=0.006992 n=128 init=0.006534 gets=0.006739 sets=0.005648 mixed=0.007124 n=256 init=0.006669 gets=0.006773 sets=0.005824 mixed=0.007151 n=512 init=0.006701 gets=0.007061 sets=0.006042 mixed=0.007372 n=1024 init=0.006641 gets=0.007620 sets=0.006387 mixed=0.007464 n=2048 init=0.006517 gets=0.008598 sets=0.006871 mixed=0.008077 n=4096 init=0.006720 gets=0.010933 sets=0.007854 mixed=0.008663 n=8192 init=0.007383 gets=0.015969 sets=0.010288 mixed=0.008896 n=16384 init=0.006660 gets=0.025447 sets=0.011208 mixed=0.008826 n=32768 init=0.006658 gets=0.044390 sets=0.011192 mixed=0.008943 n=65536 init=0.006836 gets=0.082736 sets=0.011151 mixed=0.008826 Let's go through the results. The new cache takes longer to construct. ~6.6ms vs ~4.1ms. However, this is measuring 10,000 __init__ calls, so the difference is ~0.2us/instance. We currently only create lrucachedict for manifest instances, so this regression is not likely relevant. The new cache is slightly slower for retrievals for cache sizes < 1024. It's worth noting that the only existing use of lurcachedict is in manifest.py and the default cache size is 4. This regression is worrisome. However, for n=4, the delta is ~2.9s for 10,000 lookups, or ~0.29us/op. Again, this is a marginal regression and likely not relevant in the real world. Timing `hg log -p -l 100` for mozilla-central reveals that cache lookup times are dominated by decompression and fulltext resolution (even with lz4 manifests). The new cache is significantly faster for retrievals at larger capacities. Whereas the old implementation has retrieval performance linear with cache capacity, the new cache is constant time until much larger values. And, when it does start to increase significantly, it is a few magnitudes faster than the current cache. The new cache does appear to be slower for sets when capacity is large. However, performance is similar for smaller capacities. Of course, caches should generally be optimized for retrieval performance because if a cache is getting more sets than gets, it doesn't really make sense to cache. If this regression is worrisome, again, taking the largest regression at n=65536 of ~6.9ms for 10,000 results in a regression of ~0.68us/op. This is not significant in the grand scheme of things. Overall, the new cache is performant at retrievals at much larger capacity values which makes it a generally more useful cache backend. While there are regressions, their absolute value is extremely small. Since we aren't using lrucachedict aggressively today, these regressions should not be relevant. The improved scalability of lrucachedict should enable us to more aggressively utilize lrucachedict for more granular caching (read: higher capacity caches) in the near future. The impetus for this patch is to establish a cache of decompressed revlog revisions, notably manifest revisions. And since delta chains can grow to >10,000 and cache hit rate can be high, the improved retrieval performance of lrucachedict should be relevant.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26420
2fc86d92c4a9 urls: bulk-change BTS urls to new location
Matt Mackall <mpm@selenic.com>
parents: 19510
diff changeset
     1
https://bz.mercurial-scm.org/660 and:
2fc86d92c4a9 urls: bulk-change BTS urls to new location
Matt Mackall <mpm@selenic.com>
parents: 19510
diff changeset
     2
https://bz.mercurial-scm.org/322
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
     3
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     4
  $ hg init
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     5
  $ echo a > a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     6
  $ mkdir b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     7
  $ echo b > b/b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     8
  $ hg commit -A -m "a is file, b is dir"
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     9
  adding a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    10
  adding b/b
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    11
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    12
File replaced with directory:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    13
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    14
  $ rm a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    15
  $ mkdir a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    16
  $ echo a > a/a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    17
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    18
Should fail - would corrupt dirstate:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    19
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    20
  $ hg add a/a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    21
  abort: file 'a' in dirstate clashes with 'a/a'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12195
diff changeset
    22
  [255]
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    23
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    24
Removing shadow:
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    25
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    26
  $ hg rm --after a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    27
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    28
Should succeed - shadow removed:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    29
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    30
  $ hg add a/a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    31
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    32
Directory replaced with file:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    33
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    34
  $ rm -r b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    35
  $ echo b > b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    36
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    37
Should fail - would corrupt dirstate:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    38
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    39
  $ hg add b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    40
  abort: directory 'b' already in dirstate
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12195
diff changeset
    41
  [255]
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    42
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    43
Removing shadow:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    44
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    45
  $ hg rm --after b/b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    46
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    47
Should succeed - shadow removed:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    48
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    49
  $ hg add b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    50
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    51
Look what we got:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    52
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    53
  $ hg st
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    54
  A a/a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    55
  A b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    56
  R a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    57
  R b/b
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    58
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    59
Revert reintroducing shadow - should fail:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    60
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    61
  $ rm -r a b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    62
  $ hg revert b/b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    63
  abort: file 'b' in dirstate clashes with 'b/b'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12195
diff changeset
    64
  [255]
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    65
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    66
Revert all - should succeed:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    67
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    68
  $ hg revert --all
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    69
  undeleting a
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 14112
diff changeset
    70
  forgetting a/a (glob)
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    71
  forgetting b
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 14112
diff changeset
    72
  undeleting b/b (glob)
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    73
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    74
  $ hg st
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    75
19510
8b190adb7ee3 revert: make backup when unforgetting a file (issue3423)
Matt Mackall <mpm@selenic.com>
parents: 15447
diff changeset
    76
Issue3423:
8b190adb7ee3 revert: make backup when unforgetting a file (issue3423)
Matt Mackall <mpm@selenic.com>
parents: 15447
diff changeset
    77
8b190adb7ee3 revert: make backup when unforgetting a file (issue3423)
Matt Mackall <mpm@selenic.com>
parents: 15447
diff changeset
    78
  $ hg forget a
8b190adb7ee3 revert: make backup when unforgetting a file (issue3423)
Matt Mackall <mpm@selenic.com>
parents: 15447
diff changeset
    79
  $ echo zed > a
8b190adb7ee3 revert: make backup when unforgetting a file (issue3423)
Matt Mackall <mpm@selenic.com>
parents: 15447
diff changeset
    80
  $ hg revert a
8b190adb7ee3 revert: make backup when unforgetting a file (issue3423)
Matt Mackall <mpm@selenic.com>
parents: 15447
diff changeset
    81
  $ hg st
8b190adb7ee3 revert: make backup when unforgetting a file (issue3423)
Matt Mackall <mpm@selenic.com>
parents: 15447
diff changeset
    82
  ? a.orig
8b190adb7ee3 revert: make backup when unforgetting a file (issue3423)
Matt Mackall <mpm@selenic.com>
parents: 15447
diff changeset
    83
  $ rm a.orig
8b190adb7ee3 revert: make backup when unforgetting a file (issue3423)
Matt Mackall <mpm@selenic.com>
parents: 15447
diff changeset
    84
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    85
addremove:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    86
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    87
  $ rm -r a b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    88
  $ mkdir a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    89
  $ echo a > a/a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    90
  $ echo b > b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    91
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    92
  $ hg addremove -s 0
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    93
  removing a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    94
  adding a/a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    95
  adding b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    96
  removing b/b
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
    97
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    98
  $ hg st
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    99
  A a/a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   100
  A b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   101
  R a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   102
  R b/b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   103
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   104
commit:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
   105
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   106
  $ hg ci -A -m "a is dir, b is file"
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   107
  $ hg st --all
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   108
  C a/a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   109
  C b
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
   110
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   111
Long directory replaced with file:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
   112
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   113
  $ mkdir d
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   114
  $ mkdir d/d
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   115
  $ echo d > d/d/d
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   116
  $ hg commit -A -m "d is long directory"
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   117
  adding d/d/d
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
   118
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   119
  $ rm -r d
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   120
  $ echo d > d
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   121
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   122
Should fail - would corrupt dirstate:
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   123
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   124
  $ hg add d
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   125
  abort: directory 'd' already in dirstate
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12195
diff changeset
   126
  [255]
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
   127
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   128
Removing shadow:
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   129
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   130
  $ hg rm --after d/d/d
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
   131
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   132
Should succeed - shadow removed:
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   133
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   134
  $ hg add d
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   135
  $ hg ci -md
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
   136
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   137
Update should work at least with clean working directory:
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
   138
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   139
  $ rm -r a b d
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   140
  $ hg up -r 0
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   141
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
5516
f252ba975925 Fix dir-changed-to-file updates on clean workdir.
Maxim Dounin <mdounin@mdounin.ru>
parents: 5487
diff changeset
   142
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   143
  $ hg st --all
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   144
  C a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   145
  C b/b
5487
7a64931e2d76 Fix file-changed-to-dir and dir-to-file commits (issue660).
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
   146
12195
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   147
  $ rm -r a b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   148
  $ hg up -r 1
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   149
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   150
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   151
  $ hg st --all
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   152
  C a/a
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   153
  C b
ee41be2bbf5a tests: unify test-issue*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   154