mercurial/util.py
changeset 11212 4d8db9676171
parent 11011 648130161e4d
child 11232 97f6d2a02c1f
equal deleted inserted replaced
11211:e43c23d189a5 11212:4d8db9676171
   770 
   770 
   771     All writes will be redirected to a temporary copy of the original
   771     All writes will be redirected to a temporary copy of the original
   772     file.  When rename is called, the copy is renamed to the original
   772     file.  When rename is called, the copy is renamed to the original
   773     name, making the changes visible.
   773     name, making the changes visible.
   774     """
   774     """
   775     def __init__(self, name, mode, createmode):
   775     def __init__(self, name, mode='w+b', createmode=None):
   776         self.__name = name
   776         self.__name = name
   777         self._fp = None
   777         self._fp = None
   778         self.temp = mktempcopy(name, emptyok=('w' in mode),
   778         self.temp = mktempcopy(name, emptyok=('w' in mode),
   779                                createmode=createmode)
   779                                createmode=createmode)
   780         self._fp = posixfile(self.temp, mode)
   780         self._fp = posixfile(self.temp, mode)