648 replacing code that is expected to call a hook. |
648 replacing code that is expected to call a hook. |
649 """ |
649 """ |
650 return hook.hook(self.ui, self, name, throw, **args) |
650 return hook.hook(self.ui, self, name, throw, **args) |
651 |
651 |
652 def tag(self, names, node, message, local, user, date, editor=False): |
652 def tag(self, names, node, message, local, user, date, editor=False): |
653 '''tag a revision with one or more symbolic names. |
653 tagsmod.tag(self, names, node, message, local, user, date, |
654 |
654 editor=editor) |
655 names is a list of strings or, when adding a single tag, names may be a |
|
656 string. |
|
657 |
|
658 if local is True, the tags are stored in a per-repository file. |
|
659 otherwise, they are stored in the .hgtags file, and a new |
|
660 changeset is committed with the change. |
|
661 |
|
662 keyword arguments: |
|
663 |
|
664 local: whether to store tags in non-version-controlled file |
|
665 (default False) |
|
666 |
|
667 message: commit message to use if committing |
|
668 |
|
669 user: name of user to use if committing |
|
670 |
|
671 date: date tuple to use if committing''' |
|
672 |
|
673 if not local: |
|
674 m = matchmod.exact(self.root, '', ['.hgtags']) |
|
675 if any(self.status(match=m, unknown=True, ignored=True)): |
|
676 raise error.Abort(_('working copy of .hgtags is changed'), |
|
677 hint=_('please commit .hgtags manually')) |
|
678 |
|
679 self.tags() # instantiate the cache |
|
680 tagsmod._tag(self.unfiltered(), names, node, message, local, user, date, |
|
681 editor=editor) |
|
682 |
655 |
683 @filteredpropertycache |
656 @filteredpropertycache |
684 def _tagscache(self): |
657 def _tagscache(self): |
685 '''Returns a tagscache object that contains various tags related |
658 '''Returns a tagscache object that contains various tags related |
686 caches.''' |
659 caches.''' |