diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
index 6b4c789d618d5a9682730461ba07f370502ced09_bWVyY3VyaWFsL2NtZHV0aWwucHk=..78f4c2b7052f1053c07c8b63143bc7fb1c9de8d8_bWVyY3VyaWFsL2NtZHV0aWwucHk= 100644
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -974,6 +974,19 @@
         t.use_template(tmpl)
     return t
 
+def showmarker(ui, marker):
+    """utility function to display obsolescence marker in a readable way
+
+    To be used by debug function."""
+    ui.write(hex(marker.precnode()))
+    for repl in marker.succnodes():
+        ui.write(' ')
+        ui.write(hex(repl))
+    ui.write(' %X ' % marker._data[2])
+    ui.write('{%s}' % (', '.join('%r: %r' % t for t in
+                                 sorted(marker.metadata().items()))))
+    ui.write('\n')
+
 def finddate(ui, repo, date):
     """Find the tipmost changeset that matches the given date spec"""
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
index 6b4c789d618d5a9682730461ba07f370502ced09_bWVyY3VyaWFsL2NvbW1hbmRzLnB5..78f4c2b7052f1053c07c8b63143bc7fb1c9de8d8_bWVyY3VyaWFsL2NvbW1hbmRzLnB5 100644
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2227,14 +2227,7 @@
             l.release()
     else:
         for m in obsolete.allmarkers(repo):
-            ui.write(hex(m.precnode()))
-            for repl in m.succnodes():
-                ui.write(' ')
-                ui.write(hex(repl))
-            ui.write(' %X ' % m._data[2])
-            ui.write('{%s}' % (', '.join('%r: %r' % t for t in
-                                         sorted(m.metadata().items()))))
-            ui.write('\n')
+            cmdutil.showmarker(ui, m)
 
 @command('debugpathcomplete',
          [('f', 'full', None, _('complete an entire path')),