hgext/rebase.py
branchstable
changeset 47796 16c60e90a496
parent 47460 c9cedb546262
child 48116 5ced12cfa41b
equal deleted inserted replaced
47792:6c86f96042c9 47796:16c60e90a496
   360             self.obsolete_with_successor_in_rebase_set,
   360             self.obsolete_with_successor_in_rebase_set,
   361         ) = _compute_obsolete_sets(self.repo, obsoleteset, self.destmap)
   361         ) = _compute_obsolete_sets(self.repo, obsoleteset, self.destmap)
   362         skippedset = set(self.obsolete_with_successor_in_destination)
   362         skippedset = set(self.obsolete_with_successor_in_destination)
   363         skippedset.update(self.obsolete_with_successor_in_rebase_set)
   363         skippedset.update(self.obsolete_with_successor_in_rebase_set)
   364         _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
   364         _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
   365         allowdivergence = self.ui.configbool(
   365         if obsolete.isenabled(self.repo, obsolete.allowdivergenceopt):
   366             b'experimental', b'evolution.allowdivergence'
       
   367         )
       
   368         if allowdivergence:
       
   369             self.obsolete_with_successor_in_rebase_set = set()
   366             self.obsolete_with_successor_in_rebase_set = set()
   370         else:
   367         else:
   371             for rev in self.repo.revs(
   368             for rev in self.repo.revs(
   372                 b'descendants(%ld) and not %ld',
   369                 b'descendants(%ld) and not %ld',
   373                 self.obsolete_with_successor_in_rebase_set,
   370                 self.obsolete_with_successor_in_rebase_set,
  1650     `rebaseobsrevs`: set of obsolete revision in source
  1647     `rebaseobsrevs`: set of obsolete revision in source
  1651     `rebaseobsskipped`: set of revisions from source skipped because they have
  1648     `rebaseobsskipped`: set of revisions from source skipped because they have
  1652     successors in destination or no non-obsolete successor.
  1649     successors in destination or no non-obsolete successor.
  1653     """
  1650     """
  1654     # Obsolete node with successors not in dest leads to divergence
  1651     # Obsolete node with successors not in dest leads to divergence
  1655     divergenceok = ui.configbool(b'experimental', b'evolution.allowdivergence')
  1652     divergenceok = obsolete.isenabled(repo, obsolete.allowdivergenceopt)
  1656     divergencebasecandidates = rebaseobsrevs - rebaseobsskipped
  1653     divergencebasecandidates = rebaseobsrevs - rebaseobsskipped
  1657 
  1654 
  1658     if divergencebasecandidates and not divergenceok:
  1655     if divergencebasecandidates and not divergenceok:
  1659         divhashes = (bytes(repo[r]) for r in divergencebasecandidates)
  1656         divhashes = (bytes(repo[r]) for r in divergencebasecandidates)
  1660         msg = _(b"this rebase will cause divergences from: %s")
  1657         msg = _(b"this rebase will cause divergences from: %s")