filectx: refactor filectx.rev() to use filectx._changeid
authorDurham Goode <durham@fb.com>
Thu, 30 May 2013 17:49:37 -0700
changeset 19288 ec367f203cb5
parent 19287 8b04e1344111
child 19289 6ea1f858efd9
filectx: refactor filectx.rev() to use filectx._changeid The code in filectx.rev() was identical to filectx._changeid. Fixing this allows alternative filectx implementations to only override _changeid.
mercurial/context.py
--- a/mercurial/context.py	Mon Jun 03 17:20:45 2013 -0700
+++ b/mercurial/context.py	Thu May 30 17:49:37 2013 -0700
@@ -503,14 +503,8 @@
         return self._changectx.flags(self._path)
     def filelog(self):
         return self._filelog
-
     def rev(self):
-        if '_changectx' in self.__dict__:
-            return self._changectx.rev()
-        if '_changeid' in self.__dict__:
-            return self._changectx.rev()
-        return self._filelog.linkrev(self._filerev)
-
+        return self._changeid
     def linkrev(self):
         return self._filelog.linkrev(self._filerev)
     def node(self):