Patchwork [10,of,14,RFC] memfilectx: add a size method

login
register
mail settings
Submitter Sean Farley
Date July 9, 2013, 9:54 p.m.
Message ID <15c72f9d02eada7a9811.1373406881@laptop.local>
Download mbox | patch
Permalink /patch/1820/
State Accepted
Commit 14514dd542aae77856be4e4f25474a721bc2501e
Headers show

Comments

Sean Farley - July 9, 2013, 9:54 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1373323921 18000
#      Mon Jul 08 17:52:01 2013 -0500
# Node ID 15c72f9d02eada7a9811034da42628f30bfd073a
# Parent  9201246ffda525a9c8e08b4e352a0bf1725f644c
memfilectx: add a size method

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1370,10 +1370,12 @@ 
         return "<memfilectx %s>" % str(self)
     def path(self):
         return self._path
     def data(self):
         return self._data
+    def size(self):
+        return len(self.data())
     def flags(self):
         return self._flags
     def isexec(self):
         return 'x' in self._flags
     def islink(self):