Example #1
0
 def _writedirstate(self, st):
     # use the modification time of the newly created temporary file as the
     # filesystem's notion of 'now'
     now = util.statmtimesec(util.fstat(st)) & _rangemask
     st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl, now))
     st.close()
     self._lastnormaltime = 0
     self._dirty = self._dirtypl = False
Example #2
0
 def _writedirstate(self, st):
     # use the modification time of the newly created temporary file as the
     # filesystem's notion of 'now'
     now = util.statmtimesec(util.fstat(st)) & _rangemask
     st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl,
                                    now))
     st.close()
     self._lastnormaltime = 0
     self._dirty = self._dirtypl = False
Example #3
0
 def write(self):
     if not self._dirty:
         return
     st = self._opener("dirstate", "w", atomictemp=True)
     # use the modification time of the newly created temporary file as the
     # filesystem's notion of 'now'
     now = util.fstat(st).st_mtime
     st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl, now))
     st.close()
     self._lastnormaltime = 0
     self._dirty = self._dirtypl = False
Example #4
0
    def write(self):
        if not self._dirty:
            return
        st = self._opener("dirstate", "w", atomictemp=True)

        def finish(s):
            st.write(s)
            st.close()
            self._lastnormaltime = 0
            self._dirty = self._dirtypl = False

        # use the modification time of the newly created temporary file as the
        # filesystem's notion of 'now'
        now = util.fstat(st).st_mtime
        finish(parsers.pack_dirstate(self._map, self._copymap, self._pl, now))
Example #5
0
    def write(self):
        if not self._dirty:
            return

        # enough 'delaywrite' prevents 'pack_dirstate' from dropping
        # timestamp of each entries in dirstate, because of 'now > mtime'
        delaywrite = self._ui.configint('debug', 'dirstate.delaywrite', 0)
        if delaywrite:
            import time # to avoid useless import
            time.sleep(delaywrite)

        st = self._opener("dirstate", "w", atomictemp=True)
        # use the modification time of the newly created temporary file as the
        # filesystem's notion of 'now'
        now = util.fstat(st).st_mtime
        st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl, now))
        st.close()
        self._lastnormaltime = 0
        self._dirty = self._dirtypl = False
Example #6
0
    def write(self):
        if not self._dirty:
            return

        # enough 'delaywrite' prevents 'pack_dirstate' from dropping
        # timestamp of each entries in dirstate, because of 'now > mtime'
        delaywrite = self._ui.configint('debug', 'dirstate.delaywrite', 0)
        if delaywrite > 0:
            import time # to avoid useless import
            time.sleep(delaywrite)

        st = self._opener(self._filename, "w", atomictemp=True)
        # use the modification time of the newly created temporary file as the
        # filesystem's notion of 'now'
        now = util.fstat(st).st_mtime
        st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl, now))
        st.close()
        self._lastnormaltime = 0
        self._dirty = self._dirtypl = False