[PATCH 2 of 7] namespaces: add method to get singular name of namespace

Sean Farley sean.michael.farley at gmail.com
Tue Dec 16 18:01:56 CST 2014


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1418613147 28800
#      Sun Dec 14 19:12:27 2014 -0800
# Node ID 20d4ee5a54a247e6b5f8190276a665b96317bd51
# Parent  47d0996687d81753386f01e26037be30992dbb59
namespaces: add method to get singular name of namespace

diff --git a/mercurial/namespaces.py b/mercurial/namespaces.py
--- a/mercurial/namespaces.py
+++ b/mercurial/namespaces.py
@@ -83,5 +83,9 @@ class namespaces(object):
                     cl = repo.changelog
                     maxrev = max(cl.rev(node) for node in n)
                     return cl.node(maxrev)
                 return n[0]
         raise KeyError(_('no such name: %s') % name)
+
+    def singular(self, namespace):
+        """method that returns the singular version of a namespace"""
+        return self._names[namespace]['singular']


More information about the Mercurial-devel mailing list