annotate tests/test-rebase-dest.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 ae6bab095c66
children 3b7cb3d17137
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31729
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
1 Require a destination
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
2 $ cat >> $HGRCPATH <<EOF
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
3 > [extensions]
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
4 > rebase =
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
5 > [commands]
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
6 > rebase.requiredest = True
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
7 > EOF
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
8 $ hg init repo
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
9 $ cd repo
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
10 $ echo a >> a
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
11 $ hg commit -qAm aa
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
12 $ echo b >> b
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
13 $ hg commit -qAm bb
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
14 $ hg up ".^"
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
15 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
16 $ echo c >> c
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
17 $ hg commit -qAm cc
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
18 $ hg rebase
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
19 abort: you must specify a destination
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
20 (use: hg rebase -d REV)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
21 [255]
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
22 $ hg rebase -d 1
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
23 rebasing 2:5db65b93a12b "cc" (tip)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
24 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5db65b93a12b-4fb789ec-backup.hg (glob)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
25 $ hg rebase -d 0 -r . -q
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
26 $ HGPLAIN=1 hg rebase
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
27 rebasing 2:889b0bc6a730 "cc" (tip)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
28 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/889b0bc6a730-41ec4f81-backup.hg (glob)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
29 $ hg rebase -d 0 -r . -q
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
30 $ hg --config commands.rebase.requiredest=False rebase
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
31 rebasing 2:279de9495438 "cc" (tip)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
32 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/279de9495438-ab0a5128-backup.hg (glob)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
33
31730
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
34 Requiring dest should not break continue or other rebase options
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
35 $ hg up 1 -q
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
36 $ echo d >> c
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
37 $ hg commit -qAm dc
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
38 $ hg log -G -T '{rev} {desc}'
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
39 @ 3 dc
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
40 |
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
41 | o 2 cc
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
42 |/
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
43 o 1 bb
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
44 |
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
45 o 0 aa
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
46
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
47 $ hg rebase -d 2
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
48 rebasing 3:0537f6b50def "dc" (tip)
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
49 merging c
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
50 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
51 unresolved conflicts (see hg resolve, then hg rebase --continue)
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
52 [1]
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
53 $ echo d > c
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
54 $ hg resolve --mark --all
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
55 (no more unresolved files)
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
56 continue: hg rebase --continue
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
57 $ hg rebase --continue
31731
b5afec71c1f9 rebase: allow destination-free continue and abort (issue5513)
Ryan McElroy <rmcelroy@fb.com>
parents: 31730
diff changeset
58 rebasing 3:0537f6b50def "dc" (tip)
b5afec71c1f9 rebase: allow destination-free continue and abort (issue5513)
Ryan McElroy <rmcelroy@fb.com>
parents: 31730
diff changeset
59 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0537f6b50def-be4c7386-backup.hg (glob)
31732
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
60
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
61 $ cd ..
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
62
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
63 Check rebase.requiredest interaction with pull --rebase
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
64 $ hg clone repo clone
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
65 updating to branch default
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
66 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
67 $ cd repo
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
68 $ echo e > e
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
69 $ hg commit -qAm ee
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
70 $ cd ..
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
71 $ cd clone
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
72 $ echo f > f
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
73 $ hg commit -qAm ff
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
74 $ hg pull --rebase
31733
ae6bab095c66 rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514)
Ryan McElroy <rmcelroy@fb.com>
parents: 31732
diff changeset
75 abort: rebase destination required by configuration
ae6bab095c66 rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514)
Ryan McElroy <rmcelroy@fb.com>
parents: 31732
diff changeset
76 (use hg pull followed by hg rebase -d DEST)
31732
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
77 [255]
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
78