# HG changeset patch # User Patrick Mezard # Date 1264841370 -3600 # Node ID 7b330c576920ed42eb11daad6cc35e90650ebf87 # Parent b847e1a3ccd0cc1f70bb5b25e36decea341766c4 svnmeta: speedup get_parent_revision() in common case diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py --- a/hgsubversion/svnmeta.py +++ b/hgsubversion/svnmeta.py @@ -354,10 +354,11 @@ class SVNMeta(object): '''Get the parent revision hash for a commit on a specific branch. ''' tag = self.get_path_tag(self.remotename(branch)) - limitedtags = maps.TagMap(self.repo, endrev=number-1) - if tag in limitedtags: - ha = limitedtags[tag] - return ha + if tag: + limitedtags = maps.TagMap(self.repo, endrev=number-1) + if tag in limitedtags: + ha = limitedtags[tag] + return ha r, br = self.get_parent_svn_branch_and_rev(number, branch) if r is not None: return self.revmap[r, br]