hgext/git/__init__.py
branchstable
changeset 49384 3b8fce9a74df
parent 49077 20d151e43429
child 50779 39eb3aab3e63
equal deleted inserted replaced
49380:55adff810546 49384:3b8fce9a74df
   202             return None
   202             return None
   203         return pycompat.fsencode(h.target[len(_BMS_PREFIX) :])
   203         return pycompat.fsencode(h.target[len(_BMS_PREFIX) :])
   204 
   204 
   205     @active.setter
   205     @active.setter
   206     def active(self, mark):
   206     def active(self, mark):
   207         githead = mark is not None and (_BMS_PREFIX + mark) or None
   207         githead = None
       
   208         if mark is not None:
       
   209             githead = _BMS_PREFIX + pycompat.fsdecode(mark)
   208         if githead is not None and githead not in self.gitrepo.references:
   210         if githead is not None and githead not in self.gitrepo.references:
   209             raise AssertionError(b'bookmark %s does not exist!' % mark)
   211             raise AssertionError(b'bookmark %s does not exist!' % mark)
   210 
   212 
   211         self._active = githead
   213         self._active = githead
   212         self._aclean = False
   214         self._aclean = False
   252                     gitutil.togitnode(node),
   254                     gitutil.togitnode(node),
   253                     force=True,
   255                     force=True,
   254                 )
   256                 )
   255 
   257 
   256     def checkconflict(self, mark, force=False, target=None):
   258     def checkconflict(self, mark, force=False, target=None):
   257         githead = _BMS_PREFIX + mark
   259         githead = _BMS_PREFIX + pycompat.fsdecode(mark)
   258         cur = self.gitrepo.references['HEAD']
   260         cur = self.gitrepo.references['HEAD']
   259         if githead in self.gitrepo.references and not force:
   261         if githead in self.gitrepo.references and not force:
   260             if target:
   262             if target:
   261                 if self.gitrepo.references[githead] == target and target == cur:
   263                 if self.gitrepo.references[githead] == target and target == cur:
   262                     # re-activating a bookmark
   264                     # re-activating a bookmark