How can one change the name of a tag?

后端 未结 5 1212
我在风中等你
我在风中等你 2021-02-19 03:59

I have made a tag in mercurial:

hg tag release_123

Later on I found out that the name was wrong, it should be release_124. Is it pos

5条回答
  •  滥情空心
    2021-02-19 04:35

    Like what @matt-ellen has said, but in reverse. Because I like to be sure the revision is tagged properly before I delete the old tag.

    Here I create an example of a repo with 4 revisions.

    1. View the log
    2. View the tags (none, and tip)
    3. Create a tag at revision #2 (using the hash)
    4. View tags (now there is one, and tip)
    5. Create new tag name
    6. View tags (now there are two, and tip)
    7. Remove bad tag name
    8. View tags (now there is one, and tip)

    Example:

    $ hg log
    
    changeset:   3:271cb2836c23
    user:        user 
    date:        Sat Mar 01 13:49:55 2014 -0600
    summary:     Very important things.
    
    changeset:   2:3c953ee62faf
    user:        user 
    date:        Wed Feb 26 00:17:55 2014 -0600
    summary:     Did some changes.
    
    changeset:   1:54e2275eed1e
    user:        user 
    date:        Tue Feb 25 01:34:31 2014 -0600
    summary:     So, lots of things here.
    
    changeset:   0:3f3e1aee4e14
    user:        user 
    date:        Sat Feb 22 00:42:29 2014 -0600
    summary:     Inital project checkin.
    
    $ hg tags
    tip          3:271cb2836c23
    
    $ hg tag -r 3c953ee62faf release_123
    $ hg tags
    tip           3:271cb2836c23
    release_123   2:3c953ee62faf
    
    $ hg tag -r 3c953ee62faf release_124
    $ hg tags
    tip           3:271cb2836c23
    release_123   2:3c953ee62faf
    release_124   2:3c953ee62faf
    
    $ hg tag --remove release_123
    $ hg tags
    tip           3:271cb2836c23
    release_124   2:3c953ee62faf
    

提交回复
热议问题