2011-12-24 28 views
16

Zapomniałem oznaczyć i starszą wersję moich plików tagiem wydania. Starsza wersja to r13, a ostatnia to r65. Sklonowałem najnowsze repozytorium do nowego katalogu, zrobiłem "aktualizację hg -r13", aby uzyskać starszą wersję kodu, którą chciałem oznaczyć, a następnie wykonałem polecenie tagu, ale otrzymałem wiadomość:Mercurial, jak oznaczyć starą wersję plików

abort: nie przy odgałęzieniu (użyj -f wymusić)

Czy można bezpiecznie używać opcji -f w tej sytuacji?

Odpowiedz

19

Zgaduję, że nadal możesz zrobić tagowanie w repozytorium bez aktualizacji do konkretnej wersji.

tag hg-R13 zmienna

Zobacz szczegóły na Mercurial wiki.

Próbowałem testowania go:

temp $ hg init . 
temp $ touch a.txt 
temp $ hg add a.txt 
temp $ hg commit -m "added a" 
temp $ hg status 
temp $ echo "sdwwdd" >> a.txt 
temp $ hg commit -m "modified a" 
temp $ echo "\neddwedd" >> a.txt 
temp $ hg commit -m "modified a again" 
temp $ hg log 
changeset: 2:ef40a402fdab 
tag:   tip 
user:  "xxxx" 
date:  Fri Dec 23 16:51:48 2011 -0800 
summary:  modified a again 

changeset: 1:d630dc3e2e3a 
user:  "xxxx" 
date:  Fri Dec 23 16:51:31 2011 -0800 
summary:  modified a 

changeset: 0:7c9917f24515 
user:  "xxxx" 
date:  Fri Dec 23 16:51:04 2011 -0800 
summary:  added a 

wyjściowa:

temp $ hg tag -r 1 a.txt a_1 
temp $ hg tags 
tip        3:e3157256098f 
a_1        1:d630dc3e2e3a 
a.txt        1:d630dc3e2e3a 
temp $ hg tag -r 1 all_1 
temp $ hg tags 
tip        4:a643971911d8 
all_1        1:d630dc3e2e3a 
a_1        1:d630dc3e2e3a 
a.txt        1:d630dc3e2e3a