changeset 1423:52749d8aba99

svnmeta: do not iterate revmap directly As planned by the previous patch, replace self.revmap.iterkeys with the newly added method in get_parent_svn_branch_and_rev.
author Jun Wu <quark@fb.com>
date Sat, 14 May 2016 20:41:05 +0100
parents 372afb75f465
children a794cbc174a9
files hgsubversion/svnmeta.py
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnmeta.py
+++ b/hgsubversion/svnmeta.py
@@ -551,12 +551,7 @@ class SVNMeta(object):
         """
         if (number, branch) in self.revmap:
             return number, branch
-        real_num = 0
-        for num, br in self.revmap.iterkeys():
-            if br != branch:
-                continue
-            if num <= number and num > real_num:
-                real_num = num
+        real_num = self.revmap.branchmaxrevnum(branch, number)
         if branch in self.branches:
             parent_branch = self.branches[branch][0]
             parent_branch_rev = self.branches[branch][1]