Mercurial > hg
annotate tests/test-update-names.t @ 32697:19b9fc40cc51
revlog: skeleton support for version 2 revlogs
There are a number of improvements we want to make to revlogs
that will require a new version - version 2. It is unclear what the
full set of improvements will be or when we'll be done with them.
What I do know is that the process will likely take longer than a
single release, will require input from various stakeholders to
evaluate changes, and will have many contentious debates and
bikeshedding.
It is unrealistic to develop revlog version 2 up front: there
are just too many uncertainties that we won't know until things
are implemented and experiments are run. Some changes will also
be invasive and prone to bit rot, so sitting on dozens of patches
is not practical.
This commit introduces skeleton support for version 2 revlogs in
a way that is flexible and not bound by backwards compatibility
concerns.
An experimental repo requirement for denoting revlog v2 has been
added. The requirement string has a sub-version component to it.
This will allow us to declare multiple requirements in the course
of developing revlog v2. Whenever we change the in-development
revlog v2 format, we can tweak the string, creating a new
requirement and locking out old clients. This will allow us to
make as many backwards incompatible changes and experiments to
revlog v2 as we want. In other words, we can land code and make
meaningful progress towards revlog v2 while still maintaining
extreme format flexibility up until the point we freeze the
format and remove the experimental labels.
To enable the new repo requirement, you must supply an experimental
and undocumented config option. But not just any boolean flag
will do: you need to explicitly use a value that no sane person
should ever type. This is an additional guard against enabling
revlog v2 on an installation it shouldn't be enabled on. The
specific scenario I'm trying to prevent is say a user with a
4.4 client with a frozen format enabling the option but then
downgrading to 4.3 and accidentally creating repos with an
outdated and unsupported repo format. Requiring a "challenge"
string should prevent this.
Because the format is not yet finalized and I don't want to take
any chances, revlog v2's version is currently 0xDEAD. I figure
squatting on a value we're likely never to use as an actual revlog
version to mean "internal testing only" is acceptable. And
"dead" is easily recognized as something meaningful.
There is a bunch of cleanup that is needed before work on revlog
v2 begins in earnest. I plan on doing that work once this patch
is accepted and we're comfortable with the idea of starting down
this path.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 19 May 2017 20:29:11 -0700 |
parents | 478999e8281d |
children | 33c8a6837181 |
rev | line source |
---|---|
29480
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
1 Test update logic when there are renames or weird same-name cases between dirs |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
2 and files |
10874
4f11978ae45d
copies: properly visit file context ancestors on working file contexts
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
3 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
4 Update with local changes across a file rename |
12299
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
5 |
29480
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
6 $ hg init r1 && cd r1 |
12299
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
7 |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
8 $ echo a > a |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
9 $ hg add a |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
10 $ hg ci -m a |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
11 |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
12 $ hg mv a b |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
13 $ hg ci -m rename |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
14 |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
15 $ echo b > b |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
16 $ hg ci -m change |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
17 |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
18 $ hg up -q 0 |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
19 |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
20 $ echo c > a |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
21 |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
22 $ hg up |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
23 merging a and b to b |
26614
ef1eb6df7071
simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents:
16911
diff
changeset
|
24 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
12299
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
25 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
a73684df0f8a
tests: unify test-update-renames
Adrian Buehlmann <adrian@cadifra.com>
parents:
10874
diff
changeset
|
26 use 'hg resolve' to retry unresolved file merges |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12299
diff
changeset
|
27 [1] |
29480
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
28 |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
29 Test update when local untracked directory exists with the same name as a |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
30 tracked file in a commit we are updating to |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
31 $ hg init r2 && cd r2 |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
32 $ echo root > root && hg ci -Am root # rev 0 |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
33 adding root |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
34 $ echo text > name && hg ci -Am "name is a file" # rev 1 |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
35 adding name |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
36 $ hg up 0 |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
37 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
38 $ mkdir name |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
39 $ hg up 1 |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
41 |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
42 Test update when local untracked directory exists with some files in it and has |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
43 the same name a tracked file in a commit we are updating to. In future this |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
44 should be updated to give an friendlier error message, but now we should just |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
45 make sure that this does not erase untracked data |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
46 $ hg up 0 |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
47 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
48 $ mkdir name |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
49 $ echo text > name/file |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
50 $ hg st |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
51 ? name/file |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
52 $ hg up 1 |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
53 abort: *: '$TESTTMP/r1/r2/name' (glob) |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
54 [255] |
1e4512eac59e
update: teach hg to override untracked dir with a tracked file on update
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
55 $ cd .. |
29629
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
56 |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
57 #if symlink |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
58 |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
59 Test update when two commits have symlinks that point to different folders |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
60 $ hg init r3 && cd r3 |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
61 $ echo root > root && hg ci -Am root |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
62 adding root |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
63 $ mkdir folder1 && mkdir folder2 |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
64 $ ln -s folder1 folder |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
65 $ hg ci -Am "symlink to folder1" |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
66 adding folder |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
67 $ rm folder |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
68 $ ln -s folder2 folder |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
69 $ hg ci -Am "symlink to folder2" |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
70 $ hg up 1 |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
71 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
72 $ cd .. |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
73 |
b33c0c38d68f
update: fix bug when update tries to modify folder symlink
Kostia Balytskyi <ikostia@fb.com>
parents:
29480
diff
changeset
|
74 #endif |
30172
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
75 |
30230
46a0203dfb89
tests: run "cwd was removed" test only if cwd can actually be removed
Yuya Nishihara <yuya@tcha.org>
parents:
30172
diff
changeset
|
76 #if rmcwd |
46a0203dfb89
tests: run "cwd was removed" test only if cwd can actually be removed
Yuya Nishihara <yuya@tcha.org>
parents:
30172
diff
changeset
|
77 |
30172
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
78 Test that warning is printed if cwd is deleted during update |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
79 $ hg init r4 && cd r4 |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
80 $ mkdir dir |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
81 $ cd dir |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
82 $ echo a > a |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
83 $ echo b > b |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
84 $ hg add a b |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
85 $ hg ci -m "file and dir" |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
86 $ hg up -q null |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
87 current directory was removed |
90a6c18a7c1d
update: warn if cwd was deleted
Stanislau Hlebik <stash@fb.com>
parents:
29629
diff
changeset
|
88 (consider changing to repo root: $TESTTMP/r1/r4) |
30230
46a0203dfb89
tests: run "cwd was removed" test only if cwd can actually be removed
Yuya Nishihara <yuya@tcha.org>
parents:
30172
diff
changeset
|
89 |
46a0203dfb89
tests: run "cwd was removed" test only if cwd can actually be removed
Yuya Nishihara <yuya@tcha.org>
parents:
30172
diff
changeset
|
90 #endif |