# # # patch "dumb.py" # from [781d35dd27b66de1342486de8d7285ea83c98164] # to [e2f12d5e15754254c4652a0716f1829734d6171d] # # patch "monotone.py" # from [8a5547f21ac78068a4e5a96cacad008117244702] # to [399e9ac377f3d05c6cae73349ea3097d0af619d5] # ============================================================ --- dumb.py 781d35dd27b66de1342486de8d7285ea83c98164 +++ dumb.py e2f12d5e15754254c4652a0716f1829734d6171d @@ -14,7 +14,7 @@ from fs import readable_fs_for_url, writ from cStringIO import StringIO from merkle_dir import MerkleDir, MemoryMerkleDir, LockError from fs import readable_fs_for_url, writeable_fs_for_url -from monotone import Monotone +from monotone import Monotone, find_stanza_entry class partial: def __init__(self, fn, *args): @@ -105,14 +105,16 @@ class Dumbtone: curr_ids = Set(md.all_ids()) keys = self.monotone.keys() for stanza in keys: - keyid = stanza[0][1][0] - publicHash = stanza[1][1][0] + keyid = find_stanza_entry(stanza, "name")[0] + publicHash = find_stanza_entry(stanza, "public_hash")[0] + publicLocations = find_stanza_entry(stanza, "public_location") kp = partial(self.monotone.get_pubkey_packet,keyid) - ids = "\n".join((keyid,publicHash)) - id = sha.new(ids).hexdigest() - if id not in curr_ids: - md.add(id, kp) - if callback: callback(id, "", None) + if "database" in publicLocations: + ids = "\n".join((keyid,publicHash)) + id = sha.new(ids).hexdigest() + if id not in curr_ids: + md.add(id, kp) + if callback: callback(id, "", None) for rid in self.monotone.toposort(self.monotone.revisions_list()): if rid not in curr_ids: md.add(rid, partial(self.__make_revision_packet,rid)) ============================================================ --- monotone.py 8a5547f21ac78068a4e5a96cacad008117244702 +++ monotone.py 399e9ac377f3d05c6cae73349ea3097d0af619d5 @@ -34,7 +34,7 @@ class Feeder: self.process = subprocess.Popen(self.args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + stderr=None) self.process.stdin.write(data) if self.verbosity>1: # processing every single call with a new process @@ -265,3 +265,9 @@ def basic_io_parser(data): def basic_io_parser(data): return Monotone(None,None).basic_io_parser(data) + +def find_stanza_entry(stanza, name): + for entry in stanza: + if entry[0] == name: + return entry[1] + raise Exception("entry '%s' not found in stanza" % name)