trouble-reports: yield to in code reporting of new troubles stable
authorMartin von Zweigbergk <martinvonz@google.com>
Sat, 20 Jan 2018 11:07:18 +0100
branchstable
changeset 3427 cbeee8d31d58
parent 3426 be284a34b822
child 3428 6904e6bea2f7
trouble-reports: yield to in code reporting of new troubles Mercurial 4.5 has the feature in core, let core do the reporting in this case.
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Fri Jan 19 20:41:58 2018 +0100
+++ b/hgext3rd/evolve/__init__.py	Sat Jan 20 11:07:18 2018 +0100
@@ -809,6 +809,10 @@
 @eh.wrapcommand("unbundle")
 def warnobserrors(orig, ui, repo, *args, **kwargs):
     """display warning is the command resulted in more instable changeset"""
+    # hg < 4.4 does not have the feature built in. bail out otherwise.
+    if util.safehasattr(scmutil, '_reportstroubledchangesets'):
+        return orig(ui, repo, *args, **kwargs)
+
     # part of the troubled stuff may be filtered (stash ?)
     # This needs a better implementation but will probably wait for core.
     filtered = repo.changelog.filteredrevs