comparison mercurial/localrepo.py @ 8796:2bcef677a6c3

localrepo: remove 'closed' argument to heads(...) function - repository heads are not associated with the closed attribute, so remove it making the code in line with the concept. - Fix functions that were calling heads with the parameter. - Adjust webcommands.branches to include the concept of inactive as well as open and closed branches - Fix code and docstrings in commands to make the correct use of closed branches & branch heads clearer - Improve grammar of 'hg heads' help text (2nd submission) this does not alter the cli for hg branches, that work is still to be done
author John Mulligan <phlogistonjohn@asynchrono.us>
date Wed, 10 Jun 2009 19:11:49 -0400
parents f037187a6f68
children 9ed150d2fbd5
comparison
equal deleted inserted replaced
8795:51c29aec0b75 8796:2bcef677a6c3
1132 self.dirstate.add(dest) 1132 self.dirstate.add(dest)
1133 self.dirstate.copy(source, dest) 1133 self.dirstate.copy(source, dest)
1134 finally: 1134 finally:
1135 wlock.release() 1135 wlock.release()
1136 1136
1137 def heads(self, start=None, closed=False): 1137 def heads(self, start=None):
1138 heads = self.changelog.heads(start) 1138 heads = self.changelog.heads(start)
1139 def display(head):
1140 if closed:
1141 return True
1142 extras = self.changelog.read(head)[5]
1143 return ('close' not in extras)
1144 # sort the output in rev descending order 1139 # sort the output in rev descending order
1145 heads = [(-self.changelog.rev(h), h) for h in heads if display(h)] 1140 heads = [(-self.changelog.rev(h), h) for h in heads]
1146 return [n for (r, n) in sorted(heads)] 1141 return [n for (r, n) in sorted(heads)]
1147 1142
1148 def branchheads(self, branch=None, start=None, closed=False): 1143 def branchheads(self, branch=None, start=None, closed=False):
1149 if branch is None: 1144 if branch is None:
1150 branch = self[None].branch() 1145 branch = self[None].branch()