##// END OF EJS Templates
rebase: fix --collapse with --keepbranches (issue2100)...
Patrick Mezard -
r10762:129e96f7 stable
parent child Browse files
Show More
@@ -161,10 +161,7 b' def rebase(ui, repo, **opts):'
161 161 'resolve then run hg rebase --continue'))
162 162 updatedirstate(repo, rev, target, p2)
163 163 if not collapsef:
164 extra = {'rebase_source': repo[rev].hex()}
165 if extrafn:
166 extrafn(repo[rev], extra)
167 newrev = concludenode(repo, rev, p1, p2, extra=extra)
164 newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn)
168 165 else:
169 166 # Skip commit if we are collapsing
170 167 repo.dirstate.setparents(repo[p1].node())
@@ -190,7 +187,7 b' def rebase(ui, repo, **opts):'
190 187 commitmsg += '\n* %s' % repo[rebased].description()
191 188 commitmsg = ui.edit(commitmsg, repo.ui.username())
192 189 newrev = concludenode(repo, rev, p1, external, commitmsg=commitmsg,
193 extra=extrafn)
190 extrafn=extrafn)
194 191
195 192 if 'qtip' in repo.tags():
196 193 updatemq(repo, state, skipped, **opts)
@@ -266,17 +263,19 b' def updatedirstate(repo, rev, p1, p2):'
266 263 if v in m2 and v not in m1:
267 264 repo.dirstate.remove(v)
268 265
269 def concludenode(repo, rev, p1, p2, commitmsg=None, extra=None):
266 def concludenode(repo, rev, p1, p2, commitmsg=None, extrafn=None):
270 267 'Commit the changes and store useful information in extra'
271 268 try:
272 269 repo.dirstate.setparents(repo[p1].node(), repo[p2].node())
273 270 if commitmsg is None:
274 271 commitmsg = repo[rev].description()
275 if extra is None:
276 extra = {}
272 ctx = repo[rev]
273 extra = {'rebase_source': ctx.hex()}
274 if extrafn:
275 extrafn(ctx, extra)
277 276 # Commit might fail if unresolved files exist
278 newrev = repo.commit(text=commitmsg, user=repo[rev].user(),
279 date=repo[rev].date(), extra=extra)
277 newrev = repo.commit(text=commitmsg, user=ctx.user(),
278 date=ctx.date(), extra=extra)
280 279 repo.dirstate.setbranch(repo[newrev].branch())
281 280 return newrev
282 281 except util.Abort:
@@ -43,7 +43,7 b' createrepo > /dev/null 2>&1'
43 43 hg glog --template '{rev}: {desc}\n'
44 44 echo '% Rebasing B onto H'
45 45 hg up -C 3
46 hg rebase --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
46 hg rebase --collapse --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
47 47 hg glog --template '{rev}: {desc}\n'
48 48 echo "Expected A, B, C, D, F, H"
49 49 hg manifest
General Comments 0
You need to be logged in to leave comments. Login now