def parselog(self, fp): parents = [] message = [] node = revlog.nullid inmsg = False user = None date = None for line in fp.read().splitlines(): if inmsg: message.append(line) elif line.startswith('# User '): user = line[7:] elif line.startswith('# Date '): date = line[7:] elif line.startswith('# Node ID '): node = revlog.bin(line[10:]) elif line.startswith('# Parent '): parents.append(revlog.bin(line[9:])) elif not line.startswith('# '): inmsg = True message.append(line) if None in (user, date): raise error.Abort( _("filter corrupted changeset (no user or date)")) return (node, user, date, '\n'.join(message), parents)
def fastmanifestcached(repo, subset, x): """Revset encompassing all revisions whose manifests are cached""" # At the high level, we look at what is cached, and go from manifest nodes # to changelog revs. # # 1) We look at all the cached manifest, from each of them we find the first # changelog rev that introduced each cached manifest thanks to linkrevs. # 2) We compute the minimum of those changelog revs. It is guaranteed that # all the changelog revs whose manifest are cached are above that minimum # rev in the changelog # 3) From this minimum, we inspect all the more recent and visible changelog # revisions and keep track of the one whose manifest is cached. cache = fastmanifestcache.getinstance(repo.store.opener, repo.ui) manifestsbinnodes = set([revlog.bin(u.replace("fast","")) for u in cache.ondiskcache]) mfrevlog = repo.manifestlog._revlog manifestslinkrevs = [mfrevlog.linkrev(mfrevlog.rev(k)) for k in manifestsbinnodes] cachedrevs = set() if manifestslinkrevs: for u in repo.changelog.revs(min(manifestslinkrevs)): revmanifestbin = repo.changelog.changelogrevision(u).manifest if revmanifestbin in manifestsbinnodes: cachedrevs.add(u) return subset & cachedrevs
def parselog(self, fp): parents = [] message = [] node = revlog.nullid inmsg = False for line in fp.read().splitlines(): if inmsg: message.append(line) elif line.startswith('# User '): user = line[7:] elif line.startswith('# Date '): date = line[7:] elif line.startswith('# Node ID '): node = revlog.bin(line[10:]) elif line.startswith('# Parent '): parents.append(revlog.bin(line[9:])) elif not line.startswith('#'): inmsg = True message.append(line) return (node, user, date, '\n'.join(message), parents)
def readseries(self): nodes = [] merges = [] cur = nodes for line in self.opener('series').read().splitlines(): if line.startswith('# Merges'): cur = merges continue cur.append(revlog.bin(line)) return (nodes, merges)
def parselog(self, fp): parents = [] message = [] node = revlog.nullid inmsg = False user = None date = None for line in fp.read().splitlines(): if inmsg: message.append(line) elif line.startswith('# User '): user = line[7:] elif line.startswith('# Date '): date = line[7:] elif line.startswith('# Node ID '): node = revlog.bin(line[10:]) elif line.startswith('# Parent '): parents.append(revlog.bin(line[9:])) elif not line.startswith('# '): inmsg = True message.append(line) if None in (user, date): raise util.Abort(_("filter corrupted changeset (no user or date)")) return (node, user, date, '\n'.join(message), parents)