Mercurial > hg
annotate tests/test-merge-revert2.t @ 33453:f6b7617a85bb
phases: add a 'registernew' method to set new phases
This new function will be used by code that adds new changesets. It ajusts the
phase boundary to make sure added changesets are at least in their target
phase (they end up in an higher phase if their parents are in a higher phase).
Having a dedicated function also simplify the phases tracking. All the new
nodes are passed as argument, so we know that all of them needs to have their
new phase registered. We also know that no other nodes will be affected, so no
extra computation are needed.
This function differ from 'retractboundary' where some nodes might change
phase while some other might not. It can also affect nodes not passed as
parameters.
These simplification also apply to the computation itself. For now we use
'_retractboundary' there by convenience, but we may introduces simpler code
later.
While registering new revisions, we still need to check the actual phases of
the added node because it might be higher than the target phase (eg: target is
draft but parent is secret).
We will migrate users over the next changesets.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 11 Jul 2017 03:47:25 +0200 |
parents | ce3a133f71b3 |
children | 55c6ebd11cb9 |
rev | line source |
---|---|
12279 | 1 $ hg init |
2 | |
3 $ echo "added file1" > file1 | |
4 $ echo "another line of text" >> file1 | |
5 $ echo "added file2" > file2 | |
6 $ hg add file1 file2 | |
7 $ hg commit -m "added file1 and file2" | |
8 | |
9 $ echo "changed file1" >> file1 | |
10 $ hg commit -m "changed file1" | |
11 | |
12 $ hg -q log | |
13 1:dfab7f3c2efb | |
14 0:c3fa057dd86f | |
15 $ hg id | |
16 dfab7f3c2efb tip | |
17 | |
18 $ hg update -C 0 | |
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
20 $ hg id | |
21 c3fa057dd86f | |
22 | |
23 $ echo "changed file1" >> file1 | |
24 $ hg id | |
25 c3fa057dd86f+ | |
26 | |
27 $ hg revert --no-backup --all | |
28 reverting file1 | |
29 $ hg diff | |
30 $ hg status | |
31 $ hg id | |
32 c3fa057dd86f | |
33 | |
34 $ hg update | |
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
36 $ hg diff | |
37 $ hg status | |
38 $ hg id | |
39 dfab7f3c2efb tip | |
40 | |
41 $ hg update -C 0 | |
42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
43 $ echo "changed file1 different" >> file1 | |
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
|
44 |
12279 | 45 $ hg update |
46 merging file1 | |
26614
ef1eb6df7071
simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents:
21693
diff
changeset
|
47 warning: conflicts while merging file1! (edit, then use 'hg resolve --mark') |
12279 | 48 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
49 use 'hg resolve' to retry unresolved file merges | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
50 [1] |
12279 | 51 |
52 $ hg diff --nodates | |
53 diff -r dfab7f3c2efb file1 | |
54 --- a/file1 | |
55 +++ b/file1 | |
56 @@ -1,3 +1,7 @@ | |
57 added file1 | |
58 another line of text | |
30460
ce3a133f71b3
conflicts: make spacing consistent in conflict markers
Kostia Balytskyi <ikostia@fb.com>
parents:
26614
diff
changeset
|
59 +<<<<<<< working copy: c3fa057dd86f - test: added file1 and file2 |
12279 | 60 +changed file1 different |
61 +======= | |
62 changed file1 | |
21693
9c35f3a8cac4
merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
21537
diff
changeset
|
63 +>>>>>>> destination: dfab7f3c2efb - test: changed file1 |
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
|
64 |
12279 | 65 $ hg status |
66 M file1 | |
67 ? file1.orig | |
68 $ hg id | |
69 dfab7f3c2efb+ tip | |
70 | |
71 $ hg revert --no-backup --all | |
72 reverting file1 | |
73 $ hg diff | |
74 $ hg status | |
75 ? file1.orig | |
76 $ hg id | |
77 dfab7f3c2efb tip | |
78 | |
79 $ hg revert -r tip --no-backup --all | |
80 $ hg diff | |
81 $ hg status | |
82 ? file1.orig | |
83 $ hg id | |
84 dfab7f3c2efb tip | |
85 | |
86 $ hg update -C | |
87 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
88 $ hg diff | |
89 $ hg status | |
90 ? file1.orig | |
91 $ hg id | |
92 dfab7f3c2efb tip | |
93 |