Patchwork [7,of,8] obsstore: add fields attribute to track each field in a markers

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 16, 2014, 12:33 a.m.
Message ID <79d3a254de51f80fc328.1408149209@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5441/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 16, 2014, 12:33 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1407833378 25200
#      Tue Aug 12 01:49:38 2014 -0700
# Node ID 79d3a254de51f80fc32888db2465cf38350a4773
# Parent  cffffb97678df7fb8530353a1c26879260c8705a
obsstore: add fields attribute to track each field in a markers

We are going to increase the amount of data explicitly stored in obsolescence
marker. This mean we are going to have a longer tuple and some value will be
shuffled around. So we add a ``fields`` attributes to the obsstore class to
keep track of what entry is what. This will be useful for extensions and for
documentation purpose.

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -236,10 +236,12 @@  class obsstore(object):
     Markers can be accessed with two mappings:
     - precursors[x] -> set(markers on precursors edges of x)
     - successors[x] -> set(markers on successors edges of x)
     """
 
+    fields = ('prec', 'succs', 'flag', 'meta')
+
     def __init__(self, sopener):
         # caches for various obsolescence related cache
         self.caches = {}
         self._all = []
         # new markers to serialize