def _iscleanrepo(repo): """Check if there are any local changes relevant for commit cloud in the repo""" return ( not _getheads(repo) and not _getbookmarks(repo) and { bookmarks.splitremotename(remotename)[1] for remotename in _getremotebookmarks(repo).keys() }.issubset(_getprotectedremotebookmarks(repo)) )
def upstream_revs(filt, repo, subset, x): upstream_tips = set() for remotename in repo._remotenames.keys(): rname = "remote" + remotename try: ns = repo.names[rname] except KeyError: continue for name in ns.listnames(repo): if filt(splitremotename(name)[0]): upstream_tips.update(ns.nodes(repo, name)) if not upstream_tips: return smartset.baseset([], repo=repo) tipancestors = repo.revs("::%ln", upstream_tips) return smartset.filteredset(subset, lambda n: n in tipancestors)