# # patch "TODO" # from [14a4bba0be838786073009ba5e7e895e94be21c9] # to [4afa7c9b2014e89bbfab50b33586b36b49e98a1d] # # patch "dumb.py" # from [d10d1c98a57ed51b38b7649cd09c583de05ec2c4] # to [6d79025eea4e9a9576e61e3ccad42b318bfe5e47] # # patch "monotone.py" # from [4049bb72eee1adb79206f2c27432dc1009ea5e57] # to [e2376d24295fd1877b22b231c6161b89d90fbfe8] # ======================================================================== --- TODO 14a4bba0be838786073009ba5e7e895e94be21c9 +++ TODO 4afa7c9b2014e89bbfab50b33586b36b49e98a1d @@ -27,6 +27,10 @@ * packet commands -> automate (combines with next item:) * use automate stdio interface (and automate get_revision) to make export much faster +* better automate-ish way to deal with keys and certs (perhaps certs + should get their own top-level ids, they already have hashes in the + db... then we could have commands to list certs, dump info on a + given cert, get a packet for a given cert, etc.) * merkle dir stuff that doesn't require loading entire chunks into memory all the time * pipelining on http read? (is urlgrabber thread-safe?) @@ -35,3 +39,11 @@ to a private method) - include some info in the lockdir on who has things locked, to aid in detecting staleness of locks +* HTTP write support using a server-side CGI (CGI, PHP, whatever + people want support for + +* automate merkle_hash + could do many of the same tricks as this code, but eliminate the + unsightly local fs repo, and make it easier for remote sides to use + unusual representations (e.g., viewmtn could bake support in, + backed against its real monotone db)... (more speculative) ======================================================================== --- dumb.py d10d1c98a57ed51b38b7649cd09c583de05ec2c4 +++ dumb.py 6d79025eea4e9a9576e61e3ccad42b318bfe5e47 @@ -23,6 +23,13 @@ md = MerkleDir(writeable_fs_for_url(url)) try: md.begin() + keys = monotone.keys() + for k in keys: + kp = monotone.get_pubkey_packet(k) + id = sha.new(kp).hexdigest() + if id not in curr_ids: + data = zlib.compress(kp) + md.add(id, data) curr_ids = Set(md.all_ids()) for rid in monotone.toposort(monotone.revisions_list()): certs = monotone.get_cert_packets(rid) ======================================================================== --- monotone.py 4049bb72eee1adb79206f2c27432dc1009ea5e57 +++ monotone.py e2376d24295fd1877b22b231c6161b89d90fbfe8 @@ -61,6 +61,9 @@ def get_revision(self, rid): return self.run_monotone(["cat", "revision", rid]) + def get_pubkey_packet(self, keyid): + return self.run_monotone(["pubkey"], keyid) + def get_revision_packet(self, rid): return self.run_monotone(["rdata", rid]) @@ -88,6 +91,17 @@ assert not curr_packet return packets + def key_names(self): + output = self.run_monotone(["ls", "keys"]) + lines = output.split("\n") + ids = {} + for l in lines: + if not l.strip() or l.strip() in ("[public keys]", "[private keys]"): + continue + fpr, keyid = l.strip().split() + ids[keyid] = None + return ids.keys() + # returns output as a string, raises an error on error def run_monotone(self, args, input=None): process = subprocess.Popen([self.executable, "--db", self.db] + args,