Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 33753:f163edb45c47
context: rename unstable into orphan
Rename unstable context method into orphan and add a deprecation
warning on unstable.
Only update all callers to keep the patch straightforward.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D239
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 02 Aug 2017 18:50:32 +0200 |
parents | ab0c55c2ad9a |
children | 8b2d7684407b |
comparison
equal
deleted
inserted
replaced
33752:ab0c55c2ad9a | 33753:f163edb45c47 |
---|---|
202 def extinct(self): | 202 def extinct(self): |
203 """True if the changeset is extinct""" | 203 """True if the changeset is extinct""" |
204 return self.rev() in obsmod.getrevs(self._repo, 'extinct') | 204 return self.rev() in obsmod.getrevs(self._repo, 'extinct') |
205 | 205 |
206 def unstable(self): | 206 def unstable(self): |
207 msg = ("'context.unstable' is deprecated, " | |
208 "use 'context.orphan'") | |
209 self._repo.ui.deprecwarn(msg, '4.4') | |
210 return self.orphan() | |
211 | |
212 def orphan(self): | |
207 """True if the changeset is not obsolete but it's ancestor are""" | 213 """True if the changeset is not obsolete but it's ancestor are""" |
208 return self.rev() in obsmod.getrevs(self._repo, 'unstable') | 214 return self.rev() in obsmod.getrevs(self._repo, 'unstable') |
209 | 215 |
210 def bumped(self): | 216 def bumped(self): |
211 """True if the changeset try to be a successor of a public changeset | 217 """True if the changeset try to be a successor of a public changeset |
221 """ | 227 """ |
222 return self.rev() in obsmod.getrevs(self._repo, 'divergent') | 228 return self.rev() in obsmod.getrevs(self._repo, 'divergent') |
223 | 229 |
224 def troubled(self): | 230 def troubled(self): |
225 """True if the changeset is either unstable, bumped or divergent""" | 231 """True if the changeset is either unstable, bumped or divergent""" |
226 return self.unstable() or self.bumped() or self.divergent() | 232 return self.orphan() or self.bumped() or self.divergent() |
227 | 233 |
228 def troubles(self): | 234 def troubles(self): |
229 """Keep the old version around in order to avoid breaking extensions | 235 """Keep the old version around in order to avoid breaking extensions |
230 about different return values. | 236 about different return values. |
231 """ | 237 """ |
232 msg = ("'context.troubles' is deprecated, " | 238 msg = ("'context.troubles' is deprecated, " |
233 "use 'context.instabilities'") | 239 "use 'context.instabilities'") |
234 self._repo.ui.deprecwarn(msg, '4.4') | 240 self._repo.ui.deprecwarn(msg, '4.4') |
235 | 241 |
236 troubles = [] | 242 troubles = [] |
237 if self.unstable(): | 243 if self.orphan(): |
238 troubles.append('orphan') | 244 troubles.append('orphan') |
239 if self.bumped(): | 245 if self.bumped(): |
240 troubles.append('bumped') | 246 troubles.append('bumped') |
241 if self.divergent(): | 247 if self.divergent(): |
242 troubles.append('divergent') | 248 troubles.append('divergent') |
249 - orphan, | 255 - orphan, |
250 - phase-divergent, | 256 - phase-divergent, |
251 - content-divergent. | 257 - content-divergent. |
252 """ | 258 """ |
253 instabilities = [] | 259 instabilities = [] |
254 if self.unstable(): | 260 if self.orphan(): |
255 instabilities.append('orphan') | 261 instabilities.append('orphan') |
256 if self.bumped(): | 262 if self.bumped(): |
257 instabilities.append('phase-divergent') | 263 instabilities.append('phase-divergent') |
258 if self.divergent(): | 264 if self.divergent(): |
259 instabilities.append('content-divergent') | 265 instabilities.append('content-divergent') |