##// END OF EJS Templates
dirstate: use self._filename instead of immediate string `dirstate`...
FUJIWARA Katsunori -
r25226:00d426a3 default
parent child Browse files
Show More
@@ -48,6 +48,7 class dirstate(object):
48 self._ui = ui
48 self._ui = ui
49 self._filecache = {}
49 self._filecache = {}
50 self._parentwriters = 0
50 self._parentwriters = 0
51 self._filename = 'dirstate'
51
52
52 def beginparentchange(self):
53 def beginparentchange(self):
53 '''Marks the beginning of a set of changes that involve changing
54 '''Marks the beginning of a set of changes that involve changing
@@ -122,7 +123,7 class dirstate(object):
122 @propertycache
123 @propertycache
123 def _pl(self):
124 def _pl(self):
124 try:
125 try:
125 fp = self._opener("dirstate")
126 fp = self._opener(self._filename)
126 st = fp.read(40)
127 st = fp.read(40)
127 fp.close()
128 fp.close()
128 l = len(st)
129 l = len(st)
@@ -325,7 +326,7 class dirstate(object):
325 self._map = {}
326 self._map = {}
326 self._copymap = {}
327 self._copymap = {}
327 try:
328 try:
328 st = self._opener.read("dirstate")
329 st = self._opener.read(self._filename)
329 except IOError, err:
330 except IOError, err:
330 if err.errno != errno.ENOENT:
331 if err.errno != errno.ENOENT:
331 raise
332 raise
@@ -592,7 +593,7 class dirstate(object):
592 import time # to avoid useless import
593 import time # to avoid useless import
593 time.sleep(delaywrite)
594 time.sleep(delaywrite)
594
595
595 st = self._opener("dirstate", "w", atomictemp=True)
596 st = self._opener(self._filename, "w", atomictemp=True)
596 # use the modification time of the newly created temporary file as the
597 # use the modification time of the newly created temporary file as the
597 # filesystem's notion of 'now'
598 # filesystem's notion of 'now'
598 now = util.fstat(st).st_mtime
599 now = util.fstat(st).st_mtime
General Comments 0
You need to be logged in to leave comments. Login now