# HG changeset patch # User Sean Farley # Date 2015-01-15 04:06:44 # Node ID fef1146b84421d9f26525ae51ae5efce593e0327 # Parent 9ef23402166717cba31b3eb265db058528355ebd namespaces: add logname member to namespace object Previously, there was no way to change the name used for 'hg log' output. This was inconvenient for extensions that want a template name longer than 12 characters (e.g. remotebookmarks) but a different name for 'hg log'. This patch only adds the member to the object, a future patch will update the 'hg log' code. diff --git a/mercurial/namespaces.py b/mercurial/namespaces.py --- a/mercurial/namespaces.py +++ b/mercurial/namespaces.py @@ -120,12 +120,14 @@ class namespace(object): """ - def __init__(self, name, templatename=None, listnames=None, namemap=None, - nodemap=None): + def __init__(self, name, templatename=None, logname=None, listnames=None, + namemap=None, nodemap=None): """create a namespace name: the namespace to be registered (in plural form) templatename: the name to use for templating + logname: the name to use for log output; if not specified templatename + is used listnames: function to list all names namemap: function that inputs a node, output name(s) nodemap: function that inputs a name, output node(s) @@ -133,10 +135,15 @@ class namespace(object): """ self.name = name self.templatename = templatename + self.logname = logname self.listnames = listnames self.namemap = namemap self.nodemap = nodemap + # if logname is not specified, use the template name as backup + if self.logname is None: + self.logname = self.templatename + def names(self, repo, node): """method that returns a (sorted) list of names in a namespace that match a given node"""