[PATCH 1 of 3 V2] context: add a method to tell if a changeset is secret

Matt Mackall mpm at selenic.com
Fri Jan 15 14:39:24 CST 2016


On Wed, 2015-12-30 at 22:39 +0100, Pierre-Yves David wrote:
> 
> On 12/27/2015 05:46 AM, Laurent Charignon wrote:
> > # HG changeset patch
> > # User Laurent Charignon <lcharignon at fb.com>
> > # Date 1450897553 28800
> > #      Wed Dec 23 11:05:53 2015 -0800
> > # Node ID 1721c112f0194a078103b3b673de236b5cd5cd52
> > # Parent  fe376159a58d9b3d748b669ac011b0eed0346fea
> > context: add a method to tell if a changeset is secret
> > 
> > Before this patch we had to compare the phase of a changeset to
> > phases.secret
> > to know if a changeset was secret. This patch gives us an easier way to do
> > that
> > and can make our code more legible.
> 
> I do not think this is going to be widely used enough to justify a new 
> method on an already large god object.

If it's a god object, it's a very minor deity. Here are its public methods:

class basectx(object):
    def __new__(cls, repo, changeid='', *args, **kwargs):
    def __str__(self):
    def __int__(self):
    def __repr__(self):
    def __eq__(self, other):
    def __ne__(self, other):
    def __contains__(self, key):
    def __getitem__(self, key):
    def __iter__(self):
    def substate(self):
    def subrev(self, subpath):
    def rev(self):
    def node(self):
    def hex(self):
    def manifest(self):
    def repo(self):
    def phasestr(self):
    def mutable(self):
    def getfileset(self, expr):
    def obsolete(self):
    def extinct(self):
    def unstable(self):
    def bumped(self):
    def divergent(self):
    def troubled(self):
    def troubles(self):
    def parents(self):
    def p1(self):
    def p2(self):
    def filenode(self, path):
    def flags(self, path):
    def sub(self, path):
    def nullsub(self, path, pctx):
    def workingsub(self, path):
    def match(self, pats=[], include=None, exclude=None, default='glob',
    def diff(self, ctx2=None, match=None, **opts):
    def dirs(self):
    def hasdir(self, dir):
    def dirty(self, missing=False, merge=True, branch=True):
    def status(self, other=None, match=None, listignored=False,

There's some stuff here that doesn't need to be here and a few things that
probably should. But I would trade
extinct/unstable/bumped/divergent/troubles/troubled for public/draft/secret
without much hesitation.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list