annotate tests/test-touch.t @ 5979:4a09e95d29c9 stable

rewriteutil: fix broken touch of merge commits (issue6416) `rewriteutil.rewrite()` is for rewriting a linear chain of commits into a single commit, i.e. what `hg fold` does. Many of the callers passed in a single commit because they wanted to rewrite just a single commit (e.g. `hg touch`). Before this patch, the code worked by going through the commits to fold and adding up all the modified files in them, then building a `memctx` based on that. As reported in issue6416, that can lose changes in merge commits. We could probably fix that without changing the existing code too much, but it seems the easiest way is to rewrite the code so it instead creates the new commit by effectively checking out the base and then revert to the head of the chain, so that's what this patch does. It does so by using in-memory merge.
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 05 Oct 2020 08:35:17 -0700
parents bf48247af25a
children e97fbded40a5 3fdfeca7e45f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
1
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
2 $ cat >> $HGRCPATH <<EOF
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
3 > [ui]
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
4 > logtemplate={rev}:{node|short} {desc}\n
4709
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
5 > [alias]
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
6 > glog = log -GT "{rev}: {desc}"
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
7 > [extensions]
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
8 > hgext.rebase=
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
9 > EOF
1806
9f42f819267b evolve: move the extensions to 'hgext3rd'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1756
diff changeset
10 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
11
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
12 $ hg init repo
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
13 $ cd repo
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
14 $ echo A > a
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
15 $ hg add a
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
16 $ hg commit -m a
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
17
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
18 Basic usage
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
19
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
20 $ hg log -G
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
21 @ 0:[0-9a-f]{12} a (re)
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
22
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
23 $ hg touch .
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
24 $ hg log -G
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
25 @ 1:[0-9a-f]{12} a (re)
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
26
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
27
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
28
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
29 Revive usage
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
30
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
31 $ echo A > b
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
32 $ hg add b
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
33 $ hg commit -m ab --amend
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
34 $ hg up --hidden 1
3747
1e103c7f7663 test: update to new outputs
Boris Feld <boris.feld@octobus.net>
parents: 3568
diff changeset
35 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1e103c7f7663 test: update to new outputs
Boris Feld <boris.feld@octobus.net>
parents: 3568
diff changeset
36 updated to hidden changeset * (glob)
3432
f57be161f34b test: update with new 'update' hint about obsfate
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3417
diff changeset
37 (hidden revision '*' was rewritten as: *) (glob)
2289
61d073590fb7 ui: add better messages when the working copy become obsolete.
Boris Feld <boris.feld@octobus.net>
parents: 1806
diff changeset
38 working directory parent is obsolete! (*) (glob)
61d073590fb7 ui: add better messages when the working copy become obsolete.
Boris Feld <boris.feld@octobus.net>
parents: 1806
diff changeset
39 (use 'hg evolve' to update to its successor: *) (glob)
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
40 $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
41 o 2:[0-9a-f]{12} ab (re)
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
42
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
43 @ 1:[0-9a-f]{12} a (re)
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
44
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
45 $ hg touch .
1589
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
46 [1] a
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
47 reviving this changeset will create divergence unless you make a duplicate.
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
48 (a)llow divergence or (d)uplicate the changeset? a
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
49 2 new content-divergent changesets
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
50 $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
51 @ 3:[0-9a-f]{12} a (re)
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
52
3417
d3a17c67f85c branching: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3411
diff changeset
53 \* 2:[0-9a-f]{12} ab (re)
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
54
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
55 $ hg prune 3
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
56 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
4613
30a544904238 messages: standardize on "working copy is now at" including "is"
Martin von Zweigbergk <martinvonz@google.com>
parents: 4446
diff changeset
57 working directory is now at 000000000000
700
ebcfd72e7609 touch: add basic testing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
58 1 changesets pruned
701
f752089479ce add a duplicate option in touch
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 700
diff changeset
59
f752089479ce add a duplicate option in touch
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 700
diff changeset
60 Duplicate
f752089479ce add a duplicate option in touch
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 700
diff changeset
61
f752089479ce add a duplicate option in touch
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 700
diff changeset
62 $ hg touch --duplicate .
f752089479ce add a duplicate option in touch
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 700
diff changeset
63 $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
64 @ 4:[0-9a-f]{12} (re)
701
f752089479ce add a duplicate option in touch
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 700
diff changeset
65
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
66 o 2:[0-9a-f]{12} ab (re)
701
f752089479ce add a duplicate option in touch
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 700
diff changeset
67
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
68
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
69 Multiple touch
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
70
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
71 $ echo C > c
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
72 $ hg add c
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
73 $ hg commit -m c
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
74 $ echo D > d
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
75 $ hg add d
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
76 $ hg commit -m d
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
77 $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
78 @ 6:[0-9a-f]{12} d (re)
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
79 |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
80 o 5:[0-9a-f]{12} c (re)
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
81 |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
82 o 4:[0-9a-f]{12} (re)
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
83
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
84 o 2:[0-9a-f]{12} ab (re)
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
85
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
86 $ hg touch .^:.
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
87 $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
88 @ 8:[0-9a-f]{12} d (re)
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
89 |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
90 o 7:[0-9a-f]{12} c (re)
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
91 |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
92 o 4:[0-9a-f]{12} (re)
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
93
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
94 o 2:[0-9a-f]{12} ab (re)
702
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
95
b5a85a8909d3 touch: properly handle touching multiple changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 701
diff changeset
96
1151
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
97 check move data kept after rebase on touch:
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
98
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
99 $ touch gna1
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
100 $ hg commit -Am gna1
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
101 adding gna1
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
102 $ hg mv gna1 gna2
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
103 $ hg commit -m move
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
104 $ hg st -C --change=tip
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
105 A gna2
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
106 gna1
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
107 R gna1
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
108 $ hg up .^
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
109 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
110
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
111 $ hg touch
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
112 1 new orphan changesets
1151
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
113
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
114 $ hg log -G --hidden
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
115 @ 11:[0-9a-f]{12} gna1 (re)
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
116 |
3417
d3a17c67f85c branching: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3411
diff changeset
117 . \* 10:[0-9a-f]{12} move (re)
3000
bd7e8be29542 branching: merge future 6.7.0 in the stable branch
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2929
diff changeset
118 | |
3210
df8d535216af tests: fix previously accidentally matching regexes in test-touch.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 3013
diff changeset
119 . x 9:[0-9a-f]{12} gna1 (re)
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
120 |/
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
121 o 8:[0-9a-f]{12} d (re)
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
122 |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
123 o 7:[0-9a-f]{12} c (re)
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
124 |
3210
df8d535216af tests: fix previously accidentally matching regexes in test-touch.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 3013
diff changeset
125 . x 6:[0-9a-f]{12} d (re)
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
126 | |
3210
df8d535216af tests: fix previously accidentally matching regexes in test-touch.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 3013
diff changeset
127 . x 5:[0-9a-f]{12} c (re)
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
128 |/
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
129 o 4:[0-9a-f]{12} (re)
3000
bd7e8be29542 branching: merge future 6.7.0 in the stable branch
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2929
diff changeset
130
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
131 x 3:[0-9a-f]{12} a (re)
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
132
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
133 o 2:[0-9a-f]{12} ab (re)
2929
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
134
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
135 x 1:[0-9a-f]{12} a (re)
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
136
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
137 x 0:[0-9a-f]{12} a (re)
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
138
06844693bb21 tests: update after removing of redundant amend commit
Boris Feld <boris.feld@octobus.net>
parents: 2858
diff changeset
139
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
140 $ hg rebase -s 10 -d 11
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
141 rebasing 10:[0-9a-f]{12} "move" (re)
1151
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
142 $ hg st -C --change=tip
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
143 A gna2
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
144 gna1
802a87359017 test-touch: add a test for rename preservation after touch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 743
diff changeset
145 R gna1
1589
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
146
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
147 check that the --duplicate option does not create divergence
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
148
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
149 $ hg touch --duplicate 10 --hidden
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
150 1 new orphan changesets
1589
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
151
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
152 check that reviving a changeset with no successor does not show the prompt
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
153
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
154 $ hg prune 13
1589
d6630a6bff86 touch: prompt the user for what to do with the revived changeset
Laurent Charignon <lcharignon@fb.com>
parents: 1443
diff changeset
155 1 changesets pruned
3215
175b524b9a2b touch: add support for storing a note in obsmarker
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3210
diff changeset
156 $ hg touch 13 --hidden --note "testing with no successor"
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
157 1 new orphan changesets
5275
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
158 $ hg debugobsolete
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
159 * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'touch', 'user': 'test'} (glob)
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
160 * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'} (glob)
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
161 * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'touch', 'user': 'test'} (glob)
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
162 * 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'} (glob)
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
163 * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'touch', 'user': 'test'} (glob)
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
164 * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'touch', 'user': 'test'} (glob)
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
165 * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'touch', 'user': 'test'} (glob)
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
166 * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} (glob)
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
167 * 0 {*} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'} (glob)
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5135
diff changeset
168 * * 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'note': 'testing with no successor', 'operation': 'touch', 'user': 'test'} (glob)
5301
e8660b28bfee obslog: makes --origin flag the default
Anton Shestakov <av6@dwimlabs.net>
parents: 5275
diff changeset
169 $ hg obslog -r 13 --no-origin --hidden
3215
175b524b9a2b touch: add support for storing a note in obsmarker
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3210
diff changeset
170 x [0-9a-f]{12} (.*) move (re)
3566
e6bea259c227 prune: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3432
diff changeset
171 pruned using prune by test (Thu Jan 01 00:00:00 1970 +0000)
3568
eca57332ad03 touch: include "operation" metadata in obsmarkers
Martin von Zweigbergk <martinvonz@google.com>
parents: 3566
diff changeset
172 rewritten(.*) as [0-9a-f]{12} using touch by test (.*) (re)
3223
73b4e84df0bd obsnote: don't add '' to note while showing it in obslog
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3215
diff changeset
173 note: testing with no successor
3215
175b524b9a2b touch: add support for storing a note in obsmarker
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3210
diff changeset
174
4446
8232bddf543a touch: use action "touch", not "<function touch at ...>", in precheck
Martin von Zweigbergk <martinvonz@google.com>
parents: 3747
diff changeset
175
8232bddf543a touch: use action "touch", not "<function touch at ...>", in precheck
Martin von Zweigbergk <martinvonz@google.com>
parents: 3747
diff changeset
176 Public phase
8232bddf543a touch: use action "touch", not "<function touch at ...>", in precheck
Martin von Zweigbergk <martinvonz@google.com>
parents: 3747
diff changeset
177
8232bddf543a touch: use action "touch", not "<function touch at ...>", in precheck
Martin von Zweigbergk <martinvonz@google.com>
parents: 3747
diff changeset
178 $ hg phase --public -r 2
8232bddf543a touch: use action "touch", not "<function touch at ...>", in precheck
Martin von Zweigbergk <martinvonz@google.com>
parents: 3747
diff changeset
179 $ hg touch 2
8232bddf543a touch: use action "touch", not "<function touch at ...>", in precheck
Martin von Zweigbergk <martinvonz@google.com>
parents: 3747
diff changeset
180 abort: cannot touch public changesets: * (glob)
8232bddf543a touch: use action "touch", not "<function touch at ...>", in precheck
Martin von Zweigbergk <martinvonz@google.com>
parents: 3747
diff changeset
181 (see 'hg help phases' for details)
8232bddf543a touch: use action "touch", not "<function touch at ...>", in precheck
Martin von Zweigbergk <martinvonz@google.com>
parents: 3747
diff changeset
182 [255]
8232bddf543a touch: use action "touch", not "<function touch at ...>", in precheck
Martin von Zweigbergk <martinvonz@google.com>
parents: 3747
diff changeset
183 $ hg touch --duplicate 2
4727
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
184
4709
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
185 Reviving merge commit
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
186
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
187 $ hg up 12
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
188 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
189 $ hg merge 15
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
191 (branch merge, don't forget to commit)
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
192 $ hg ci -m merge
4721
b69497b23d31 touch: make sure merge commits include files from p1 and p2
Anton Shestakov <av6@dwimlabs.net>
parents: 4710
diff changeset
193 $ hg st --change .
b69497b23d31 touch: make sure merge commits include files from p1 and p2
Anton Shestakov <av6@dwimlabs.net>
parents: 4710
diff changeset
194 A a
b69497b23d31 touch: make sure merge commits include files from p1 and p2
Anton Shestakov <av6@dwimlabs.net>
parents: 4710
diff changeset
195 A b
4709
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
196 $ hg prune -r .
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
197 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
198 working directory is now at * (glob)
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
199 1 changesets pruned
cc3569da7150 tests: show what happens when trying to hg touch a merge commit
Anton Shestakov <av6@dwimlabs.net>
parents: 4613
diff changeset
200 $ hg touch 16 --hidden
4710
0e0731406efd rewriteutil: allow rewriting merge commits (issue4561)
Anton Shestakov <av6@dwimlabs.net>
parents: 4709
diff changeset
201 $ hg glog -r '12+15+17'
0e0731406efd rewriteutil: allow rewriting merge commits (issue4561)
Anton Shestakov <av6@dwimlabs.net>
parents: 4709
diff changeset
202 o 17: merge
0e0731406efd rewriteutil: allow rewriting merge commits (issue4561)
Anton Shestakov <av6@dwimlabs.net>
parents: 4709
diff changeset
203 |\
0e0731406efd rewriteutil: allow rewriting merge commits (issue4561)
Anton Shestakov <av6@dwimlabs.net>
parents: 4709
diff changeset
204 | o 15: ab
0e0731406efd rewriteutil: allow rewriting merge commits (issue4561)
Anton Shestakov <av6@dwimlabs.net>
parents: 4709
diff changeset
205 |
0e0731406efd rewriteutil: allow rewriting merge commits (issue4561)
Anton Shestakov <av6@dwimlabs.net>
parents: 4709
diff changeset
206 @ 12: move
0e0731406efd rewriteutil: allow rewriting merge commits (issue4561)
Anton Shestakov <av6@dwimlabs.net>
parents: 4709
diff changeset
207 |
0e0731406efd rewriteutil: allow rewriting merge commits (issue4561)
Anton Shestakov <av6@dwimlabs.net>
parents: 4709
diff changeset
208 ~
4721
b69497b23d31 touch: make sure merge commits include files from p1 and p2
Anton Shestakov <av6@dwimlabs.net>
parents: 4710
diff changeset
209 $ hg st --change 17
b69497b23d31 touch: make sure merge commits include files from p1 and p2
Anton Shestakov <av6@dwimlabs.net>
parents: 4710
diff changeset
210 A a
b69497b23d31 touch: make sure merge commits include files from p1 and p2
Anton Shestakov <av6@dwimlabs.net>
parents: 4710
diff changeset
211 A b
4729
076b6813a7ea branching: merge with stable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4721 4728
diff changeset
212
4727
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
213 $ cd ..
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
214
5978
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
215 Check that touching a merge commit doesn't lose file changes (issue 6416)
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
216
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
217 $ hg init issue-6416
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
218 $ cd issue-6416
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
219 $ echo base > base
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
220 $ hg ci -Aqm base
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
221 $ echo left1 > left1
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
222 $ hg ci -Aqm left1
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
223 $ echo left2 > left2
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
224 $ hg ci -Aqm left2
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
225 $ hg up 0 -q
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
226 $ echo right1 > right1
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
227 $ hg ci -Aqm right1
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
228 $ echo right2 > right2
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
229 $ hg ci -Aqm right2
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
230 $ hg up 2 -q
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
231 $ hg merge 4 -q
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
232 $ hg ci -m merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
233 $ hg touch tip
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
234 $ hg glog --hidden
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
235 @ 6: merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
236 |\
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
237 +---x 5: merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
238 | |/
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
239 | o 4: right2
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
240 | |
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
241 | o 3: right1
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
242 | |
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
243 o | 2: left2
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
244 | |
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
245 o | 1: left1
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
246 |/
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
247 o 0: base
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
248
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
249 $ hg glog --hidden --rev 'min(desc("merge"))' --rev 'max(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
250 @ 6: merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
251 |\
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
252 ~ ~
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
253 x 5: merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
254 |\
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
255 ~ ~
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
256 $ hg status --hidden --change 'min(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
257 A right1
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
258 A right2
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
259 $ hg status --hidden --change 'max(desc("merge"))'
5979
4a09e95d29c9 rewriteutil: fix broken touch of merge commits (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5978
diff changeset
260 A right1
5978
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
261 A right2
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
262 $ hg status --hidden --rev 'min(desc("merge"))' --rev 'max(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
263 $ cd ..
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
264
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
265 Check that touching a merge commit doesn't lose copies
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
266
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
267 $ hg init merge-copies
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
268 $ cd merge-copies
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
269 $ echo base > base
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
270 $ hg ci -Aqm base
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
271 $ echo left > left
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
272 $ hg cp base copy-on-left
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
273 $ hg ci -Aqm left
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
274 $ hg up 0 -q
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
275 $ echo right > right
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
276 $ hg cp base copy-on-right
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
277 $ hg ci -Aqm right
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
278 $ hg up 1 -q
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
279 $ hg merge 2 -q
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
280 $ hg cp left merge-copy-left
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
281 $ hg cp right merge-copy-right
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
282 $ hg ci -m merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
283 $ hg touch tip
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
284 $ hg glog --hidden
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
285 @ 4: merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
286 |\
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
287 +---x 3: merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
288 | |/
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
289 | o 2: right
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
290 | |
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
291 o | 1: left
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
292 |/
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
293 o 0: base
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
294
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
295 $ hg glog --hidden --rev 'min(desc("merge"))' --rev 'max(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
296 @ 4: merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
297 |\
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
298 ~ ~
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
299 x 3: merge
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
300 |\
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
301 ~ ~
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
302 $ hg debugpathcopies 'min(desc("base"))' 'min(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
303 base -> copy-on-left
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
304 base -> copy-on-right
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
305 $ hg debugpathcopies 'min(desc("base"))' 'max(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
306 base -> copy-on-left
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
307 base -> copy-on-right
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
308 $ hg debugpathcopies 'min(desc("left"))' 'min(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
309 base -> copy-on-right
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
310 left -> merge-copy-left
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
311 $ hg debugpathcopies 'min(desc("left"))' 'max(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
312 base -> copy-on-right
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
313 left -> merge-copy-left
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
314 $ hg debugpathcopies 'min(desc("right"))' 'min(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
315 base -> copy-on-left
5979
4a09e95d29c9 rewriteutil: fix broken touch of merge commits (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5978
diff changeset
316 right -> merge-copy-right
5978
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
317 $ hg debugpathcopies 'min(desc("right"))' 'max(desc("merge"))'
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
318 base -> copy-on-left
5979
4a09e95d29c9 rewriteutil: fix broken touch of merge commits (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5978
diff changeset
319 right -> merge-copy-right
5978
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
320 $ cd ..
bf48247af25a tests: demonstrate that touch can lose files (issue6416)
Martin von Zweigbergk <martinvonz@google.com>
parents: 5976
diff changeset
321
4727
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
322 Make sure touch doesn't fail to warn about divergence (issue6107)
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
323
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
324 $ hg init touchdiv
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
325 $ cd touchdiv
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
326 $ echo c > c
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
327 $ hg add c
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
328 $ hg ci -m "added c"
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
329
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
330 $ hg amend -m "modified c"
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
331 $ hg prune . -q
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
332
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
333 $ hg touch -r "desc('added c')" --hidden
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
334 $ hg touch -r "desc('modified c')" --hidden
4728
ef8907df73fc touch: fix the inconsistent behavior of divergence catching logic (issue6107)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4727
diff changeset
335 [1] modified c
ef8907df73fc touch: fix the inconsistent behavior of divergence catching logic (issue6107)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4727
diff changeset
336 reviving this changeset will create divergence unless you make a duplicate.
ef8907df73fc touch: fix the inconsistent behavior of divergence catching logic (issue6107)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4727
diff changeset
337 (a)llow divergence or (d)uplicate the changeset? a
4727
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
338 2 new content-divergent changesets
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
339
5134
d9b1336f7d1c tests: add test of `hg touch -A`
Martin von Zweigbergk <martinvonz@google.com>
parents: 5079
diff changeset
340 But -A allows divergence
d9b1336f7d1c tests: add test of `hg touch -A`
Martin von Zweigbergk <martinvonz@google.com>
parents: 5079
diff changeset
341
d9b1336f7d1c tests: add test of `hg touch -A`
Martin von Zweigbergk <martinvonz@google.com>
parents: 5079
diff changeset
342 $ hg touch -r "desc('modified c')" --hidden -A
d9b1336f7d1c tests: add test of `hg touch -A`
Martin von Zweigbergk <martinvonz@google.com>
parents: 5079
diff changeset
343 1 new content-divergent changesets
d9b1336f7d1c tests: add test of `hg touch -A`
Martin von Zweigbergk <martinvonz@google.com>
parents: 5079
diff changeset
344
4727
355b8e17e14c touch: add test which shows touch can fail to warn about divergence
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4613
diff changeset
345 $ cd ..
5976
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
346
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
347 Touch preserves copies
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
348
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
349 $ hg init copies
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
350 $ cd copies
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
351 $ echo a > a
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
352 $ hg ci -Aqm a
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
353 $ hg cp a b
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
354 $ hg ci -Aqm 'copy a to b'
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
355 $ hg status --copies --change .
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
356 A b
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
357 a
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
358 $ hg touch
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
359 $ hg status --copies --change .
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
360 A b
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
361 a
a65d17b1b463 tests: add test showing that touch preserves copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 5816
diff changeset
362 $ cd ..