Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 19689:8dbb66f339f3
commitablectx: move extra from workingctx
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Wed, 14 Aug 2013 16:23:28 -0500 |
parents | 21e1068109a7 |
children | 65ff9fd67d8d |
comparison
equal
deleted
inserted
replaced
19688:21e1068109a7 | 19689:8dbb66f339f3 |
---|---|
989 return self._clean | 989 return self._clean |
990 def branch(self): | 990 def branch(self): |
991 return encoding.tolocal(self._extra['branch']) | 991 return encoding.tolocal(self._extra['branch']) |
992 def closesbranch(self): | 992 def closesbranch(self): |
993 return 'close' in self._extra | 993 return 'close' in self._extra |
994 def extra(self): | |
995 return self._extra | |
994 | 996 |
995 class workingctx(commitablectx): | 997 class workingctx(commitablectx): |
996 """A workingctx object makes access to data related to | 998 """A workingctx object makes access to data related to |
997 the current working directory convenient. | 999 the current working directory convenient. |
998 date - any valid date string or (unixtime, offset), or None. | 1000 date - any valid date string or (unixtime, offset), or None. |
1015 def _parents(self): | 1017 def _parents(self): |
1016 p = self._repo.dirstate.parents() | 1018 p = self._repo.dirstate.parents() |
1017 if p[1] == nullid: | 1019 if p[1] == nullid: |
1018 p = p[:-1] | 1020 p = p[:-1] |
1019 return [changectx(self._repo, x) for x in p] | 1021 return [changectx(self._repo, x) for x in p] |
1020 | |
1021 def extra(self): | |
1022 return self._extra | |
1023 | 1022 |
1024 def tags(self): | 1023 def tags(self): |
1025 t = [] | 1024 t = [] |
1026 for p in self.parents(): | 1025 for p in self.parents(): |
1027 t.extend(p.tags()) | 1026 t.extend(p.tags()) |