Patchwork [2,of,4] namespaces: copy implementation to new namespace object

login
register
mail settings
Submitter Sean Farley
Date Jan. 1, 2015, 1:17 a.m.
Message ID <e0bdcc1fa7619e440128.1420067856@laptop.local>
Download mbox | patch
Permalink /patch/7293/
State Accepted
Commit f4828a8f6ae9326b6a0dd52c1699f369f7b759f5
Headers show

Comments

Sean Farley - Jan. 1, 2015, 1:17 a.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1419038237 28800
#      Fri Dec 19 17:17:17 2014 -0800
# Node ID e0bdcc1fa7619e440128ef6b3ad4742d3f370f5d
# Parent  66f9e085fa63d4cd9486a5e700e5f31d3d312f80
namespaces: copy implementation to new namespace object

Patch

diff --git a/mercurial/namespaces.py b/mercurial/namespaces.py
--- a/mercurial/namespaces.py
+++ b/mercurial/namespaces.py
@@ -145,5 +145,10 @@  class namespace(object):
         """
         self.name = name
         self.templatename = templatename
         self.namemap = namemap
         self.nodemap = nodemap
+
+    def names(self, repo, node):
+        """method that returns a (sorted) list of names in a namespace that
+        match a given node"""
+        return sorted(self.nodemap(repo, node))