# HG changeset patch # User Patrick Mezard # Date 1215261336 -7200 # Node ID cc7114d96548d7a9ecaef82cea32ac7ef8db0a62 # Parent 12d1e1e79faf389cc76d7031b0dc70c7ed0cc369 hgk: ctx.parents() problem introduced by 2d54e7c1e69d diff -r 12d1e1e79faf -r cc7114d96548 hgext/hgk.py --- a/hgext/hgk.py Sat Jul 05 14:35:34 2008 +0200 +++ b/hgext/hgk.py Sat Jul 05 14:35:36 2008 +0200 @@ -102,10 +102,9 @@ nlprefix = '\n' + prefix; if ctx is None: ctx = repo[n] - (p1, p2) = ctx.parents() ui.write("tree %s\n" % short(ctx.changeset()[0])) # use ctx.node() instead ?? - if p1: ui.write("parent %s\n" % short(p1.node())) - if p2: ui.write("parent %s\n" % short(p2.node())) + for p in ctx.parents(): + ui.write("parent %s\n" % short(p.node())) date = ctx.date() description = ctx.description().replace("\0", "") lines = description.splitlines() diff -r 12d1e1e79faf -r cc7114d96548 tests/test-hgk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hgk Sat Jul 05 14:35:36 2008 +0200 @@ -0,0 +1,11 @@ +#!/bin/sh + +echo "[extensions]" >> $HGRCPATH +echo "hgk=" >> $HGRCPATH + +hg init repo +cd repo +echo a > a +hg ci -Am adda +hg debug-cat-file commit 0 + diff -r 12d1e1e79faf -r cc7114d96548 tests/test-hgk.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hgk.out Sat Jul 05 14:35:36 2008 +0200 @@ -0,0 +1,9 @@ +adding a +tree a0c8bcbbb45c +parent 000000000000 +author test 0 0 +committer test 0 0 +revision 0 +branch default + +adda