##// END OF EJS Templates
summary: make use of output labeling...
Eric Eisner -
r10832:420bc812 default
parent child Browse files
Show More
@@ -3079,29 +3079,42 b' def summary(ui, repo, **opts):'
3079
3079
3080 for p in parents:
3080 for p in parents:
3081 t = ' '.join([t for t in tags if tags[t] == p.node()])
3081 t = ' '.join([t for t in tags if tags[t] == p.node()])
3082 message = ''
3082 if p.rev() == -1:
3083 if p.rev() == -1:
3083 if not len(repo):
3084 if not len(repo):
3084 t += _(' (empty repository)')
3085 message = _(' (empty repository)')
3085 else:
3086 else:
3086 t += _(' (no revision checked out)')
3087 message = _(' (no revision checked out)')
3087 ui.write(_('parent: %d:%s %s\n') % (p.rev(), str(p), t))
3088 # label with log.changeset (instead of log.parent) since this
3089 # shows a working directory parent *changeset*:
3090 ui.write(_('parent: %d:%s ') % (p.rev(), str(p)),
3091 label='log.changeset')
3092 ui.write(t, label='log.tag')
3093 if message:
3094 ui.write(message)
3095 ui.write('\n')
3088 if p.description():
3096 if p.description():
3089 ui.status(' ' + p.description().splitlines()[0].strip() + '\n')
3097 ui.status(' ' + p.description().splitlines()[0].strip() + '\n',
3098 label='log.summary')
3090
3099
3091 branch = ctx.branch()
3100 branch = ctx.branch()
3092 bheads = repo.branchheads(branch)
3101 bheads = repo.branchheads(branch)
3093 m = _('branch: %s\n') % branch
3102 m = _('branch: %s\n') % branch
3094 if branch != 'default':
3103 if branch != 'default':
3095 ui.write(m)
3104 ui.write(m, label='log.branch')
3096 else:
3105 else:
3097 ui.status(m)
3106 ui.status(m, label='log.branch')
3098
3107
3099 st = list(repo.status(unknown=True))[:6]
3108 st = list(repo.status(unknown=True))[:6]
3100 ms = mergemod.mergestate(repo)
3109 ms = mergemod.mergestate(repo)
3101 st.append([f for f in ms if ms[f] == 'u'])
3110 st.append([f for f in ms if ms[f] == 'u'])
3102 labels = [_('%d modified'), _('%d added'), _('%d removed'),
3111 labels = [ui.label(_('%d modified'), 'status.modified'),
3103 _('%d deleted'), _('%d unknown'), _('%d ignored'),
3112 ui.label(_('%d added'), 'status.added'),
3104 _('%d unresolved')]
3113 ui.label(_('%d removed'), 'status.removed'),
3114 ui.label(_('%d deleted'), 'status.deleted'),
3115 ui.label(_('%d unknown'), 'status.unknown'),
3116 ui.label(_('%d ignored'), 'status.ignored'),
3117 ui.label(_('%d unresolved'), 'resolve.unresolved')]
3105 t = []
3118 t = []
3106 for s, l in zip(st, labels):
3119 for s, l in zip(st, labels):
3107 if s:
3120 if s:
General Comments 0
You need to be logged in to leave comments. Login now