comparison mercurial/context.py @ 19690:65ff9fd67d8d

commitablectx: move tags from workingctx
author Sean Farley <sean.michael.farley@gmail.com>
date Wed, 14 Aug 2013 16:24:16 -0500
parents 8dbb66f339f3
children 33ae2052d924
comparison
equal deleted inserted replaced
19689:8dbb66f339f3 19690:65ff9fd67d8d
992 def closesbranch(self): 992 def closesbranch(self):
993 return 'close' in self._extra 993 return 'close' in self._extra
994 def extra(self): 994 def extra(self):
995 return self._extra 995 return self._extra
996 996
997 def tags(self):
998 t = []
999 for p in self.parents():
1000 t.extend(p.tags())
1001 return t
1002
997 class workingctx(commitablectx): 1003 class workingctx(commitablectx):
998 """A workingctx object makes access to data related to 1004 """A workingctx object makes access to data related to
999 the current working directory convenient. 1005 the current working directory convenient.
1000 date - any valid date string or (unixtime, offset), or None. 1006 date - any valid date string or (unixtime, offset), or None.
1001 user - username string, or None. 1007 user - username string, or None.
1017 def _parents(self): 1023 def _parents(self):
1018 p = self._repo.dirstate.parents() 1024 p = self._repo.dirstate.parents()
1019 if p[1] == nullid: 1025 if p[1] == nullid:
1020 p = p[:-1] 1026 p = p[:-1]
1021 return [changectx(self._repo, x) for x in p] 1027 return [changectx(self._repo, x) for x in p]
1022
1023 def tags(self):
1024 t = []
1025 for p in self.parents():
1026 t.extend(p.tags())
1027 return t
1028 1028
1029 def bookmarks(self): 1029 def bookmarks(self):
1030 b = [] 1030 b = []
1031 for p in self.parents(): 1031 for p in self.parents():
1032 b.extend(p.bookmarks()) 1032 b.extend(p.bookmarks())