[issue2430] behaviour of hg rollback with preceeding hg tag

pm bugs at mercurial.selenic.com
Sun Oct 10 08:12:14 UTC 2010


New submission from pm <mercurial at planetmaker.de>:

Consider the following sequence (tested in 1.6.0):

hg tag XY
hg rollback
(edit comething)
hg ci -m "Fix: some last-minute nasty typo"

With the current behaviour of hg rollback the .hgtags file remains modified
and very easily an unwanted tag is committed. This behaviour is somewhat
unexpected as it is different to a similar sequence

hg ci -m "Message with typo"
hg rollback
hg ci -m "Correct commit message"

Doing the same with hg tag complains (correctly) about modified .hgtags. The
inconsistency in this behaviour is that hg tag is both, a command modifying
files and committing it immediately.

Not sure that there's a better solution than current behaviour, as it will
probably end up inconsistent at some point however done.
I see three possible solutions: 
a) Let a hg rollback undo the changes in .hgtags
b) At least warn on a rollback with a modified .hgtags file that this file
has been changed wrt the pristine state and manual revert might be needed in
that place.
c) Allow let hg tags behave similar to a hg commit, i.e. allow such commit
to (also) contain other changes to the repository. But I don't prefer this
solution.

Maybe there are other options to a similar end.

----------
messages: 13936
nosy: planetmaker
priority: wish
status: unread
title: behaviour of hg rollback with preceeding hg tag

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2430>
____________________________________________________


More information about the Mercurial-devel mailing list