comparison repo_local_status.py @ 22:b9fe6d26b3fa

minor changes, fixes, upgrades
author drewp@bigasterisk.com
date Tue, 29 Mar 2022 21:15:51 -0700
parents cb71722bb75c
children
comparison
equal deleted inserted replaced
21:cb71722bb75c 22:b9fe6d26b3fa
150 150
151 @inlineCallbacks 151 @inlineCallbacks
152 def writeStatus(graph, repo): 152 def writeStatus(graph, repo):
153 statusResp = yield runHg(repo.path, ['status']) 153 statusResp = yield runHg(repo.path, ['status'])
154 unknowns = len([row for row in statusResp if row['status'] == '?']) 154 unknowns = len([row for row in statusResp if row['status'] == '?'])
155 replaceContext( 155 replaceContext(graph, URIRef(repo.localInstance() + '/status'), {
156 graph, URIRef(repo.localInstance() + '/status'), { 156 (repo.localInstance(), EX['unknownCount'], Literal(unknowns)),
157 (repo.localInstance(), EX['unknownCount'], Literal(unknowns)), 157 (repo.localInstance(), EX['changed'], Literal(len(statusResp) - unknowns)),
158 (repo.localInstance(), EX['changed'], Literal(len(statusResp) - unknowns)), 158 })
159 })
160 159
161 160
162 def writeLocalRepo(graph, repo: Repo): 161 def writeLocalRepo(graph, repo: Repo):
163 replaceContext(graph, URIRef(repo.uri() + '/config'), { 162 replaceContext(graph, URIRef(repo.uri() + '/config'), {
163 (repo.uri(), RDF.type, EX['Repo']),
164 (repo.uri(), EX['localRepo'], repo.localInstance()), 164 (repo.uri(), EX['localRepo'], repo.localInstance()),
165 (repo.localInstance(), RDF.type, EX['HgRepo']), 165 (repo.localInstance(), RDF.type, EX['HgRepo']),
166 }) 166 })
167 167
168 168