mercurial/hgweb/hgweb_mod.py
changeset 5331 8ee5b8129e7b
parent 5289 ed6df6b1c29a
child 5336 24de027551c1
equal deleted inserted replaced
5330:4528858e7202 5331:8ee5b8129e7b
   139         return [{"name": i} for i in self.repo.nodetags(node)]
   139         return [{"name": i} for i in self.repo.nodetags(node)]
   140 
   140 
   141     def nodebranchdict(self, ctx):
   141     def nodebranchdict(self, ctx):
   142         branches = []
   142         branches = []
   143         branch = ctx.branch()
   143         branch = ctx.branch()
   144         if self.repo.branchtags()[branch] == ctx.node():
   144         # If this is an empty repo, ctx.node() == nullid,
       
   145         # ctx.branch() == 'default', but branchtags() is
       
   146         # an empty dict. Using dict.get avoids a traceback.
       
   147         if self.repo.branchtags().get(branch) == ctx.node():
   145             branches.append({"name": branch})
   148             branches.append({"name": branch})
   146         return branches
   149         return branches
   147 
   150 
   148     def showtag(self, t1, node=nullid, **args):
   151     def showtag(self, t1, node=nullid, **args):
   149         for t in self.repo.nodetags(node):
   152         for t in self.repo.nodetags(node):