mercurial/commands.py
changeset 712 b4f0fad0ea64
parent 711 734712f37de3
parent 710 ca9353f43345
child 714 29fcd195e056
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1023,9 +1023,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']: