localrepo: reinstate localrepo.parents with a deprecation warning
authorPierre-Yves David <pierre-yves.david@fb.com>
Sat, 05 Dec 2015 23:14:49 -0800
changeset 27277 07ae7e8c8ac9
parent 27276 38024b75241a
child 27278 42aa0e570eaa
localrepo: reinstate localrepo.parents with a deprecation warning The function was dropped in 3fe8cb40c9c5. This API drop brokes three of my extensions including some critical to my workflow like tortoisehg. Lets mark this API for death and give people time to fix their code.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sat Dec 05 23:34:07 2015 -0800
+++ b/mercurial/localrepo.py	Sat Dec 05 23:14:49 2015 -0800
@@ -851,6 +851,12 @@
             f = f[1:]
         return filelog.filelog(self.svfs, f)
 
+    def parents(self, changeid=None):
+        '''get list of changectxs for parents of changeid'''
+        msg = 'repo.parents() is deprecated, use repo[%r].parents()' % changeid
+        self.ui.deprecwarn(msg, '3.7')
+        return self[changeid].parents()
+
     def changectx(self, changeid):
         return self[changeid]