diff -r 7546bf46bfcd -r 0bd730fbcc2b mercurial/branchmap.py --- a/mercurial/branchmap.py Mon Mar 18 19:11:55 2019 +0300 +++ b/mercurial/branchmap.py Mon Mar 18 19:31:45 2019 +0300 @@ -175,6 +175,10 @@ def iteritems(self): return self.entries.iteritems() + def hasbranch(self, label): + """ checks whether a branch of this name exists or not """ + return label in self.entries + @classmethod def fromfile(cls, repo): f = None