hgext3rd/evolve/obshistory.py
changeset 4953 5c41bb482867
parent 4952 b135591bec1a
child 4983 6d40e0166522
equal deleted inserted replaced
4952:b135591bec1a 4953:5c41bb482867
   159 TEMPLATE_USER = b"""by {label("evolve.user", user)}"""
   159 TEMPLATE_USER = b"""by {label("evolve.user", user)}"""
   160 TEMPLATE_DATE = b"""{label("evolve.date", "({date(date, "%a %b %d %H:%M:%S %Y %1%2")})")}"""
   160 TEMPLATE_DATE = b"""{label("evolve.date", "({date(date, "%a %b %d %H:%M:%S %Y %1%2")})")}"""
   161 TEMPLATE_NOTE = b"""{if(note, "\n    note: {label("evolve.note", note)}")}"""
   161 TEMPLATE_NOTE = b"""{if(note, "\n    note: {label("evolve.note", note)}")}"""
   162 TEMPLATE_PATCH = b"""{if(patch, "{patch}")}{if(nopatchreason, "\n(No patch available, {nopatchreason})")}"""
   162 TEMPLATE_PATCH = b"""{if(patch, "{patch}")}{if(nopatchreason, "\n(No patch available, {nopatchreason})")}"""
   163 DEFAULT_TEMPLATE = (b"""%(firstline)s
   163 DEFAULT_TEMPLATE = (b"""%(firstline)s
   164 {markers %% "  {separate(" ", "%(rewrite)s", "%(operation)s", "%(user)s", "%(date)s")}%(note)s{descdiff}{indent("%(patch)s", "    ")}\n"}
   164 {markers %% "  {separate(" ", "%(rewrite)s", "%(operation)s", "%(user)s", "%(date)s")}%(note)s{indent(descdiff, "    ")}{indent("%(patch)s", "    ")}\n"}
   165 """) % {
   165 """) % {
   166     b"firstline": TEMPLATE_FIRST_LINE,
   166     b"firstline": TEMPLATE_FIRST_LINE,
   167     b"rewrite": TEMPLATE_REWRITE,
   167     b"rewrite": TEMPLATE_REWRITE,
   168     b"operation": TEMPLATE_OPERATION,
   168     b"operation": TEMPLATE_OPERATION,
   169     b"user": TEMPLATE_USER,
   169     b"user": TEMPLATE_USER,
   621                 ui.pushbuffer(labeled=True)
   621                 ui.pushbuffer(labeled=True)
   622                 ui.write(b"\n")
   622                 ui.write(b"\n")
   623 
   623 
   624                 for chunk, label in patch.difflabel(tolist, descriptionpatch):
   624                 for chunk, label in patch.difflabel(tolist, descriptionpatch):
   625                     chunk = chunk.strip(b'\t')
   625                     chunk = chunk.strip(b'\t')
   626                     if chunk and chunk != b'\n':
       
   627                         ui.write(b'    ')
       
   628                     ui.write(chunk, label=label)
   626                     ui.write(chunk, label=label)
   629                 fm.write(b'descdiff', b'%s', ui.popbuffer())
   627                 fm.write(b'descdiff', b'%s', ui.popbuffer())
   630 
   628 
   631             # Content patch
   629             # Content patch
   632             ui.pushbuffer(labeled=True)
   630             ui.pushbuffer(labeled=True)