##// END OF EJS Templates
index: use `index.has_node` in `phabricator.getoldnodedrevmap`...
marmoute -
r43949:4cb3f5bb default
parent child Browse files
Show More
@@ -389,7 +389,7 b' def getoldnodedrevmap(repo, nodelist):'
389 corresponding Differential Revision, and exist in the repo.
389 corresponding Differential Revision, and exist in the repo.
390 """
390 """
391 unfi = repo.unfiltered()
391 unfi = repo.unfiltered()
392 nodemap = unfi.changelog.nodemap
392 has_node = unfi.changelog.index.has_node
393
393
394 result = {} # {node: (oldnode?, lastdiff?, drev)}
394 result = {} # {node: (oldnode?, lastdiff?, drev)}
395 toconfirm = {} # {node: (force, {precnode}, drev)}
395 toconfirm = {} # {node: (force, {precnode}, drev)}
@@ -398,7 +398,7 b' def getoldnodedrevmap(repo, nodelist):'
398 # For tags like "D123", put them into "toconfirm" to verify later
398 # For tags like "D123", put them into "toconfirm" to verify later
399 precnodes = list(obsutil.allpredecessors(unfi.obsstore, [node]))
399 precnodes = list(obsutil.allpredecessors(unfi.obsstore, [node]))
400 for n in precnodes:
400 for n in precnodes:
401 if n in nodemap:
401 if has_node(n):
402 for tag in unfi.nodetags(n):
402 for tag in unfi.nodetags(n):
403 m = _differentialrevisiontagre.match(tag)
403 m = _differentialrevisiontagre.match(tag)
404 if m:
404 if m:
@@ -454,7 +454,7 b' def getoldnodedrevmap(repo, nodelist):'
454 if diffs:
454 if diffs:
455 lastdiff = max(diffs, key=lambda d: int(d[b'id']))
455 lastdiff = max(diffs, key=lambda d: int(d[b'id']))
456 oldnode = getnode(lastdiff)
456 oldnode = getnode(lastdiff)
457 if oldnode and oldnode not in nodemap:
457 if oldnode and not has_node(oldnode):
458 oldnode = None
458 oldnode = None
459
459
460 result[newnode] = (oldnode, lastdiff, drev)
460 result[newnode] = (oldnode, lastdiff, drev)
General Comments 0
You need to be logged in to leave comments. Login now