Patchwork [1,of,9,RFC] localrepo: add an unused dictionary for arbitrary markers

login
register
mail settings
Submitter Sean Farley
Date March 30, 2014, 11:08 p.m.
Message ID <bd7ad5e093455aefd73e.1396220939@laptop.local>
Download mbox | patch
Permalink /patch/4148/
State Deferred
Headers show

Comments

Sean Farley - March 30, 2014, 11:08 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1396216512 18000
#      Sun Mar 30 16:55:12 2014 -0500
# Node ID bd7ad5e093455aefd73e1c66ad1ea260eb3051a3
# Parent  8a6a86c9a5b58ccc020de1ff0429e72dfa5599fc
localrepo: add an unused dictionary for arbitrary markers
Sean Farley - April 1, 2014, 3:01 a.m.
Sean Farley <sean.michael.farley@gmail.com> writes:

> # HG changeset patch
> # User Sean Farley <sean.michael.farley@gmail.com>
> # Date 1396216512 18000
> #      Sun Mar 30 16:55:12 2014 -0500
> # Node ID bd7ad5e093455aefd73e1c66ad1ea260eb3051a3
> # Parent  8a6a86c9a5b58ccc020de1ff0429e72dfa5599fc
> localrepo: add an unused dictionary for arbitrary markers
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -269,10 +269,13 @@ class localrepository(object):
>          # - new obsolescence marker,
>          # - working directory parent change,
>          # - bookmark changes
>          self.filteredrevcache = {}
>  
> +        # dictionary of arbitrary markers, e.g. _markers["foo"]["bar] = node
> +        self._markers = {}
> +

These definitely can't be called 'markers' because of the clash with the
name 'obsolete markers' so I'll need some suggestions here. The word
'label' is perfect here and even has precedence from Bryan O'Sullivan in
the debuglabelcomplete function in commands.py:

    '''complete "labels" - tags, open branch names, bookmark names'''

but clashes with the 'label' function in templater. One could argue that
'label' should have been called 'color' (and made to take a name like
'log.tag' or a color 'red'). One might also make the point that since
'label' is a no-op when color is off, that it would be ok to rename it
but I'll leave that to mpm.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -269,10 +269,13 @@  class localrepository(object):
         # - new obsolescence marker,
         # - working directory parent change,
         # - bookmark changes
         self.filteredrevcache = {}
 
+        # dictionary of arbitrary markers, e.g. _markers["foo"]["bar] = node
+        self._markers = {}
+
     def close(self):
         pass
 
     def _restrictcapabilities(self, caps):
         return caps