Mercurial > python-hglib
comparison hglib/context.py @ 126:a7fe976b1931
context: add 'phase' getter
This method must be dynamic as the phase can change during the lifetime of the
changeset.
author | Paul Tonelli <paul.tonelli@logilab.fr> |
---|---|
date | Wed, 21 May 2014 12:25:30 +0200 |
parents | cc7569bffb26 |
children | 1b47146a4a2c |
comparison
equal
deleted
inserted
replaced
125:8d9a9da3e7b4 | 126:a7fe976b1931 |
---|---|
197 def hidden(self): | 197 def hidden(self): |
198 """return True if the changeset is hidden, else False""" | 198 """return True if the changeset is hidden, else False""" |
199 return bool(self._repo.log(revrange='%s and hidden()' % self._node, | 199 return bool(self._repo.log(revrange='%s and hidden()' % self._node, |
200 hidden=True)) | 200 hidden=True)) |
201 | 201 |
202 def phase(self): | |
203 """return the phase of the changeset (public, draft or secret)""" | |
204 return self._repo.phase(str(self._rev))[0][1] | |
205 | |
202 def children(self): | 206 def children(self): |
203 """return contexts for each child changeset""" | 207 """return contexts for each child changeset""" |
204 for c in self._repo.log('children(%s)' % self._node): | 208 for c in self._repo.log('children(%s)' % self._node): |
205 yield changectx(self._repo, c) | 209 yield changectx(self._repo, c) |
206 | 210 |