Patchwork [1,of,2] log: remove temporary variable 'date' used only once

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 2, 2017, 8:38 a.m.
Message ID <4993ee3a629b9b5699b9.1512203910@mimosa>
Download mbox | patch
Permalink /patch/25896/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 2, 2017, 8:38 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1512198504 -32400
#      Sat Dec 02 16:08:24 2017 +0900
# Node ID 4993ee3a629b9b5699b9cf15626827be07b00c90
# Parent  bfd072c52e03cc14bd2b36bd982c15b5029e6fa8
log: remove temporary variable 'date' used only once

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1610,8 +1610,6 @@  class changeset_printer(object):
                           label='log.node')
             return
 
-        date = util.datestr(ctx.date())
-
         # i18n: column positioning for "hg log"
         self.ui.write(_("changeset:   %s\n") % scmutil.formatchangeid(ctx),
                       label=_changesetlabels(ctx))
@@ -1656,7 +1654,7 @@  class changeset_printer(object):
         self.ui.write(_("user:        %s\n") % ctx.user(),
                       label='log.user')
         # i18n: column positioning for "hg log"
-        self.ui.write(_("date:        %s\n") % date,
+        self.ui.write(_("date:        %s\n") % util.datestr(ctx.date()),
                       label='log.date')
 
         if ctx.isunstable():