diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2790,12 +2790,12 @@ def identify(ui, repo, source=None, rev= numoutput = ["%d" % p.rev() for p in parents] output.append("%s%s" % ('+'.join(numoutput), dirty)) - for i, p in enumerate(parents): - fn = fm.nested('p%d' % (i + 1)) + fn = fm.nested('parents') + for p in parents: fn.startitem() fn.data(rev=p.rev()) fn.data(node=p.hex()) - fn.end() + fn.end() else: hexoutput = hexfunc(ctx.node()) if default or id: diff --git a/tests/test-identify.t b/tests/test-identify.t --- a/tests/test-identify.t +++ b/tests/test-identify.t @@ -51,7 +51,7 @@ with options "dirty": "", "id": "cb9a9f314b8b", "node": "ffffffffffffffffffffffffffffffffffffffff", - "p1": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}], + "parents": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}], "tags": ["tip"] } ] @@ -69,7 +69,7 @@ with modifications "dirty": "+", "id": "cb9a9f314b8b+", "node": "ffffffffffffffffffffffffffffffffffffffff", - "p1": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}], + "parents": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}], "tags": ["tip"] } ] diff --git a/tests/test-merge-default.t b/tests/test-merge-default.t --- a/tests/test-merge-default.t +++ b/tests/test-merge-default.t @@ -57,8 +57,7 @@ Should succeed: "dirty": "+", "id": "f25cbe84d8b3+2d95304fed5d+", "node": "ffffffffffffffffffffffffffffffffffffffff", - "p1": [{"node": "f25cbe84d8b320e298e7703f18a25a3959518c23", "rev": 4}], - "p2": [{"node": "2d95304fed5d89bc9d70b2a0d02f0d567469c3ab", "rev": 2}], + "parents": [{"node": "f25cbe84d8b320e298e7703f18a25a3959518c23", "rev": 4}, {"node": "2d95304fed5d89bc9d70b2a0d02f0d567469c3ab", "rev": 2}], "tags": ["tip"] } ]