##// END OF EJS Templates
git: implement basic bookmark activation...
Josef 'Jeff' Sipek -
r45114:7cab8dbd default
parent child Browse files
Show More
@@ -144,6 +144,8 b' def _setupdothg(ui, path):'
144 144 class gitbmstore(object):
145 145 def __init__(self, gitrepo):
146 146 self.gitrepo = gitrepo
147 self._aclean = True
148 self._active = gitrepo.references['HEAD'] # git head, not mark
147 149
148 150 def __contains__(self, name):
149 151 return (
@@ -181,7 +183,18 b' class gitbmstore(object):'
181 183
182 184 @active.setter
183 185 def active(self, mark):
184 raise NotImplementedError
186 githead = mark is not None and (_BMS_PREFIX + mark) or None
187 if githead is not None and githead not in self.gitrepo.references:
188 raise AssertionError(b'bookmark %s does not exist!' % mark)
189
190 self._active = githead
191 self._aclean = False
192
193 def _writeactive(self):
194 if self._aclean:
195 return
196 self.gitrepo.references.create('HEAD', self._active, True)
197 self._aclean = True
185 198
186 199 def names(self, node):
187 200 r = []
General Comments 0
You need to be logged in to leave comments. Login now