[PATCH 1 of 8] obsmarker: add a `flags` method

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Aug 16 00:33:23 UTC 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1408120890 25200
#      Fri Aug 15 09:41:30 2014 -0700
# Node ID 23c889905c6298cab09eba54e65faa7c1c015da7
# Parent  8dda6f6ff564d8fe6ac7b8ce4c74eb9bfb5de14a
obsmarker: add a `flags` method

We introduce a proper method to access the flag information.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1182,11 +1182,11 @@ def showmarker(ui, marker):
     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(' %X ' % marker.flags())
     ui.write('{%s}' % (', '.join('%r: %r' % t for t in
                                  sorted(marker.metadata().items()))))
     ui.write('\n')
 
 def finddate(ui, repo, date):
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -224,10 +224,14 @@ class marker(object):
     def date(self):
         """Creation date as (unixtime, offset)"""
         parts = self.metadata()['date'].split(' ')
         return (float(parts[0]), int(parts[1]))
 
+    def flags(self):
+        """The flags field of the marker"""
+        return self._data[2]
+
 class obsstore(object):
     """Store obsolete markers
 
     Markers can be accessed with two mappings:
     - precursors[x] -> set(markers on precursors edges of x)


More information about the Mercurial-devel mailing list