Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 16720:e825a89de5d7
context: add changectx.closesbranch() method
This removes the duplicated code for inspecting the 'close' extra field in
a changeset.
author | Brodie Rao <brodie@sf.io> |
---|---|
date | Sun, 13 May 2012 14:04:06 +0200 |
parents | e7bf09acd410 |
children | 07741a5d6608 |
line wrap: on
line diff
--- a/mercurial/context.py Sun May 13 14:04:04 2012 +0200 +++ b/mercurial/context.py Sun May 13 14:04:06 2012 +0200 @@ -186,6 +186,8 @@ return self._changeset[4] def branch(self): return encoding.tolocal(self._changeset[5].get("branch")) + def closesbranch(self): + return 'close' in self._changeset[5] def extra(self): return self._changeset[5] def tags(self): @@ -895,6 +897,8 @@ return self._clean def branch(self): return encoding.tolocal(self._extra['branch']) + def closesbranch(self): + return 'close' in self._extra def extra(self): return self._extra