mercurial/commands.py
changeset 710 ca9353f43345
parent 709 cc2e8f3d4412
child 712 b4f0fad0ea64
equal deleted inserted replaced
709:cc2e8f3d4412 710:ca9353f43345
  1020         if ".hgtags" in x:
  1020         if ".hgtags" in x:
  1021             ui.warn("abort: working copy of .hgtags is changed!\n")
  1021             ui.warn("abort: working copy of .hgtags is changed!\n")
  1022             ui.status("(please commit .hgtags manually)\n")
  1022             ui.status("(please commit .hgtags manually)\n")
  1023             return -1
  1023             return -1
  1024 
  1024 
  1025     add = not os.path.exists(repo.wjoin(".hgtags"))
       
  1026     repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name))
  1025     repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name))
  1027     if add:
  1026     if repo.dirstate.state(".hgtags") == '?':
  1028         repo.add([".hgtags"])
  1027         repo.add([".hgtags"])
  1029 
  1028 
  1030     if not opts['text']:
  1029     if not opts['text']:
  1031         opts['text'] = "Added tag %s for changeset %s" % (name, r)
  1030         opts['text'] = "Added tag %s for changeset %s" % (name, r)
  1032 
  1031