##// END OF EJS Templates
tests: add test for rebasing merges with ancestors of the rebase destination...
Mads Kiilerich -
r23406:65f215ea default
parent child Browse files
Show More
@@ -53,3 +53,119 b''
53
53
54
54
55 $ cd ..
55 $ cd ..
56
57
58 Test rebasing of merges with ancestors of the rebase destination - a situation
59 that often happens when trying to recover from repeated merging with a mainline
60 branch.
61
62 The test case creates a dev branch that contains a couple of merges from the
63 default branch. When rebasing to the default branch, these merges would be
64 merges with ancestors on the same branch. The merges _could_ contain some
65 interesting conflict resolutions or additional changes in the merge commit, but
66 that is mixed up with the actual merge stuff and there is in general no way to
67 separate them.
68
69 Note: The dev branch contains _no_ changes to f-default. It might be unclear
70 how rebasing of ancestor merges should be handled, but the current behavior
71 with spurious prompts for conflicts in files that didn't change seems very
72 wrong.
73
74 $ hg init ancestor-merge
75 $ cd ancestor-merge
76
77 $ touch f-default
78 $ hg ci -Aqm 'default: create f-default'
79
80 $ hg branch -q dev
81 $ hg ci -qm 'dev: create branch'
82
83 $ echo stuff > f-dev
84 $ hg ci -Aqm 'dev: f-dev stuff'
85
86 $ hg up -q default
87 $ echo stuff > f-default
88 $ hg ci -m 'default: f-default stuff'
89
90 $ hg up -q dev
91 $ hg merge -q default
92 $ hg ci -m 'dev: merge default'
93
94 $ hg up -q default
95 $ hg rm f-default
96 $ hg ci -m 'default: remove f-default'
97
98 $ hg up -q dev
99 $ hg merge -q default
100 $ hg ci -m 'dev: merge default'
101
102 $ hg up -q default
103 $ echo stuff > f-other
104 $ hg ci -Aqm 'default: f-other stuff'
105
106 $ hg tglog
107 @ 7: 'default: f-other stuff'
108 |
109 | o 6: 'dev: merge default' dev
110 |/|
111 o | 5: 'default: remove f-default'
112 | |
113 | o 4: 'dev: merge default' dev
114 |/|
115 o | 3: 'default: f-default stuff'
116 | |
117 | o 2: 'dev: f-dev stuff' dev
118 | |
119 | o 1: 'dev: create branch' dev
120 |/
121 o 0: 'default: create f-default'
122
123 $ hg clone -qU . ../ancestor-merge-2
124
125 Full rebase all the way back from branching point:
126
127 $ hg rebase -r 'only(dev,default)' -d default
128 remote changed f-default which local deleted
129 use (c)hanged version or leave (d)eleted? c
130 local changed f-default which remote deleted
131 use (c)hanged version or (d)elete? c
132 saved backup bundle to $TESTTMP/ancestor-merge/.hg/strip-backup/1d1a643d390e-backup.hg (glob)
133 $ hg tglog
134 o 5: 'dev: merge default'
135 |
136 o 4: 'dev: f-dev stuff'
137 |
138 @ 3: 'default: f-other stuff'
139 |
140 o 2: 'default: remove f-default'
141 |
142 o 1: 'default: f-default stuff'
143 |
144 o 0: 'default: create f-default'
145
146 Grafty cherry picking rebasing:
147
148 $ cd ../ancestor-merge-2
149
150 $ hg phase -fdr0:
151 $ hg rebase -r 'children(only(dev,default))' -d default
152 remote changed f-default which local deleted
153 use (c)hanged version or leave (d)eleted? c
154 local changed f-default which remote deleted
155 use (c)hanged version or (d)elete? c
156 saved backup bundle to $TESTTMP/ancestor-merge-2/.hg/strip-backup/ec2c14fb2984-backup.hg (glob)
157 $ hg tglog
158 o 6: 'dev: merge default'
159 |
160 o 5: 'dev: f-dev stuff'
161 |
162 o 4: 'default: f-other stuff'
163 |
164 o 3: 'default: remove f-default'
165 |
166 o 2: 'default: f-default stuff'
167 |
168 | o 1: 'dev: create branch' dev
169 |/
170 o 0: 'default: create f-default'
171
General Comments 0
You need to be logged in to leave comments. Login now