--- a/hgext3rd/evolve/compat.py Thu Mar 07 10:51:48 2019 +0100
+++ b/hgext3rd/evolve/compat.py Wed Mar 06 16:56:25 2019 +0800
@@ -16,7 +16,6 @@
obsolete,
obsutil,
repair,
- revset,
scmutil,
util,
ui as uimod,
@@ -54,43 +53,11 @@
# Evolution renaming compat
-TROUBLES = {}
-
-if not util.safehasattr(context.basectx, 'orphan'):
- TROUBLES['ORPHAN'] = 'unstable'
- context.basectx.orphan = context.basectx.unstable
-else:
- TROUBLES['ORPHAN'] = 'orphan'
-
-if not util.safehasattr(context.basectx, 'contentdivergent'):
- TROUBLES['CONTENTDIVERGENT'] = 'divergent'
- context.basectx.contentdivergent = context.basectx.divergent
-else:
- TROUBLES['CONTENTDIVERGENT'] = 'content-divergent'
-
-if not util.safehasattr(context.basectx, 'phasedivergent'):
- TROUBLES['PHASEDIVERGENT'] = 'bumped'
- context.basectx.phasedivergent = context.basectx.bumped
-else:
- TROUBLES['PHASEDIVERGENT'] = 'phase-divergent'
-
-if not util.safehasattr(context.basectx, 'isunstable'):
- context.basectx.isunstable = context.basectx.troubled
-
-if not util.safehasattr(revset, 'orphan'):
- @eh.revsetpredicate('orphan')
- def oprhanrevset(*args, **kwargs):
- return revset.unstable(*args, **kwargs)
-
-if not util.safehasattr(revset, 'contentdivergent'):
- @eh.revsetpredicate('contentdivergent')
- def contentdivergentrevset(*args, **kwargs):
- return revset.divergent(*args, **kwargs)
-
-if not util.safehasattr(revset, 'phasedivergent'):
- @eh.revsetpredicate('phasedivergent')
- def phasedivergentrevset(*args, **kwargs):
- return revset.bumped(*args, **kwargs)
+TROUBLES = {
+ 'ORPHAN': 'orphan',
+ 'CONTENTDIVERGENT': 'content-divergent',
+ 'PHASEDIVERGENT': 'phase-divergent',
+}
if util.safehasattr(uimod.ui, 'makeprogress'):
def progress(ui, topic, pos, item="", unit="", total=None):
@@ -103,26 +70,6 @@
def progress(ui, topic, pos, item="", unit="", total=None):
ui.progress(topic, pos, item="", unit="", total=None)
-if not util.safehasattr(context.basectx, 'instabilities'):
- def instabilities(self):
- """return the list of instabilities affecting this changeset.
-
- Instabilities are returned as strings. possible values are:
- - orphan,
- - phase-divergent,
- - content-divergent.
- """
- instabilities = []
- if self.orphan():
- instabilities.append('orphan')
- if self.phasedivergent():
- instabilities.append('phase-divergent')
- if self.contentdivergent():
- instabilities.append('content-divergent')
- return instabilities
-
- context.basectx.instabilities = instabilities
-
# XXX: Better detection of property cache
if 'predecessors' not in dir(obsolete.obsstore):
@property
@@ -131,15 +78,6 @@
obsolete.obsstore.predecessors = predecessors
-if not util.safehasattr(obsolete, '_computeorphanset'):
- obsolete._computeorphanset = obsolete.cachefor('orphan')(obsolete._computeunstableset)
-
-if not util.safehasattr(obsolete, '_computecontentdivergentset'):
- obsolete._computecontentdivergentset = obsolete.cachefor('contentdivergent')(obsolete._computedivergentset)
-
-if not util.safehasattr(obsolete, '_computephasedivergentset'):
- obsolete._computephasedivergentset = obsolete.cachefor('phasedivergent')(obsolete._computebumpedset)
-
def memfilectx(repo, ctx, fctx, flags, copied, path):
# XXX Would it be better at the module level?
varnames = context.memfilectx.__init__.__code__.co_varnames