[PATCH] slightly improve memctx api

Alexander Solovyov piranha at piranha.org.ua
Sat May 1 07:05:28 CDT 2010


# HG changeset patch
# User Alexander Solovyov <piranha at piranha.org.ua>
# Date 1272715221 -10800
# Node ID 2d9b50ad5e568f1e51525271d9867ea5fec7915c
# Parent  bf7e63fedca12ab725af8a5cb0d0eced403bc7ec
slightly improve memctx api

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -887,12 +887,16 @@ class memctx(object):
         """get a file context from the working directory"""
         return self._filectxfn(self._repo, self, path)
 
+    def commit(self):
+        """commit context to the repo"""
+        return self._repo.commitctx(self)
+
 class memfilectx(object):
     """memfilectx represents an in-memory file to commit.
 
     See memctx for more details.
     """
-    def __init__(self, path, data, islink, isexec, copied):
+    def __init__(self, path, data, islink=False, isexec=False, copied=None):
         """
         path is the normalized file path relative to repository root.
         data is the file content as a string.


More information about the Mercurial-devel mailing list