basectx: add subrev method to return the rev of a subrepo given a subpath
authorSean Farley <sean.michael.farley@gmail.com>
Fri, 20 Sep 2013 21:55:42 -0500
changeset 21586 8a2637cf1130
parent 21585 652e07debf10
child 21587 02a8612ddec2
basectx: add subrev method to return the rev of a subrepo given a subpath This will be used in an upcoming patch to simplify the status method by eliminating an if block.
mercurial/context.py
--- a/mercurial/context.py	Tue May 27 17:41:20 2014 -0700
+++ b/mercurial/context.py	Fri Sep 20 21:55:42 2013 -0500
@@ -132,6 +132,9 @@
     def substate(self):
         return subrepo.state(self, self._repo.ui)
 
+    def subrev(self, subpath):
+        return self.substate[subpath][1]
+
     def rev(self):
         return self._rev
     def node(self):