contrib/phabricator.py
changeset 33271 02299a28ba34
parent 33269 ead6749354e1
child 33441 de7c6ec27d99
equal deleted inserted replaced
33270:f7b635716ef2 33271:02299a28ba34
   379             prefetched[int(drev[r'id'])] = drev
   379             prefetched[int(drev[r'id'])] = drev
   380         if key not in prefetched:
   380         if key not in prefetched:
   381             raise error.Abort(_('cannot get Differential Revision %r') % params)
   381             raise error.Abort(_('cannot get Differential Revision %r') % params)
   382         return prefetched[key]
   382         return prefetched[key]
   383 
   383 
       
   384     visited = set()
   384     result = []
   385     result = []
   385     queue = [params]
   386     queue = [params]
   386     while queue:
   387     while queue:
   387         params = queue.pop()
   388         params = queue.pop()
   388         drev = fetch(params)
   389         drev = fetch(params)
       
   390         if drev[r'id'] in visited:
       
   391             continue
       
   392         visited.add(drev[r'id'])
   389         result.append(drev)
   393         result.append(drev)
   390         if stack:
   394         if stack:
   391             auxiliary = drev.get(r'auxiliary', {})
   395             auxiliary = drev.get(r'auxiliary', {})
   392             depends = auxiliary.get(r'phabricator:depends-on', [])
   396             depends = auxiliary.get(r'phabricator:depends-on', [])
   393             for phid in depends:
   397             for phid in depends: