Patchwork [5,of,5] log: make changesetformatter pass in changectx to formatter

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 15, 2018, 1:54 a.m.
Message ID <fe0538ea99c0e1127a78.1536976449@mimosa>
Download mbox | patch
Permalink /patch/34666/
State New
Headers show

Comments

Yuya Nishihara - Sept. 15, 2018, 1:54 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1535976107 -32400
#      Mon Sep 03 21:01:47 2018 +0900
# Node ID fe0538ea99c0e1127a78243ec8ad9d74584fa5da
# Parent  4a7c11cb2443577c7571daf93430d7e08599009c
log: make changesetformatter pass in changectx to formatter

It wasn't necessary before, but user templates may have keywords that aren't
filled in by the changesetformatter.

Patch

diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -326,6 +326,7 @@  class changesetformatter(changesetprinte
         fm = self._fm
         fm.startitem()
 
+        fm.context(ctx=ctx)
         # TODO: maybe this should be wdirrev/wdirnode?
         rev = ctx.rev()
         if rev is None:
diff --git a/tests/test-journal.t b/tests/test-journal.t
--- a/tests/test-journal.t
+++ b/tests/test-journal.t
@@ -279,13 +279,13 @@  Test that verbose, JSON, template and co
    children: 
   command: up 0
    rev: 0
-   children: 
+   children: 1:1e6c11564562
   command: commit -Aqm b
    rev: 1
    children: 
   command: commit -Aqm a
    rev: 0
-   children: 
+   children: 1:1e6c11564562
 
 Test for behaviour on unexpected storage version information