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.
--- 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]