Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/hgweb_mod.py @ 5336:24de027551c1
Merge with crew-stable
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Mon, 24 Sep 2007 19:14:18 -0300 |
parents | 05889b6b1468 8ee5b8129e7b |
children | 48c22c719f8c 800e2756c9ab |
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py Mon Sep 24 12:42:25 2007 -0500 +++ b/mercurial/hgweb/hgweb_mod.py Mon Sep 24 19:14:18 2007 -0300 @@ -141,7 +141,10 @@ def nodebranchdict(self, ctx): branches = [] branch = ctx.branch() - if self.repo.branchtags()[branch] == ctx.node(): + # If this is an empty repo, ctx.node() == nullid, + # ctx.branch() == 'default', but branchtags() is + # an empty dict. Using dict.get avoids a traceback. + if self.repo.branchtags().get(branch) == ctx.node(): branches.append({"name": branch}) return branches