Patchwork [12,of,14,RFC] memfilectx: change init to take a repo object

login
register
mail settings
Submitter Sean Farley
Date July 9, 2013, 9:54 p.m.
Message ID <56574c855bf31605fc2f.1373406883@laptop.local>
Download mbox | patch
Permalink /patch/1821/
State Changes Requested
Headers show

Comments

Sean Farley - July 9, 2013, 9:54 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1373324004 18000
#      Mon Jul 08 17:53:24 2013 -0500
# Node ID 56574c855bf31605fc2f7a696181f9d84a7eb64f
# Parent  1fa8870e0ae8dc5f23f5326470c5fbc93f63a95b
memfilectx: change init to take a repo object

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1345,19 +1345,20 @@ 
 class memfilectx(object):
     """memfilectx represents an in-memory file to commit.
 
     See memctx for more details.
     """
-    def __init__(self, path, data, islink=False, isexec=False, copied=None):
+    def __init__(self, repo, path, data, islink=False, isexec=False, copied=None):
         """
+        repo is the current localrepo.
         path is the normalized file path relative to repository root.
         data is the file content as a string.
         islink is True if the file is a symbolic link.
         isexec is True if the file is executable.
         copied is the source file path if current file was copied in the
         revision being committed, or None."""
-        self._path = path
+        super(workingfilectx, self).__init__(repo, path, data)
         self._data = data
         self._flags = (islink and 'l' or '') + (isexec and 'x' or '')
         self._copied = None
         if copied:
             self._copied = (copied, nullid)