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

Sean Farley sean.michael.farley at gmail.com
Tue Apr 1 03:01:44 UTC 2014


Sean Farley <sean.michael.farley at gmail.com> writes:

> # HG changeset patch
> # User Sean Farley <sean.michael.farley at 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.


More information about the Mercurial-devel mailing list