Mercurial > hg
annotate tests/test-merge-revert.t @ 45562:b51167d70f5a
rust: add `dirstate_tree` module
Mercurial needs to represent the filesystem hierarchy on which it operates, for
example in the dirstate. Its current on-disk representation is an unsorted, flat
structure that gets transformed in the current Rust code into a `HashMap`.
This loses the hierarchical information of the dirstate, leading to some
unfortunate performance and algorithmic compromises.
This module adds an implementation of a radix tree that is specialized for
representing the dirstate: its unit is the path component. I have made no
efforts to optimize either its memory footprint or its insertion speed: they're
pretty bad for now.
Following will be a few patches that modify the dirstate.status logic to use
that new hierarchical information, fixing issue 6335 in the same swing.
Differential Revision: https://phab.mercurial-scm.org/D9085
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Fri, 25 Sep 2020 17:51:34 +0200 |
parents | 28e2e3804f2e |
children | 55c6ebd11cb9 |
rev | line source |
---|---|
12279 | 1 $ hg init |
2 | |
3 $ echo "added file1" > file1 | |
4 $ echo "added file2" > file2 | |
5 $ hg add file1 file2 | |
6 $ hg commit -m "added file1 and file2" | |
7 | |
8 $ echo "changed file1" >> file1 | |
9 $ hg commit -m "changed file1" | |
10 | |
11 $ hg -q log | |
12 1:08a16e8e4408 | |
13 0:d29c767a4b52 | |
14 $ hg id | |
15 08a16e8e4408 tip | |
16 | |
17 $ hg update -C 0 | |
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
19 $ hg id | |
20 d29c767a4b52 | |
21 $ echo "changed file1" >> file1 | |
22 $ hg id | |
23 d29c767a4b52+ | |
24 | |
25 $ hg revert --all | |
26 reverting file1 | |
27 $ hg diff | |
28 $ hg status | |
29 ? file1.orig | |
30 $ hg id | |
31 d29c767a4b52 | |
792
49ec802b4a16
Added tests for bug with three-way-merging of old tip, tip and cwd.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
32 |
12279 | 33 $ hg update |
34 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
35 $ hg diff | |
36 $ hg status | |
37 ? file1.orig | |
38 $ hg id | |
39 08a16e8e4408 tip | |
40 | |
41 $ hg update -C 0 | |
42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
43 $ echo "changed file1" >> file1 | |
44 | |
45 $ hg update | |
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
47 $ hg diff | |
48 $ hg status | |
49 ? file1.orig | |
50 $ hg id | |
51 08a16e8e4408 tip | |
792
49ec802b4a16
Added tests for bug with three-way-merging of old tip, tip and cwd.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
52 |
12279 | 53 $ hg revert --all |
54 $ hg diff | |
55 $ hg status | |
56 ? file1.orig | |
57 $ hg id | |
58 08a16e8e4408 tip | |
59 | |
60 $ hg revert -r tip --all | |
61 $ hg diff | |
62 $ hg status | |
63 ? file1.orig | |
64 $ hg id | |
65 08a16e8e4408 tip | |
66 | |
67 $ hg update -C | |
68 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
69 $ hg diff | |
70 $ hg status | |
71 ? file1.orig | |
72 $ hg id | |
73 08a16e8e4408 tip | |
74 |