def connect(self): self.p4 = P4Server(self.P4PORT, self.P4USER, self.P4PASSWD, log_level=self.cli_arguments.verbose) self.p4.exception_level = P4.RAISE_ERROR self.p4.client = self.P4CLIENT clientspec = self.p4.fetch_client(self.p4.client) self.stream = clientspec.get('Stream') self.root = clientspec._root self.p4.cwd = self.root self.clientmap = Map(clientspec._view) ctr = Map('//%s/... %s/...' % (clientspec._client, clientspec._root)) self.localmap = Map.join(self.clientmap, ctr) self.depotmap = self.localmap.reverse() self.maskdepotmap = None if self.P4MASKCLIENT: maskclientspec = self.p4.fetch_client(self.P4MASKCLIENT) maskclientmap = Map(maskclientspec._view) ctr = Map('//%s/... %s/...' % (maskclientspec._client, maskclientspec._root)) masklocalmap = Map.join(maskclientmap, ctr) self.maskdepotmap = masklocalmap.reverse()
def has_intersecting_views(current_reviews, clientmap): """Determine whether the clientmap intersects the current set of reviews for this GF reviews user. """ reviews_map = Map() for v in current_reviews: reviews_map.insert(v) repo_map = Map() for l in clientmap.lhs(): repo_map.insert(l) joined = Map.join(reviews_map, repo_map) #for l in joined.lhs(): # if not l.startswith('-'): # return INTERSECT return NO_INTERSECT