Patchwork [8,of,9,RFC] cmdutil: use repo.markers instead of accessing tags and bookmarks directly

login
register
mail settings
Submitter Sean Farley
Date March 30, 2014, 11:09 p.m.
Message ID <04fe1b7587eaaab6615c.1396220946@laptop.local>
Download mbox | patch
Permalink /patch/4155/
State Deferred
Headers show

Comments

Sean Farley - March 30, 2014, 11:09 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1396220329 18000
#      Sun Mar 30 17:58:49 2014 -0500
# Node ID 04fe1b7587eaaab6615cb9041fb2e4a97736eb80
# Parent  c70e4216df9d4d9a41b54dfb88e000b377c73825
cmdutil: use repo.markers instead of accessing tags and bookmarks directly

We can now use the first benefit of repo.markers by placing them automatically
in the log output.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -833,18 +833,14 @@  class changeset_printer(object):
         # don't show the default branch name
         if branch != 'default':
             # i18n: column positioning for "hg log"
             self.ui.write(_("branch:      %s\n") % branch,
                           label='log.branch')
-        for bookmark in self.repo.nodebookmarks(changenode):
+        for name, mtype in self.repo.nodemarkers(changenode):
             # i18n: column positioning for "hg log"
-            self.ui.write(_("bookmark:    %s\n") % bookmark,
-                    label='log.bookmark')
-        for tag in self.repo.nodetags(changenode):
-            # i18n: column positioning for "hg log"
-            self.ui.write(_("tag:         %s\n") % tag,
-                          label='log.tag')
+            self.ui.write(_(("%s:" % mtype).ljust(13) + "%s\n") % name,
+                          label='log.%s' % mtype)
         if self.ui.debugflag and ctx.phase():
             # i18n: column positioning for "hg log"
             self.ui.write(_("phase:       %s\n") % _(ctx.phasestr()),
                           label='log.phase')
         for parent in parents: