def fill(self): if not self.real or self._state != None: return # At this point, self.rfo and self.fstore should be # empty. self.rfo = rcsfile.rcsfile(self.rname) try: with open(self.name, "r") as fp: self.fstore = fp.read() except EnvironmentError: pass # Now we check consistency. # First: real file must exist: if not self.fstore: self._state = sBad elif not self.rfo: self._state = sNoRCS elif self.rfo.headlocked(): self._state = sLocked # If head is unlocked, the on-disk file must be the # same as the RCS file. elif not rcsfile.consistent(self.rfo, self.fstore): self._state = sInconsist # Mark us as non-displayable: self.fstore = None else: self._state = sGood
def isdirty(self): if self._state == sInconsist: return True elif self._state in (sBad, sGood, sNoRCS): return False else: assert(self._state == sLocked) return not rcsfile.consistent(self.rfo, self.fstore)
def isdirty(self): if self._state == sInconsist: return True elif self._state in (sBad, sGood, sNoRCS): return False else: assert (self._state == sLocked) return not rcsfile.consistent(self.rfo, self.fstore)