comparison mercurial/cmdutil.py @ 24584:5a40b5d45396

changeset_printer: display p1rev:p1node with "+" suffix for workingctx Still templater can't handle workingctx, which will be fixed later.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 14 Mar 2015 20:01:30 +0900
parents 6117a29e9e76
children e191d5d8d515
comparison
equal deleted inserted replaced
24583:6117a29e9e76 24584:5a40b5d45396
1099 1099
1100 def _show(self, ctx, copies, matchfn, props): 1100 def _show(self, ctx, copies, matchfn, props):
1101 '''show a single changeset or file revision''' 1101 '''show a single changeset or file revision'''
1102 changenode = ctx.node() 1102 changenode = ctx.node()
1103 rev = ctx.rev() 1103 rev = ctx.rev()
1104
1105 if self.ui.quiet:
1106 self.ui.write("%d:%s\n" % (rev, short(changenode)),
1107 label='log.node')
1108 return
1109
1110 date = util.datestr(ctx.date())
1111
1112 if self.ui.debugflag: 1104 if self.ui.debugflag:
1113 hexfunc = hex 1105 hexfunc = hex
1114 else: 1106 else:
1115 hexfunc = short 1107 hexfunc = short
1108 if rev is None:
1109 pctx = ctx.p1()
1110 revnode = (pctx.rev(), hexfunc(pctx.node()) + '+')
1111 else:
1112 revnode = (rev, hexfunc(changenode))
1113
1114 if self.ui.quiet:
1115 self.ui.write("%d:%s\n" % revnode, label='log.node')
1116 return
1117
1118 date = util.datestr(ctx.date())
1116 1119
1117 # i18n: column positioning for "hg log" 1120 # i18n: column positioning for "hg log"
1118 self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode)), 1121 self.ui.write(_("changeset: %d:%s\n") % revnode,
1119 label='log.changeset changeset.%s' % ctx.phasestr()) 1122 label='log.changeset changeset.%s' % ctx.phasestr())
1120 1123
1121 # branches are shown first before any other names due to backwards 1124 # branches are shown first before any other names due to backwards
1122 # compatibility 1125 # compatibility
1123 branch = ctx.branch() 1126 branch = ctx.branch()