Mercurial > hgsubversion
changeset 533:7b330c576920
svnmeta: speedup get_parent_revision() in common case
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 30 Jan 2010 09:49:30 +0100 |
parents | b847e1a3ccd0 |
children | e38f110e7088 |
files | hgsubversion/svnmeta.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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]