# HG changeset patch # User Jun Wu # Date 2017-05-10 02:53:31 # Node ID 842ea95d45dc0d5bb66408292f594bf22ee60a51 # Parent c38c15d4ce486e8d0414fcc7b5e45e6b16cc175c filectx: move size to basefilectx See previous patch for context - avoid code duplication. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -801,6 +801,8 @@ class basefilectx(object): return self._copied def repo(self): return self._repo + def size(self): + return len(self.data()) def path(self): return self._path @@ -2065,8 +2067,6 @@ class memfilectx(committablefilectx): def data(self): return self._data - def size(self): - return len(self.data()) def remove(self, ignoremissing=False): """wraps unlink for a repo's working directory"""