Use dirstate to check if .hgtags needs to be added.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Use dirstate to check if .hgtags needs to be added.
manifest hash: f90af1553754eb703fc457ffdd5ded0de6fa47e0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFC15i1W7P1GVgWeRoRArDvAKCSxWDCbwU12ICwwVUoe753H8GYIwCfZGs0
HcL8cOp+eHz85AMJJE/xfck=
=1xKK
-----END PGP SIGNATURE-----
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1022,9 +1022,8 @@ def tag(ui, repo, name, rev=None, **opts
ui.status("(please commit .hgtags manually)\n")
return -1
- add = not os.path.exists(repo.wjoin(".hgtags"))
repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name))
- if add:
+ if repo.dirstate.state(".hgtags") == '?':
repo.add([".hgtags"])
if not opts['text']: