-
Yuya Nishihara authored
If ctx points to null or working-copy revision, its branch name may not exist in the repository. In that case, get_data('branch') should be empty because it isn't a branch-head revision. This fixes the following exceptions:: # update of empty repository Traceback (most recent call last): File "tortoisehg/hgqt/update.py", line 349, in __init__ self.setCommandWidget(UpdateWidget(repoagent, rev, self, opts)) File "tortoisehg/hgqt/update.py", line 111, in __init__ self.update_info() ... File "tortoisehg/hgqt/csinfo.py", line 175, in preset_func if ctx.node() != repo.branchtip(ctx.branch()): File "mercurial/localrepo.py", line 668, in branchtip raise error.RepoLookupError(_("unknown branch '%s'") % branch) RepoLookupError: unknown branch 'default' # graft on new working-copy branch Traceback (most recent call last): File "tortoisehg/hgqt/repowidget.py", line 1819, in graftRevisions dlg = graft.GraftDialog(self._repoagent, self, source=revlist) File "tortoisehg/hgqt/graft.py", line 76, in __init__ self.source = csinfo.create(self.repo, None, style, withupdate=True) ... File "tortoisehg/hgqt/csinfo.py", line 175, in preset_func if ctx.node() != repo.branchtip(ctx.branch()): File "mercurial/localrepo.py", line 668, in branchtip raise error.RepoLookupError(_("unknown branch '%s'") % branch) RepoLookupError: unknown branch 'foo' This bug was introduced by 74bbd0b3d1b7. --HG-- branch : stable
a44494d99209