##// END OF EJS Templates
rebase: do not consider extincts for divergence detection (issue5782)...
Denis Laxalde -
r36013:b7e2cf11 default
parent child Browse files
Show More
@@ -312,10 +312,13 b' class rebaseruntime(object):'
312 312 if not self.ui.configbool('experimental', 'rebaseskipobsolete'):
313 313 return
314 314 obsoleteset = set(obsoleterevs)
315 self.obsoletenotrebased, self.obsoletewithoutsuccessorindestination = \
316 _computeobsoletenotrebased(self.repo, obsoleteset, destmap)
315 (self.obsoletenotrebased,
316 self.obsoletewithoutsuccessorindestination,
317 obsoleteextinctsuccessors) = _computeobsoletenotrebased(
318 self.repo, obsoleteset, destmap)
317 319 skippedset = set(self.obsoletenotrebased)
318 320 skippedset.update(self.obsoletewithoutsuccessorindestination)
321 skippedset.update(obsoleteextinctsuccessors)
319 322 _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
320 323
321 324 def _prepareabortorcontinue(self, isabort):
@@ -1221,7 +1224,7 b' def _checkobsrebase(repo, ui, rebaseobsr'
1221 1224
1222 1225 `rebaseobsrevs`: set of obsolete revision in source
1223 1226 `rebaseobsskipped`: set of revisions from source skipped because they have
1224 successors in destination
1227 successors in destination or no non-obsolete successor.
1225 1228 """
1226 1229 # Obsolete node with successors not in dest leads to divergence
1227 1230 divergenceok = ui.configbool('experimental',
@@ -1786,13 +1789,18 b' def _computeobsoletenotrebased(repo, reb'
1786 1789
1787 1790 `obsoletewithoutsuccessorindestination` is a set with obsolete revisions
1788 1791 without a successor in destination.
1792
1793 `obsoleteextinctsuccessors` is a set of obsolete revisions with only
1794 obsolete successors.
1789 1795 """
1790 1796 obsoletenotrebased = {}
1791 1797 obsoletewithoutsuccessorindestination = set([])
1798 obsoleteextinctsuccessors = set([])
1792 1799
1793 1800 assert repo.filtername is None
1794 1801 cl = repo.changelog
1795 1802 nodemap = cl.nodemap
1803 extinctnodes = set(cl.node(r) for r in repo.revs('extinct()'))
1796 1804 for srcrev in rebaseobsrevs:
1797 1805 srcnode = cl.node(srcrev)
1798 1806 destnode = cl.node(destmap[srcrev])
@@ -1800,6 +1808,9 b' def _computeobsoletenotrebased(repo, reb'
1800 1808 successors = list(obsutil.allsuccessors(repo.obsstore, [srcnode]))
1801 1809 # obsutil.allsuccessors includes node itself
1802 1810 successors.remove(srcnode)
1811 if set(successors).issubset(extinctnodes):
1812 # all successors are extinct
1813 obsoleteextinctsuccessors.add(srcrev)
1803 1814 if not successors:
1804 1815 # no successor
1805 1816 obsoletenotrebased[srcrev] = None
@@ -1817,7 +1828,11 b' def _computeobsoletenotrebased(repo, reb'
1817 1828 if any(nodemap[s] in destmap for s in successors):
1818 1829 obsoletewithoutsuccessorindestination.add(srcrev)
1819 1830
1820 return obsoletenotrebased, obsoletewithoutsuccessorindestination
1831 return (
1832 obsoletenotrebased,
1833 obsoletewithoutsuccessorindestination,
1834 obsoleteextinctsuccessors,
1835 )
1821 1836
1822 1837 def summaryhook(ui, repo):
1823 1838 if not repo.vfs.exists('rebasestate'):
@@ -1244,10 +1244,6 b' issue5782'
1244 1244 o 0:b173517d0057 a
1245 1245
1246 1246 $ hg rebase -d 0 -r 2
1247 abort: this rebase will cause divergences from: a82ac2b38757
1248 (to force the rebase please set experimental.evolution.allowdivergence=True)
1249 [255]
1250 $ hg rebase -d 0 -r 2 --config experimental.evolution.allowdivergence=True
1251 1247 rebasing 2:a82ac2b38757 "c" (c)
1252 1248 $ hg log -G -r 'a': --hidden
1253 1249 o 5:69ad416a4a26 c
General Comments 0
You need to be logged in to leave comments. Login now