changeset 11151:c5c190822501

slightly improve memctx api
author Alexander Solovyov <piranha@piranha.org.ua>
date Sat, 01 May 2010 15:00:21 +0300
parents f66ca4431eb9
children e8d10d085f47
files mercurial/context.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Mon May 10 22:06:28 2010 +0200
+++ b/mercurial/context.py	Sat May 01 15:00:21 2010 +0300
@@ -935,12 +935,16 @@
         """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.