##// END OF EJS Templates
tag: without a checkout, base the tag changeset on tip instead of nullid...
Benoit Boissinot -
r7009:3d54cf97 default
parent child Browse files
Show More
@@ -0,0 +1,13 b''
1 #!/bin/sh
2
3 hg init
4 echo a > a
5 hg commit -Am "test" -d "1000000 0"
6
7 echo % issue 916
8 hg up 000000
9 hg parents
10 hg tag -r tip -d "1000000 0" "jglick"
11 echo % should it be removed ?
12 cat .hgtags
13 hg tip
@@ -0,0 +1,11 b''
1 adding a
2 % issue 916
3 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
4 % should it be removed ?
5 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 jglick
6 changeset: 1:99b47705d075
7 tag: tip
8 user: test
9 date: Mon Jan 12 13:46:40 1970 +0000
10 summary: Added tag jglick for changeset 0acdaf898367
11
@@ -221,7 +221,13 b' class localrepository(repo.repository):'
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'''
General Comments 0
You need to be logged in to leave comments. Login now