changeset 21586:8a2637cf1130

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.
author Sean Farley <sean.michael.farley@gmail.com>
date Fri, 20 Sep 2013 21:55:42 -0500
parents 652e07debf10
children 02a8612ddec2
files mercurial/context.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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):