comparison mercurial/context.py @ 11151:c5c190822501

slightly improve memctx api
author Alexander Solovyov <piranha@piranha.org.ua>
date Sat, 01 May 2010 15:00:21 +0300
parents ca46910dd9ea
children a1aad8333864
comparison
equal deleted inserted replaced
11150:f66ca4431eb9 11151:c5c190822501
933 933
934 def filectx(self, path, filelog=None): 934 def filectx(self, path, filelog=None):
935 """get a file context from the working directory""" 935 """get a file context from the working directory"""
936 return self._filectxfn(self._repo, self, path) 936 return self._filectxfn(self._repo, self, path)
937 937
938 def commit(self):
939 """commit context to the repo"""
940 return self._repo.commitctx(self)
941
938 class memfilectx(object): 942 class memfilectx(object):
939 """memfilectx represents an in-memory file to commit. 943 """memfilectx represents an in-memory file to commit.
940 944
941 See memctx for more details. 945 See memctx for more details.
942 """ 946 """
943 def __init__(self, path, data, islink, isexec, copied): 947 def __init__(self, path, data, islink=False, isexec=False, copied=None):
944 """ 948 """
945 path is the normalized file path relative to repository root. 949 path is the normalized file path relative to repository root.
946 data is the file content as a string. 950 data is the file content as a string.
947 islink is True if the file is a symbolic link. 951 islink is True if the file is a symbolic link.
948 isexec is True if the file is executable. 952 isexec is True if the file is executable.