mercurial/localrepo.py
changeset 7009 3d54cf97598d
parent 7008 8fee8ff13d37
child 7016 58dcf10eea2b
equal deleted inserted replaced
7008:8fee8ff13d37 7009:3d54cf97598d
   219         for x in self.status()[:5]:
   219         for x in self.status()[:5]:
   220             if '.hgtags' in x:
   220             if '.hgtags' in x:
   221                 raise util.Abort(_('working copy of .hgtags is changed '
   221                 raise util.Abort(_('working copy of .hgtags is changed '
   222                                    '(please commit .hgtags manually)'))
   222                                    '(please commit .hgtags manually)'))
   223 
   223 
   224         self._tag(names, node, message, local, user, date)
   224         parents = self[None].parents()
       
   225         parent = None
       
   226         # use tip instead of the parent rev if there's no working copy
       
   227         # (avoid creating a new head)
       
   228         if len(parents) == 1 and parents[0].node() == nullid:
       
   229             parent = self['tip'].node()
       
   230         self._tag(names, node, message, local, user, date, parent=parent)
   225 
   231 
   226     def tags(self):
   232     def tags(self):
   227         '''return a mapping of tag to node'''
   233         '''return a mapping of tag to node'''
   228         if self.tagscache:
   234         if self.tagscache:
   229             return self.tagscache
   235             return self.tagscache