# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1463165293 -3600
# Node ID 951a87f2f2bdfe36e1f2860af25e3a87bb56c168
# Parent  7e98352a37db9c185bebc28f9ae150e2e8c4ca9a
maps: add the "revhashes" method to RevMap

This is a part of the bigger plan to get rid of reading or writing rev_map
directly without going through the RevMap class.

The "revhashes" method will be used in revset_svnrev.

diff --git a/hgsubversion/maps.py b/hgsubversion/maps.py
--- a/hgsubversion/maps.py
+++ b/hgsubversion/maps.py
@@ -355,6 +355,11 @@ class RevMap(dict):
         check = lambda x: x[0][1] == branch and x[0][0] < rev.revnum
         return sorted(filter(check, self.iteritems()), reverse=True)
 
+    def revhashes(self, revnum):
+        for key, value in self.iteritems():
+            if key[0] == revnum:
+                yield value
+
     def clear(self):
         self._write()
         dict.clear(self)