[issue258] tag handling is wrong

Bryan O'Sullivan mercurial-bugs at selenic.com
Thu May 18 12:37:17 CDT 2006


New submission from Bryan O'Sullivan <bos at serpentine.com>:

The logic in localrepo.tags is wrong.  It reads each head of the .hgtags file
and parses it.  The problem is that if .hgtags gets deleted and recreated, each
deleted rev of the file is treated as a head, because it has no children.

If a deleted .hgtags file contains a syntax error or refers to a changeset that
doesn't exist (e.g. due to clone -r), the result is "ignoring invalid tag"
errors that cannot be fixed without major surgery.

This is easy to reproduce:

  hg init taggy
  cd taggy
  echo a b > .hgtags
  hg ci -Ama
  hg rm .hgtags
  hg ci -mb
  echo c d > .hgtags
  hg ci -Amc
  hg tags

I don't know why locarepo.tags is reading anything other than .hgtags from the
working directory.  Even if the current behaviour was changed to read .hgtags
from each head of the repo, instead of each head of the file, it would still be
weird to explain and justify.

Also, explaining how to fix problems with this multi-head scheme is likely to be
a nightmare: "yeah, that error is in a version of .hgtags that you can't
actually see because you're at a different head, but it's reading it anyway;
update over there, fix it, commit the fix, update back, and try again".

----------
messages: 1321
nosy: bos
priority: urgent
status: unread
title: tag handling is wrong

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



More information about the Mercurial mailing list