Mercurial > evolve
annotate tests/test-evolve-wdir.t @ 5592:95949b06bd48
evolvecmd: simplify code for moving bookmarks when relocating node
We had very similar code for updating bookmarks to handle the case
when the relocation resulted in no changes and for the normal
case. This restructures the code a bit so the common part is better
reused.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 24 Sep 2020 16:34:04 -0700 |
parents | 272094174185 |
children | 053f1fc12545 c5dfbbe4363d |
rev | line source |
---|---|
5439
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
1 =============================================== |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
2 Testing evolution of obsolete working directory |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
3 =============================================== |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
4 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
5 Pulling changes from other repos can make your working directory parent (wdir) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
6 obsolete, most probably because now it has a new successor. But there are |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
7 other cases as well where it might be pruned with no successors or split |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
8 in multiple changesets etc. |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
9 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
10 This test file deals with all the possible cases for the evolution from an |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
11 obsolete working directory parent. |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
12 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
13 .. Case A: obsolete wdp with single successor |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
14 .. Resolution : simply update to the successor |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
15 .. |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
16 .. Case B: obsolete wdp with no successor (simply pruned) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
17 .. Resolution : update to a not-dead ancestor |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
18 .. |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
19 .. Case C: obsolete wdp with multiple successor (divergence rewriting) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
20 .. Resolution : #TODO: not handled yet |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
21 .. |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
22 .. Case D: obsolete wdp with multiple successor (split rewriting) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
23 .. Resolution : #TODO: not handled yet |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
24 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
25 A. Obsolete wdp with single successor |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
26 ------------------------------------- |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
27 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
28 Setup |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
29 $ . $TESTDIR/testlib/common.sh |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
30 $ cat >> $HGRCPATH <<EOF |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
31 > [extensions] |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
32 > evolve= |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
33 > rebase= |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
34 > [alias] |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
35 > glog = log --graph --template "{rev}:{node|short} ({phase}): {desc|firstline} {if(troubles, '[{troubles}]')}\n" |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
36 > EOF |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
37 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
38 $ hg init repo |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
39 $ cd repo |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
40 $ mkcommit c_A |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
41 $ mkcommit c_B |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
42 $ hg amend -m "u_B" |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
43 $ hg up -r 'desc(c_B)' --hidden |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
44 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
45 updated to hidden changeset 707ee88b2870 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
46 (hidden revision '707ee88b2870' was rewritten as: 9bf151312dec) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
47 working directory parent is obsolete! (707ee88b2870) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
48 (use 'hg evolve' to update to its successor: 9bf151312dec) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
49 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
50 $ hg evolve |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
51 update:[2] u_B |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
52 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
53 working directory is now at 9bf151312dec |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
54 $ hg glog |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
55 @ 2:9bf151312dec (draft): u_B |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
56 | |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
57 o 0:9f0188af4c58 (draft): c_A |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
58 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
59 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
60 B. Obsolete wdp with no successor |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
61 --------------------------------- |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
62 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
63 $ hg prune . |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
64 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
65 working directory is now at 9f0188af4c58 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
66 1 changesets pruned |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
67 $ hg up -r 'desc(c_B)' --hidden |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
69 updated to hidden changeset 707ee88b2870 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
70 (hidden revision '707ee88b2870' is pruned) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
71 working directory parent is obsolete! (707ee88b2870) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
72 (use 'hg evolve' to update to its parent successor) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
73 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
74 $ hg evolve |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
75 update:[0] c_A |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
76 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
77 working directory is now at 9f0188af4c58 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
78 $ hg glog |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
79 @ 0:9f0188af4c58 (draft): c_A |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
80 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
81 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
82 C. Obsolete wdp with multiple successor (divergence rewriting) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
83 --------------------------------------------------------------- |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
84 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
85 $ hg metaedit -r 'desc(u_B)' -d '0 1' --hidden |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
86 $ hg metaedit -r 'desc(c_B)' -d '0 1' --hidden |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
87 2 new content-divergent changesets |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
88 $ hg up -r 'min(desc(c_B))' --hidden |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
90 updated to hidden changeset 707ee88b2870 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
91 (hidden revision '707ee88b2870' has diverged) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
92 working directory parent is obsolete! (707ee88b2870) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
93 (707ee88b2870 has diverged, use 'hg evolve --list --content-divergent' to resolve the issue) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
94 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
95 $ hg evolve |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
96 parent is obsolete with multiple successors: |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
97 [3] u_B |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
98 [4] c_B |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
99 [2] |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
100 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
101 $ hg glog |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
102 * 4:39e54eb7aa3c (draft): c_B [content-divergent] |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
103 | |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
104 | * 3:90624b574289 (draft): u_B [content-divergent] |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
105 |/ |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
106 | @ 1:707ee88b2870 (draft): c_B |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
107 |/ |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
108 o 0:9f0188af4c58 (draft): c_A |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
109 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
110 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
111 D. Obsolete wdp with multiple successor (split rewriting) |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
112 ---------------------------------------------------------- |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
113 |
272094174185
test-obsolete: move a divergence related test from the main test
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff
changeset
|
114 #TODO: yet to write tests for this case |