Mercurial > public > mercurial-scm > hg
diff mercurial/localrepo.py @ 7009:3d54cf97598d
tag: without a checkout, base the tag changeset on tip instead of nullid
issue916
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Mon, 08 Sep 2008 14:04:10 +0200 |
parents | 8fee8ff13d37 |
children | 58dcf10eea2b |
line wrap: on
line diff
--- a/mercurial/localrepo.py Mon Sep 08 13:07:00 2008 +0200 +++ b/mercurial/localrepo.py Mon Sep 08 14:04:10 2008 +0200 @@ -221,7 +221,13 @@ raise util.Abort(_('working copy of .hgtags is changed ' '(please commit .hgtags manually)')) - self._tag(names, node, message, local, user, date) + parents = self[None].parents() + parent = None + # use tip instead of the parent rev if there's no working copy + # (avoid creating a new head) + if len(parents) == 1 and parents[0].node() == nullid: + parent = self['tip'].node() + self._tag(names, node, message, local, user, date, parent=parent) def tags(self): '''return a mapping of tag to node'''