Mercurial > evolve
annotate tests/test-obsolete-push.t @ 3573:d53277cdc1e7
evolve: handle stabilization of merge changeset with both parents obsoleted
This patch adds logic to stabilize an orphan merge changeset having both parents
obsoleted.
The logic tries to first stabilize the merge changeset on successor of second
parent and then stabilize the new changeset formed on the successor of first
parent. We are stabilizing on second parent first and then to second parent to
preserve the first parent's successor as first parent of the merge changeset.
Conflicts can occcur and we can loose processing information, therefore we store
a variable in statefile `orphanmerge` which represents whether we are processing
a merge changeset with both parents obsoleted.
Thanks to Pierre-Yves David for suggesting this way and helping to understand
the correctness of this.
More rigourous test cases for this will be added in next patch.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 18 Mar 2018 17:29:32 +0530 |
parents | 8feb2cae7eae |
children | ccfcacc5ee7c 2d9902f0ff17 |
rev | line source |
---|---|
300
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
1 $ cat >> $HGRCPATH <<EOF |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
2 > [defaults] |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
3 > amend=-d "0 0" |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
4 > [extensions] |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
5 > EOF |
1806
9f42f819267b
evolve: move the extensions to 'hgext3rd'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1732
diff
changeset
|
6 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH |
300
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
7 |
1732
f4047fba5e90
templates: change {obsolete} to emit only "obsolete" or ""
Martin von Zweigbergk <martinvonz@google.com>
parents:
1631
diff
changeset
|
8 $ template='{rev}:{node|short}@{branch}({separate("/", obsolete, phase)}) {desc|firstline}\n' |
300
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
9 $ glog() { |
2776
4dd84054ebbb
test: remove reference to the graphlog extension
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
2525
diff
changeset
|
10 > hg log -G --template "$template" "$@" |
300
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
11 > } |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
12 |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
13 Test outgoing, common A is suspended, B unstable and C secret, remote |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
14 has A and B, neither A or C should be in outgoing. |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
15 |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
16 $ hg init source |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
17 $ cd source |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
18 $ echo a > a |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
19 $ hg ci -qAm A a |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
20 $ echo b > b |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
21 $ hg ci -qAm B b |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
22 $ hg up 0 |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
23 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
24 $ echo c > c |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
25 $ hg ci -qAm C c |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
26 $ hg phase --secret --force . |
1631
7463f5880ce9
prune: remove the kill alias
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
1185
diff
changeset
|
27 $ hg prune 0 1 |
688
f2c3fd21fa63
prune: add an informative message about the number of pruned changesets
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
491
diff
changeset
|
28 2 changesets pruned |
3013
945a0989e41b
packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3000
diff
changeset
|
29 1 new orphan changesets |
300
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
30 $ glog --hidden |
1732
f4047fba5e90
templates: change {obsolete} to emit only "obsolete" or ""
Martin von Zweigbergk <martinvonz@google.com>
parents:
1631
diff
changeset
|
31 @ 2:244232c2222a@default(secret) C |
300
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
32 | |
1732
f4047fba5e90
templates: change {obsolete} to emit only "obsolete" or ""
Martin von Zweigbergk <martinvonz@google.com>
parents:
1631
diff
changeset
|
33 | x 1:6c81ed0049f8@default(obsolete/draft) B |
300
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
34 |/ |
1732
f4047fba5e90
templates: change {obsolete} to emit only "obsolete" or ""
Martin von Zweigbergk <martinvonz@google.com>
parents:
1631
diff
changeset
|
35 x 0:1994f17a630e@default(obsolete/draft) A |
300
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
36 |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
37 $ hg init ../clone |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
38 $ cat > ../clone/.hg/hgrc <<EOF |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
39 > [phases] |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
40 > publish = false |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
41 > EOF |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
42 $ hg outgoing ../clone --template "$template" |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
43 comparing with ../clone |
3b1f326878e5
obsolete: suspended changeset with secret only children should be secret too
Patrick Mezard <patrick@mezard.eu>
parents:
diff
changeset
|
44 searching for changes |
1732
f4047fba5e90
templates: change {obsolete} to emit only "obsolete" or ""
Martin von Zweigbergk <martinvonz@google.com>
parents:
1631
diff
changeset
|
45 0:1994f17a630e@default(obsolete/draft) A |
2286
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
46 $ cd .. |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
47 |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
48 Test options to prevent implicite publishing of changesets |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
49 ---------------------------------------------------------- |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
50 |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
51 |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
52 $ hg clone source strict-publish-client --pull |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
53 requesting all changes |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
54 adding changesets |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
55 adding manifests |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
56 adding file changes |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
57 added 1 changesets with 1 changes to 1 files |
2525
5adb8bdb935e
compatibility: backport mercurial 176d1a0ce385
Boris Feld <boris.feld@octobus.net>
parents:
2286
diff
changeset
|
58 2 new obsolescence markers |
3075
8feb2cae7eae
test: adapt to output change from eb586ed5d8ce
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3013
diff
changeset
|
59 new changesets 1994f17a630e |
2286
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
60 updating to branch default |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
61 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
62 $ cd strict-publish-client |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
63 $ echo c > c |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
64 $ hg ci -qAm C c |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
65 |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
66 abort behavior |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
67 |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
68 $ cat >> .hg/hgrc <<eof |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
69 > [experimental] |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
70 > auto-publish = abort |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
71 > eof |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
72 $ hg push -r . |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
73 pushing to $TESTTMP/source |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
74 abort: push would publish 1 changesets |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
75 (behavior controlled by 'experimental.auto-publish' config) |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
76 [255] |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
77 $ hg push |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
78 pushing to $TESTTMP/source |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
79 abort: push would publish 1 changesets |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
80 (behavior controlled by 'experimental.auto-publish' config) |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
81 [255] |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
82 |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
83 warning behavior |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
84 |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
85 $ echo 'auto-publish = warn' >> .hg/hgrc |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
86 $ hg push |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
87 pushing to $TESTTMP/source |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
88 1 changesets about to be published |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
89 searching for changes |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
90 adding changesets |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
91 adding manifests |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
92 adding file changes |
a4c5744a7b93
safeguard: add an option to disable automatic publishing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1806
diff
changeset
|
93 added 0 changesets with 0 changes to 1 files |