# HG changeset patch # User Yuya Nishihara # Date 1498436335 -32400 # Node ID 9e0d222f5687e58b138fa9cf441313c9b63afc57 # Parent 65cadeea6c22bfe9c42029626cd675982b3dd339 identify: change p1/p2 to a list of parents It makes sense because the nested data structure is a list of items. diff -r 65cadeea6c22 -r 9e0d222f5687 mercurial/commands.py --- a/mercurial/commands.py Sun Jun 25 13:31:56 2017 -0700 +++ b/mercurial/commands.py Mon Jun 26 09:18:55 2017 +0900 @@ -2790,12 +2790,12 @@ 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 -r 65cadeea6c22 -r 9e0d222f5687 tests/test-identify.t --- a/tests/test-identify.t Sun Jun 25 13:31:56 2017 -0700 +++ b/tests/test-identify.t Mon Jun 26 09:18:55 2017 +0900 @@ -51,7 +51,7 @@ "dirty": "", "id": "cb9a9f314b8b", "node": "ffffffffffffffffffffffffffffffffffffffff", - "p1": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}], + "parents": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}], "tags": ["tip"] } ] @@ -69,7 +69,7 @@ "dirty": "+", "id": "cb9a9f314b8b+", "node": "ffffffffffffffffffffffffffffffffffffffff", - "p1": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}], + "parents": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}], "tags": ["tip"] } ] diff -r 65cadeea6c22 -r 9e0d222f5687 tests/test-merge-default.t --- a/tests/test-merge-default.t Sun Jun 25 13:31:56 2017 -0700 +++ b/tests/test-merge-default.t Mon Jun 26 09:18:55 2017 +0900 @@ -57,8 +57,7 @@ "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"] } ]