masterbase = os.path.basename(backend.master(fn))
if masterbase not in registered:
pairs.append((fn, "?"))
- continue
elif not os.path.exists(fn):
pairs.append((fn, "!"))
- continue
# Relies on the fact that we touch the file with utimes(2)
# each time it's checked out.
elif os.path.getmtime(fn) > os.path.getmtime(backend.master(fn)):
pairs.append((fn, "M"))
- continue
- metadata = History(fn)
- if len(metadata) == 0:
+ elif not backend.has_revisions(fn):
pairs.append((fn, "A"))
else:
pairs.append((fn, "U"))
return os.path.join(os.path.dirname(arg),
repodir,
os.path.basename(arg) + ",v")
+ def has_revisions(self, arg):
+ "Does the master for this file have any revisions"
+ # The magic number 105 is the size of an empty RCS file (no
+ # metadata, no revisions) at 76 bytes, plus 29 bytes. We
+ # assume that this ize has stayed constant or increased since
+ # ancient times. In fact the size of an RCS file with revisions
+ # goes up more - by the 78 bytes for the final, fixed line of the
+ # log display. This gives us plenty of slack to cope with
+ # minor format differences.
+ #
+ # The motivation here is to make "src status" faster by avoid
+ # the need for an entire log parse when checking for "A"
+ # status.
+ return os.path.getsize(self.master(arg)) > 105
def workfile(self, arg):
return arg[:-2]
def add(self, arg):