##// END OF EJS Templates
rebase: minor refactoring of _computeobsoletenotrebased...
Laurent Charignon -
r27744:f2b8b4e2 default
parent child Browse files
Show More
@@ -343,8 +343,10 b' def rebase(ui, repo, **opts):'
343 obsoletenotrebased = {}
343 obsoletenotrebased = {}
344 if ui.configbool('experimental', 'rebaseskipobsolete'):
344 if ui.configbool('experimental', 'rebaseskipobsolete'):
345 rebasesetrevs = set(rebaseset)
345 rebasesetrevs = set(rebaseset)
346 rebaseobsrevs = set(r for r in rebasesetrevs
347 if repo[r].obsolete())
346 obsoletenotrebased = _computeobsoletenotrebased(repo,
348 obsoletenotrebased = _computeobsoletenotrebased(repo,
347 rebasesetrevs,
349 rebaseobsrevs,
348 dest)
350 dest)
349
351
350 # - plain prune (no successor) changesets are rebased
352 # - plain prune (no successor) changesets are rebased
@@ -1174,7 +1176,7 b' def _rebasedvisible(orig, repo):'
1174 blockers.update(getattr(repo, '_rebaseset', ()))
1176 blockers.update(getattr(repo, '_rebaseset', ()))
1175 return blockers
1177 return blockers
1176
1178
1177 def _computeobsoletenotrebased(repo, rebasesetrevs, dest):
1179 def _computeobsoletenotrebased(repo, rebaseobsrevs, dest):
1178 """return a mapping obsolete => successor for all obsolete nodes to be
1180 """return a mapping obsolete => successor for all obsolete nodes to be
1179 rebased that have a successors in the destination
1181 rebased that have a successors in the destination
1180
1182
@@ -1185,15 +1187,13 b' def _computeobsoletenotrebased(repo, reb'
1185 # nodes to be rebased
1187 # nodes to be rebased
1186 allsuccessors = {}
1188 allsuccessors = {}
1187 cl = repo.changelog
1189 cl = repo.changelog
1188 for r in rebasesetrevs:
1190 for r in rebaseobsrevs:
1189 n = repo[r]
1191 node = cl.node(r)
1190 if n.obsolete():
1192 for s in obsolete.allsuccessors(repo.obsstore, [node]):
1191 node = cl.node(r)
1193 try:
1192 for s in obsolete.allsuccessors(repo.obsstore, [node]):
1194 allsuccessors[cl.rev(s)] = cl.rev(node)
1193 try:
1195 except LookupError:
1194 allsuccessors[cl.rev(s)] = cl.rev(node)
1196 pass
1195 except LookupError:
1196 pass
1197
1197
1198 if allsuccessors:
1198 if allsuccessors:
1199 # Look for successors of obsolete nodes to be rebased among
1199 # Look for successors of obsolete nodes to be rebased among
General Comments 0
You need to be logged in to leave comments. Login now