changeset 27277:07ae7e8c8ac9

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 05 Dec 2015 23:14:49 -0800
parents 38024b75241a
children 42aa0e570eaa
files mercurial/localrepo.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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]