Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 24483:870d2eb82f6d
changeset_printer: use context objects consistently to show parents
This prepares for merging changeset_printer._maningful_parentrevs() with
changeset_templater's.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 14 Mar 2015 17:19:04 +0900 |
parents | 3df7fc75afc5 |
children | ca62ae364b86 |
comparison
equal
deleted
inserted
replaced
24482:3eb9045396b0 | 24483:870d2eb82f6d |
---|---|
1113 if self.ui.debugflag: | 1113 if self.ui.debugflag: |
1114 hexfunc = hex | 1114 hexfunc = hex |
1115 else: | 1115 else: |
1116 hexfunc = short | 1116 hexfunc = short |
1117 | 1117 |
1118 parents = [(p, hexfunc(log.node(p))) | 1118 parents = [self.repo[p] |
1119 for p in self._meaningful_parentrevs(log, rev)] | 1119 for p in self._meaningful_parentrevs(log, rev)] |
1120 | 1120 |
1121 # i18n: column positioning for "hg log" | 1121 # i18n: column positioning for "hg log" |
1122 self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode)), | 1122 self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode)), |
1123 label='log.changeset changeset.%s' % ctx.phasestr()) | 1123 label='log.changeset changeset.%s' % ctx.phasestr()) |
1143 label='log.%s' % ns.colorname) | 1143 label='log.%s' % ns.colorname) |
1144 if self.ui.debugflag: | 1144 if self.ui.debugflag: |
1145 # i18n: column positioning for "hg log" | 1145 # i18n: column positioning for "hg log" |
1146 self.ui.write(_("phase: %s\n") % _(ctx.phasestr()), | 1146 self.ui.write(_("phase: %s\n") % _(ctx.phasestr()), |
1147 label='log.phase') | 1147 label='log.phase') |
1148 for parent in parents: | 1148 for pctx in parents: |
1149 label = 'log.parent changeset.%s' % self.repo[parent[0]].phasestr() | 1149 label = 'log.parent changeset.%s' % pctx.phasestr() |
1150 # i18n: column positioning for "hg log" | 1150 # i18n: column positioning for "hg log" |
1151 self.ui.write(_("parent: %d:%s\n") % parent, | 1151 self.ui.write(_("parent: %d:%s\n") |
1152 % (pctx.rev(), hexfunc(pctx.node())), | |
1152 label=label) | 1153 label=label) |
1153 | 1154 |
1154 if self.ui.debugflag: | 1155 if self.ui.debugflag: |
1155 mnode = ctx.manifestnode() | 1156 mnode = ctx.manifestnode() |
1156 # i18n: column positioning for "hg log" | 1157 # i18n: column positioning for "hg log" |