Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/phabricator.py (6 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
9a6245f916a0 | a3d523786776 | Pierre-Yves David | Nov 8 2019, 7:26 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute |
If such commit message line is not found, examines all precursors and their | If such commit message line is not found, examines all precursors and their | ||||
tags. Tags with format like "D1234" are considered a match and the node | tags. Tags with format like "D1234" are considered a match and the node | ||||
with that tag, and the number after "D" (ex. 1234) will be returned. | with that tag, and the number after "D" (ex. 1234) will be returned. | ||||
The ``old node``, if not None, is guaranteed to be the last diff of | The ``old node``, if not None, is guaranteed to be the last diff of | ||||
corresponding Differential Revision, and exist in the repo. | corresponding Differential Revision, and exist in the repo. | ||||
""" | """ | ||||
unfi = repo.unfiltered() | unfi = repo.unfiltered() | ||||
nodemap = unfi.changelog.nodemap | has_node = unfi.changelog.index.has_node | ||||
result = {} # {node: (oldnode?, lastdiff?, drev)} | result = {} # {node: (oldnode?, lastdiff?, drev)} | ||||
toconfirm = {} # {node: (force, {precnode}, drev)} | toconfirm = {} # {node: (force, {precnode}, drev)} | ||||
for node in nodelist: | for node in nodelist: | ||||
ctx = unfi[node] | ctx = unfi[node] | ||||
# For tags like "D123", put them into "toconfirm" to verify later | # For tags like "D123", put them into "toconfirm" to verify later | ||||
precnodes = list(obsutil.allpredecessors(unfi.obsstore, [node])) | precnodes = list(obsutil.allpredecessors(unfi.obsstore, [node])) | ||||
for n in precnodes: | for n in precnodes: | ||||
if n in nodemap: | if has_node(n): | ||||
for tag in unfi.nodetags(n): | for tag in unfi.nodetags(n): | ||||
m = _differentialrevisiontagre.match(tag) | m = _differentialrevisiontagre.match(tag) | ||||
if m: | if m: | ||||
toconfirm[node] = (0, set(precnodes), int(m.group(1))) | toconfirm[node] = (0, set(precnodes), int(m.group(1))) | ||||
continue | continue | ||||
# Check commit message | # Check commit message | ||||
m = _differentialrevisiondescre.search(ctx.description()) | m = _differentialrevisiondescre.search(ctx.description()) | ||||
continue | continue | ||||
# Find the last node using Phabricator metadata, and make sure it | # Find the last node using Phabricator metadata, and make sure it | ||||
# exists in the repo | # exists in the repo | ||||
oldnode = lastdiff = None | oldnode = lastdiff = None | ||||
if diffs: | if diffs: | ||||
lastdiff = max(diffs, key=lambda d: int(d[b'id'])) | lastdiff = max(diffs, key=lambda d: int(d[b'id'])) | ||||
oldnode = getnode(lastdiff) | oldnode = getnode(lastdiff) | ||||
if oldnode and oldnode not in nodemap: | if oldnode and not has_node(oldnode): | ||||
oldnode = None | oldnode = None | ||||
result[newnode] = (oldnode, lastdiff, drev) | result[newnode] = (oldnode, lastdiff, drev) | ||||
return result | return result | ||||
def getdiff(ctx, diffopts): | def getdiff(ctx, diffopts): |