changeset 3302:192085505f6f

filectx: add size method
author Matt Mackall <mpm@selenic.com>
date Mon, 09 Oct 2006 23:20:48 -0500
parents 3cd51b986172
children 488d3062d225
files mercurial/context.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Mon Oct 09 23:08:41 2006 -0500
+++ b/mercurial/context.py	Mon Oct 09 23:20:48 2006 -0500
@@ -8,7 +8,7 @@
 from node import *
 from i18n import gettext as _
 from demandload import demandload
-demandload(globals(), "ancestor bdiff repo revlog util")
+demandload(globals(), "ancestor bdiff repo revlog util os")
 
 class changectx(object):
     """A changecontext object makes access to data related to a particular
@@ -191,6 +191,7 @@
     def data(self): return self._filelog.read(self._filenode)
     def renamed(self): return self._filelog.renamed(self._filenode)
     def path(self): return self._path
+    def size(self): return self._filelog.size(self._filerev)
 
     def parents(self):
         p = self._path
@@ -465,3 +466,4 @@
     def children(self):
         return []
 
+    def size(self): return os.stat(self._repo.wjoin(self._path)).st_size