# # # patch "monotone.py" # from [d34c00e9a685ad5a55df329c45fdee9fb8b7043e] # to [6ba9552e8b9b5873610764ab31a4a2eb9cbeee8a] # ============================================================ --- monotone.py d34c00e9a685ad5a55df329c45fdee9fb8b7043e +++ monotone.py 6ba9552e8b9b5873610764ab31a4a2eb9cbeee8a @@ -113,7 +113,8 @@ def ancestry(self, id, limit=0): rv = [] entry = None - for line in utility.iter_command(self.base_command + " log %s" % (pipes.quote(id))): + iterator = utility.iter_command(self.base_command + " log %s" % (pipes.quote(id))) + for line in iterator: if dash_re.match(line): entry = {} if entry == None: continue @@ -127,6 +128,8 @@ attr, value = m.groups() if not entry.has_key(attr): entry[attr] = [] entry[attr].append(value) + # clean up; otherwise we'll leak filehandlers + map(None, iterator) if entry: rv.append(entry) return rv def ancestry_graph(self, graphdir, graphuri, id, limit=0):