Mercurial > public > mercurial-scm > hg
comparison mercurial/branchmap.py @ 20186:f5b461a4bc55
branchmap: introduce branchtip() method
author | Brodie Rao <brodie@sf.io> |
---|---|
date | Mon, 16 Sep 2013 01:08:29 -0700 |
parents | 7d4219512823 |
children | 3a3727829607 |
comparison
equal
deleted
inserted
replaced
20185:7d4219512823 | 20186:f5b461a4bc55 |
---|---|
164 return ((self.tipnode == repo.changelog.node(self.tiprev)) | 164 return ((self.tipnode == repo.changelog.node(self.tiprev)) |
165 and (self.filteredhash == self._hashfiltered(repo))) | 165 and (self.filteredhash == self._hashfiltered(repo))) |
166 except IndexError: | 166 except IndexError: |
167 return False | 167 return False |
168 | 168 |
169 def _branchtip(self, heads): | |
170 tip = heads[-1] | |
171 closed = True | |
172 for h in reversed(heads): | |
173 if h not in self._closednodes: | |
174 tip = h | |
175 closed = False | |
176 break | |
177 return tip, closed | |
178 | |
179 def branchtip(self, branch): | |
180 return self._branchtip(self[branch])[0] | |
181 | |
169 def copy(self): | 182 def copy(self): |
170 """return an deep copy of the branchcache object""" | 183 """return an deep copy of the branchcache object""" |
171 return branchcache(self, self.tipnode, self.tiprev, self.filteredhash, | 184 return branchcache(self, self.tipnode, self.tiprev, self.filteredhash, |
172 self._closednodes) | 185 self._closednodes) |
173 | 186 |