mercurial/obsolete.py
branchstable
changeset 47798 2cd00052ae4d
parent 47020 ba6881c6a178
child 48686 4507bc001365
equal deleted inserted replaced
47797:e69c82bf3a01 47798:2cd00052ae4d
   142 
   142 
   143 def getoptions(repo):
   143 def getoptions(repo):
   144     """Returns dicts showing state of obsolescence features."""
   144     """Returns dicts showing state of obsolescence features."""
   145 
   145 
   146     createmarkersvalue = _getoptionvalue(repo, createmarkersopt)
   146     createmarkersvalue = _getoptionvalue(repo, createmarkersopt)
   147     unstablevalue = _getoptionvalue(repo, allowunstableopt)
   147     if createmarkersvalue:
   148     divergencevalue = _getoptionvalue(repo, allowdivergenceopt)
   148         unstablevalue = _getoptionvalue(repo, allowunstableopt)
   149     exchangevalue = _getoptionvalue(repo, exchangeopt)
   149         divergencevalue = _getoptionvalue(repo, allowdivergenceopt)
   150 
   150         exchangevalue = _getoptionvalue(repo, exchangeopt)
   151     # createmarkers must be enabled if other options are enabled
   151     else:
   152     if (
   152         # if we cannot create obsolescence markers, we shouldn't exchange them
   153         unstablevalue or divergencevalue or exchangevalue
   153         # or perform operations that lead to instability or divergence
   154     ) and not createmarkersvalue:
   154         unstablevalue = False
   155         raise error.Abort(
   155         divergencevalue = False
   156             _(
   156         exchangevalue = False
   157                 b"'createmarkers' obsolete option must be enabled "
       
   158                 b"if other obsolete options are enabled"
       
   159             )
       
   160         )
       
   161 
   157 
   162     return {
   158     return {
   163         createmarkersopt: createmarkersvalue,
   159         createmarkersopt: createmarkersvalue,
   164         allowunstableopt: unstablevalue,
   160         allowunstableopt: unstablevalue,
   165         allowdivergenceopt: divergencevalue,
   161         allowdivergenceopt: divergencevalue,